Search in sources :

Example 1 with AuthenticationResultCacher

use of org.apache.qpid.server.security.auth.manager.AuthenticationResultCacher in project qpid-broker-j by apache.

the class OAuth2AuthenticationProviderImpl method onOpen.

@Override
protected void onOpen() {
    super.onOpen();
    String type = getIdentityResolverType();
    _identityResolverService = new QpidServiceLoader().getInstancesByType(OAuth2IdentityResolverService.class).get(type);
    _tlsProtocolWhiteList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_PROTOCOL_WHITE_LIST);
    _tlsProtocolBlackList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_PROTOCOL_BLACK_LIST);
    _tlsCipherSuiteWhiteList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_WHITE_LIST);
    _tlsCipherSuiteBlackList = getContextValue(List.class, ParameterizedTypes.LIST_OF_STRINGS, CommonProperties.QPID_SECURITY_TLS_CIPHER_SUITE_BLACK_LIST);
    _connectTimeout = getContextValue(Integer.class, AUTHENTICATION_OAUTH2_CONNECT_TIMEOUT);
    _readTimeout = getContextValue(Integer.class, AUTHENTICATION_OAUTH2_READ_TIMEOUT);
    Integer cacheMaxSize = getContextValue(Integer.class, AUTHENTICATION_CACHE_MAX_SIZE);
    Long cacheExpirationTime = getContextValue(Long.class, AUTHENTICATION_CACHE_EXPIRATION_TIME);
    Integer cacheIterationCount = getContextValue(Integer.class, AUTHENTICATION_CACHE_ITERATION_COUNT);
    if (cacheMaxSize == null || cacheMaxSize <= 0 || cacheExpirationTime == null || cacheExpirationTime <= 0 || cacheIterationCount == null || cacheIterationCount < 0) {
        LOGGER.debug("disabling authentication result caching");
        cacheMaxSize = 0;
        cacheExpirationTime = 1L;
        cacheIterationCount = 0;
    }
    _authenticationResultCacher = new AuthenticationResultCacher(cacheMaxSize, cacheExpirationTime, cacheIterationCount);
}
Also used : AuthenticationResultCacher(org.apache.qpid.server.security.auth.manager.AuthenticationResultCacher) QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) List(java.util.List)

Aggregations

List (java.util.List)1 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)1 AuthenticationResultCacher (org.apache.qpid.server.security.auth.manager.AuthenticationResultCacher)1