public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, ?> props, final CallbackHandler cbh) throws SaslException { return super.createSaslServer(mechanism, protocol, this.serverName, props, cbh); } }
/** * Determine whether this chain of delegating factories delegates through an instance of the given class. * * @param factoryClass the SASL server factory class * @return {@code true} if this chain delegates through the factory class, {@code false} otherwise */ public final boolean delegatesThrough(Class<? extends SaslServerFactory> factoryClass) { return factoryClass != null && delegatesThroughNN(factoryClass); }
@Override public String[] getMechanismNames(Map<String, ?> props) { String[] mechanismNames = super.getMechanismNames(props); if (mechanismNameComparator != null) { Arrays.sort(mechanismNames, mechanismNameComparator); } else if (saslMechanismSelector != null) { List<String> mechanismNamesList = new ArrayList<>(Arrays.asList(mechanismNames)); mechanismNamesList = saslMechanismSelector.apply(mechanismNamesList, null); mechanismNames = mechanismNamesList.toArray(new String[mechanismNamesList.size()]); } return mechanismNames; }
public SaslAuthenticationFactory build() { AbstractDelegatingSaslServerFactory factory = new AuthenticationCompleteCallbackSaslServerFactory(new SetMechanismInformationSaslServerFactory(getFactory())); if (! factory.delegatesThrough(TrustManagerSaslServerFactory.class)) { factory = new TrustManagerSaslServerFactory(factory, null); // Use the default trust manager } factory = new AuthenticationTimeoutSaslServerFactory(factory, SecurityDomain.getScheduledExecutorService()); // Use an authentication timeout return new SaslAuthenticationFactory(getSecurityDomain(), getMechanismConfigurationSelector(), factory); } }
public SaslAuthenticationFactory build() { AbstractDelegatingSaslServerFactory factory = new AuthenticationCompleteCallbackSaslServerFactory(new SetMechanismInformationSaslServerFactory(getFactory())); if (! factory.delegatesThrough(TrustManagerSaslServerFactory.class)) { factory = new TrustManagerSaslServerFactory(factory, null); // Use the default trust manager } factory = new AuthenticationTimeoutSaslServerFactory(factory, SecurityDomain.getScheduledExecutorService()); // Use an authentication timeout return new SaslAuthenticationFactory(getSecurityDomain(), getMechanismConfigurationSelector(), factory); } }
public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, ?> props, final CallbackHandler cbh) throws SaslException { return super.createSaslServer(mechanism, this.protocol, serverName, props, cbh); } }
public String[] getMechanismNames(final Map<String, ?> props) { BiPredicate<String, Provider> existing = SaslFactories.getProviderFilterPredicate(props); final HashMap<String, Object> newProps = new HashMap<String, Object>(props); if (existing != null) { newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate.and(existing)); } else { newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate); } return super.getMechanismNames(newProps); } }
boolean delegatesThroughNN(Class<? extends SaslServerFactory> factoryClass) { return factoryClass.isInstance(this) || delegate instanceof AbstractDelegatingSaslServerFactory && ((AbstractDelegatingSaslServerFactory) delegate).delegatesThroughNN(factoryClass); }
public SaslAuthenticationFactory build() { AbstractDelegatingSaslServerFactory factory = new AuthenticationCompleteCallbackSaslServerFactory(new SetMechanismInformationSaslServerFactory(getFactory())); if (! factory.delegatesThrough(TrustManagerSaslServerFactory.class)) { factory = new TrustManagerSaslServerFactory(factory, null); // Use the default trust manager } factory = new AuthenticationTimeoutSaslServerFactory(factory, SecurityDomain.getScheduledExecutorService()); // Use an authentication timeout return new SaslAuthenticationFactory(getSecurityDomain(), getMechanismConfigurationSelector(), factory); } }
public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, ?> props, final CallbackHandler cbh) throws SaslException { return super.createSaslServer(mechanism, protocol, serverName, props, new CallbackHandler() { private X509Certificate[] certs; public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { ArrayList<Callback> list = new ArrayList<>(Arrays.asList(callbacks)); final Iterator<Callback> iterator = list.iterator(); while (iterator.hasNext()) { Callback callback = iterator.next(); if (callback instanceof SSLCallback) { final SSLCallback sslCallback = (SSLCallback) callback; certs = X500.asX509CertificateArray(sslCallback.getSslSession().getPeerCertificates()); } else if (callback instanceof ChannelBindingCallback) { TLSServerEndPointChannelBinding.handleChannelBindingCallback((ChannelBindingCallback) callback, certs); iterator.remove(); } } if (! list.isEmpty()) { cbh.handle(list.toArray(new Callback[list.size()])); } } }); } }
@Override public String[] getMechanismNames(Map<String, ?> props) { String[] mechanismNames = super.getMechanismNames(props); if (mechanismNameComparator != null) { Arrays.sort(mechanismNames, mechanismNameComparator); } else if (saslMechanismSelector != null) { List<String> mechanismNamesList = new ArrayList<>(Arrays.asList(mechanismNames)); mechanismNamesList = saslMechanismSelector.apply(mechanismNamesList, null); mechanismNames = mechanismNamesList.toArray(new String[mechanismNamesList.size()]); } return mechanismNames; }
/** * Determine whether this chain of delegating factories delegates through an instance of the given class. * * @param factoryClass the SASL server factory class * @return {@code true} if this chain delegates through the factory class, {@code false} otherwise */ public final boolean delegatesThrough(Class<? extends SaslServerFactory> factoryClass) { return factoryClass != null && delegatesThroughNN(factoryClass); }
public SaslAuthenticationFactory build() { AbstractDelegatingSaslServerFactory factory = new AuthenticationCompleteCallbackSaslServerFactory(new SetMechanismInformationSaslServerFactory(getFactory())); if (! factory.delegatesThrough(TrustManagerSaslServerFactory.class)) { factory = new TrustManagerSaslServerFactory(factory, null); // Use the default trust manager } factory = new AuthenticationTimeoutSaslServerFactory(factory, SecurityDomain.getScheduledExecutorService()); // Use an authentication timeout return new SaslAuthenticationFactory(getSecurityDomain(), getMechanismConfigurationSelector(), factory); } }
public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, ?> props, final CallbackHandler cbh) throws SaslException { final SaslServer delegate = super.createSaslServer(mechanism, protocol, serverName, props, cbh); if (delegate == null) { return null; } return new AuthenticationContextSaslServer(delegate, context); } }
@Override public String[] getMechanismNames(Map<String, ?> props) { String[] mechanismNames = super.getMechanismNames(props); if (mechanismNameComparator != null) { Arrays.sort(mechanismNames, mechanismNameComparator); } else if (saslMechanismSelector != null) { List<String> mechanismNamesList = new ArrayList<>(Arrays.asList(mechanismNames)); mechanismNamesList = saslMechanismSelector.apply(mechanismNamesList, null); mechanismNames = mechanismNamesList.toArray(new String[mechanismNamesList.size()]); } return mechanismNames; }
/** * Determine whether this chain of delegating factories delegates through an instance of the given class. * * @param factoryClass the SASL server factory class * @return {@code true} if this chain delegates through the factory class, {@code false} otherwise */ public final boolean delegatesThrough(Class<? extends SaslServerFactory> factoryClass) { return factoryClass != null && delegatesThroughNN(factoryClass); }
public SaslAuthenticationFactory build() { AbstractDelegatingSaslServerFactory factory = new AuthenticationCompleteCallbackSaslServerFactory(new SetMechanismInformationSaslServerFactory(getFactory())); if (! factory.delegatesThrough(TrustManagerSaslServerFactory.class)) { factory = new TrustManagerSaslServerFactory(factory, null); // Use the default trust manager } factory = new AuthenticationTimeoutSaslServerFactory(factory, SecurityDomain.getScheduledExecutorService()); // Use an authentication timeout return new SaslAuthenticationFactory(getSecurityDomain(), getMechanismConfigurationSelector(), factory); } }
public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, ?> props, final CallbackHandler cbh) throws SaslException { BiPredicate<String, Provider> existing = SaslFactories.getProviderFilterPredicate(props); final HashMap<String, Object> newProps = new HashMap<String, Object>(props); if (existing != null) { newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate.and(existing)); } else { newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate); } return super.createSaslServer(mechanism, protocol, serverName, newProps, cbh); }
@Override public String[] getMechanismNames(Map<String, ?> props) { String[] mechanismNames = super.getMechanismNames(props); if (mechanismNameComparator != null) { Arrays.sort(mechanismNames, mechanismNameComparator); } else if (saslMechanismSelector != null) { List<String> mechanismNamesList = new ArrayList<>(Arrays.asList(mechanismNames)); mechanismNamesList = saslMechanismSelector.apply(mechanismNamesList, null); mechanismNames = mechanismNamesList.toArray(new String[mechanismNamesList.size()]); } return mechanismNames; }
/** * Determine whether this chain of delegating factories delegates through an instance of the given class. * * @param factoryClass the SASL server factory class * @return {@code true} if this chain delegates through the factory class, {@code false} otherwise */ public final boolean delegatesThrough(Class<? extends SaslServerFactory> factoryClass) { return factoryClass != null && delegatesThroughNN(factoryClass); }