diff --git a/services-security-parent/services-security/src/main/java/io/scalecube/services/security/CompositeAuthenticator.java b/services-security-parent/services-security/src/main/java/io/scalecube/services/security/RegistryBasedAuthenticator.java similarity index 66% rename from services-security-parent/services-security/src/main/java/io/scalecube/services/security/CompositeAuthenticator.java rename to services-security-parent/services-security/src/main/java/io/scalecube/services/security/RegistryBasedAuthenticator.java index 3a0ced362..e04657fa0 100644 --- a/services-security-parent/services-security/src/main/java/io/scalecube/services/security/CompositeAuthenticator.java +++ b/services-security-parent/services-security/src/main/java/io/scalecube/services/security/RegistryBasedAuthenticator.java @@ -10,17 +10,18 @@ * Internally maintains a map of service claims where key is some id (of type {@code long}) and * value is {@link ServiceClaims} object. * - * @see #saveAuthData(long, ServiceClaims) - * @see #getAuthData(long) - * @see #removeAuthData(long) + * @see #put(long, ServiceClaims) + * @see #get(long) + * @see #remove(long) + * @see #containsKey(long) */ -public final class CompositeAuthenticator implements Authenticator { +public final class RegistryBasedAuthenticator implements Authenticator { private final Authenticator authenticator; private final Map registry = new NonBlockingHashMapLong<>(); - public CompositeAuthenticator(Authenticator authenticator) { + public RegistryBasedAuthenticator(Authenticator authenticator) { this.authenticator = authenticator; } @@ -29,19 +30,19 @@ public Mono apply(Map credentials) { return authenticator.apply(credentials); } - public void saveAuthData(long id, ServiceClaims serviceClaims) { + public void put(long id, ServiceClaims serviceClaims) { registry.put(id, serviceClaims); } - public ServiceClaims getAuthData(long id) { + public ServiceClaims get(long id) { return registry.get(id); } - public void removeAuthData(long id) { + public void remove(long id) { registry.remove(id); } - public boolean containsAuthData(long id) { + public boolean containsKey(long id) { return registry.containsKey(id); } }