Skip to content

Commit

Permalink
Merge pull request #25 from IlyaLisov/#20
Browse files Browse the repository at this point in the history
#20 Change Map to thread-safe implementation
  • Loading branch information
IlyaLisov authored Jan 22, 2024
2 parents 190c55e + 3585b39 commit 3cfb4ac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

import io.github.ilyalisov.jwt.config.TokenParameters;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* Basic implementation of TokenStorage. Not thread-safe.
* Basic implementation of TokenStorage.
*/
public class TokenStorageImpl implements TokenStorage {

/**
* Inner map of key-value pairs.
*/
private final Map<String, String> tokens;
private final ConcurrentHashMap<String, String> tokens;

/**
* Creates an object.
*/
public TokenStorageImpl(
) {
this.tokens = new HashMap<>();
this.tokens = new ConcurrentHashMap<>();
}

private String subjectTokenKey(
Expand Down

0 comments on commit 3cfb4ac

Please sign in to comment.