use of org.neo4j.server.security.enterprise.auth.plugin.spi.CacheableAuthInfo in project neo4j by neo4j.
the class PluginAuthInfo method createCacheable.
public static PluginAuthInfo createCacheable(AuthInfo authInfo, String realmName, SecureHasher secureHasher) {
if (authInfo instanceof CacheableAuthInfo) {
byte[] credentials = ((CacheableAuthInfo) authInfo).credentials();
SimpleHash hashedCredentials = secureHasher.hash(credentials);
return new PluginAuthInfo(authInfo, hashedCredentials, realmName);
} else {
return new PluginAuthInfo(authInfo.principal(), realmName, authInfo.roles().stream().collect(Collectors.toSet()));
}
}
Aggregations