[bisq-network/bisq] Security framework for the API (#2461)
Bernard Labno
notifications at github.com
Mon Feb 25 10:19:23 UTC 2019
blabno commented on this pull request.
> +import java.util.UUID;
+
+public class TokenRegistry {
+
+ public static final long TTL = 30 * 60 * 1000;
+
+ private final TimeProvider timeProvider;
+ private final RandomStringGenerator randomStringGenerator;
+ private Map<String, Long> tokens = new HashMap<>();
+
+ public TokenRegistry() {
+ this(() -> UUID.randomUUID().toString(), System::currentTimeMillis);
+ }
+
+ public TokenRegistry(RandomStringGenerator randomStringGenerator, TimeProvider timeProvider) {
+ this.timeProvider = timeProvider;
Time provider is meant to provide actual time. It is used as abstraction for unit tests.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2461#discussion_r259757732
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190225/c64d9abd/attachment.html>
More information about the bisq-github
mailing list