@Override public HttpServerAuthenticationMechanismFactory getValue() throws IllegalStateException, IllegalArgumentException { return new SetMechanismInformationMechanismFactory(this.httpAuthenticationFactory); }
@Override protected ValueSupplier<HttpServerAuthenticationMechanismFactory> getValueSupplier( ServiceBuilder<HttpServerAuthenticationMechanismFactory> serviceBuilder, OperationContext context, ModelNode model) throws OperationFailedException { String providers = PROVIDERS.resolveModelAttribute(context, model).asStringOrNull(); final Supplier<Provider[]> providerSupplier; if (providers != null) { final InjectedValue<Provider[]> providersInjector = new InjectedValue<Provider[]>(); serviceBuilder.addDependency(context.getCapabilityServiceName( buildDynamicCapabilityName(PROVIDERS_CAPABILITY, providers), Provider[].class), Provider[].class, providersInjector); providerSupplier = providersInjector::getValue; } else { providerSupplier = Security::getProviders; } Predicate<Provider.Service> serviceFilter = (Provider.Service s) -> HttpServerAuthenticationMechanismFactory.class.getSimpleName().equals(s.getType()); return () -> { if ( findProviderService(providerSupplier, serviceFilter) == null ) { throw ROOT_LOGGER.noSuitableProvider(HttpServerAuthenticationMechanismFactory.class.getSimpleName()); } return new SetMechanismInformationMechanismFactory(new SecurityProviderServerMechanismFactory(providerSupplier)); }; }
@Override protected ValueSupplier<HttpServerAuthenticationMechanismFactory> getValueSupplier( ServiceBuilder<HttpServerAuthenticationMechanismFactory> serviceBuilder, OperationContext context, ModelNode model) throws OperationFailedException { final String module = MODULE.resolveModelAttribute(context, model).asStringOrNull(); return () -> { try { ClassLoader classLoader = doPrivileged((PrivilegedExceptionAction<ClassLoader>) () -> resolveClassLoader(module)); return new SetMechanismInformationMechanismFactory(new ServiceLoaderServerMechanismFactory(classLoader)); } catch (Exception e) { throw new StartException(e); } }; } };
return () -> { HttpServerAuthenticationMechanismFactory factory = factoryInjector.getValue(); factory = new SetMechanismInformationMechanismFactory(factory); factory = finalFilter != null ? new FilterServerMechanismFactory(factory, finalFilter) : factory; factory = propertiesMap != null ? new PropertiesServerMechanismFactory(factory, propertiesMap) : factory;
httpServerFactory = new SetMechanismInformationMechanismFactory(httpServerFactory); httpServerFactory = new FilterServerMechanismFactory(httpServerFactory, (s) -> { AuthMechanism mechanism = toAuthMechanism("HTTP", s);
httpServerFactory = new SetMechanismInformationMechanismFactory(httpServerFactory); httpServerFactory = new FilterServerMechanismFactory(httpServerFactory, (s) -> { AuthMechanism mechanism = toAuthMechanism("HTTP", s);