public void accept(final ConnectionHandlerFactory connectionHandlerFactory, final SaslAuthenticationFactory authenticationFactory) { synchronized (connectionLock) { try { resourceUntick("an inbound connection"); } catch (NotOpenException e) { throw new IllegalStateException("Accept after endpoint close", e); } boolean ok = false; try { final ConnectionImpl connection = new ConnectionImpl(EndpointImpl.this, connectionHandlerFactory, this, null, authenticationFactory, AuthenticationConfiguration.empty(), saslProtocol); connections.add(connection); connection.getConnectionHandler().addCloseHandler(SpiUtils.asyncClosingCloseHandler(connection)); connection.addCloseHandler(connectionCloseHandler); connection.addCloseHandler(resourceCloseHandler); ok = true; } finally { if (! ok) closeTick1("a failed inbound connection"); } } }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none. * The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field. * No host, port, or protocol information is copied to the resultant configuration from the URI. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); log.tracef("getAuthenticationConfiguration uri=%s, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting * a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already * establish values for those fields. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param protocolDefaultPort the protocol-default port * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); configuration = establishOverrides(uri, protocolDefaultPort, configuration); log.tracef("getAuthenticationConfiguration uri=%s, protocolDefaultPort=%d, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, protocolDefaultPort, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
AuthenticationConfiguration globalAuthConf = RemotingOptions.mergeOptionsIntoAuthenticationConfiguration(remotingOptions, AuthenticationConfiguration.empty()); overrides = new HashMap<>(); AuthenticationConfiguration authConfig = RemotingOptions.mergeOptionsIntoAuthenticationConfiguration(connRemotingOptions, AuthenticationConfiguration.empty());
authContext = AuthenticationContext.captureCurrent(); } else { authContext = AuthenticationContext.empty().with(MatchRule.ALL, AuthenticationConfiguration.empty().useForwardedIdentity(domain));
ExceptionUnaryOperator<AuthenticationConfiguration, ConfigXMLParseException> configuration = ignored -> AuthenticationConfiguration.empty(); DeferredSupplier<Provider[]> providerSupplier = new DeferredSupplier<>(providers); configuration = andThenOp(configuration, parent -> parent.useProviders(providerSupplier)); authenticationConfigurationsMap.put(name, () -> finalConfiguration.apply(AuthenticationConfiguration.empty())); return; } else {
public AuthenticationConfiguration getAuthenticationConfiguration() { return AuthenticationConfiguration.empty(); }
public AuthenticationConfiguration getAuthenticationConfiguration() { return AuthenticationConfiguration.empty(); }
public void accept(final ConnectionHandlerFactory connectionHandlerFactory, final SaslAuthenticationFactory authenticationFactory) { synchronized (connectionLock) { try { resourceUntick("an inbound connection"); } catch (NotOpenException e) { throw new IllegalStateException("Accept after endpoint close", e); } boolean ok = false; try { final ConnectionImpl connection = new ConnectionImpl(EndpointImpl.this, connectionHandlerFactory, this, null, authenticationFactory, AuthenticationConfiguration.empty(), saslProtocol); connections.add(connection); connection.getConnectionHandler().addCloseHandler(SpiUtils.asyncClosingCloseHandler(connection)); connection.addCloseHandler(connectionCloseHandler); connection.addCloseHandler(resourceCloseHandler); ok = true; } finally { if (! ok) closeTick1("a failed inbound connection"); } } }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none. * The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field. * No host, port, or protocol information is copied to the resultant configuration from the URI. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); log.tracef("getAuthenticationConfiguration uri=%s, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none. * The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field. * No host, port, or protocol information is copied to the resultant configuration from the URI. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); log.tracef("getAuthenticationConfiguration uri=%s, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none. * The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field. * No host, port, or protocol information is copied to the resultant configuration from the URI. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); log.tracef("getAuthenticationConfiguration uri=%s, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting * a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already * establish values for those fields. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param protocolDefaultPort the protocol-default port * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); configuration = establishOverrides(uri, protocolDefaultPort, configuration); log.tracef("getAuthenticationConfiguration uri=%s, protocolDefaultPort=%d, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, protocolDefaultPort, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting * a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already * establish values for those fields. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param protocolDefaultPort the protocol-default port * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); configuration = establishOverrides(uri, protocolDefaultPort, configuration); log.tracef("getAuthenticationConfiguration uri=%s, protocolDefaultPort=%d, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, protocolDefaultPort, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
/** * Get the authentication configuration which matches the given URI and type, or {@link AuthenticationConfiguration#EMPTY} if there is none, setting * a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already * establish values for those fields. * * @param uri the URI to match (must not be {@code null}) * @param authenticationContext the authentication context to examine (must not be {@code null}) * @param protocolDefaultPort the protocol-default port * @param abstractType the abstract type (may be {@code null}) * @param abstractTypeAuthority the abstract type authority (may be {@code null}) * @return the matching configuration */ public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority) { Assert.checkNotNullParam("uri", uri); Assert.checkNotNullParam("authenticationContext", authenticationContext); final RuleNode<AuthenticationConfiguration> node = authenticationContext.authRuleMatching(uri, abstractType, abstractTypeAuthority); AuthenticationConfiguration configuration = node != null ? node.getConfiguration() : AuthenticationConfiguration.empty(); configuration = initializeConfiguration(uri, configuration); configuration = establishOverrides(uri, protocolDefaultPort, configuration); log.tracef("getAuthenticationConfiguration uri=%s, protocolDefaultPort=%d, abstractType=%s, abstractTypeAuthority=%s, MatchRule=[%s], AuthenticationConfiguration=[%s]", uri, protocolDefaultPort, abstractType, abstractTypeAuthority, node != null ? node.rule : null, configuration); return configuration; }
} else { final SecurityRealm securityRealm = securityRealmInjectedValue.getOptionalValue(); AuthenticationConfiguration configuration = AuthenticationConfiguration.empty(); if (securityRealm != null) {
authContext = AuthenticationContext.captureCurrent(); } else { authContext = AuthenticationContext.empty().with(MatchRule.ALL, AuthenticationConfiguration.empty().useForwardedIdentity(domain));
authContext = AuthenticationContext.captureCurrent(); } else { authContext = AuthenticationContext.empty().with(MatchRule.ALL, AuthenticationConfiguration.empty().useForwardedIdentity(domain));
ExceptionUnaryOperator<AuthenticationConfiguration, ConfigXMLParseException> configuration = ignored -> AuthenticationConfiguration.empty(); DeferredSupplier<Provider[]> providerSupplier = new DeferredSupplier<>(providers); configuration = andThenOp(configuration, parent -> parent.useProviders(providerSupplier)); authenticationConfigurationsMap.put(name, () -> finalConfiguration.apply(AuthenticationConfiguration.empty())); return; } else {
ExceptionUnaryOperator<AuthenticationConfiguration, ConfigXMLParseException> configuration = ignored -> AuthenticationConfiguration.empty(); DeferredSupplier<Provider[]> providerSupplier = new DeferredSupplier<>(providers); configuration = andThenOp(configuration, parent -> parent.useProviders(providerSupplier)); authenticationConfigurationsMap.put(name, () -> finalConfiguration.apply(AuthenticationConfiguration.empty())); return; } else {