/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
/** * Register the assembled configuration against the system wide {@link AuthConfigFactory}. * * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register() { return register(AuthConfigFactory.getFactory()); }
public static JaspiConfigurationBuilder builder(final String messageLayer, final String applicationContext) { return new JaspiConfigurationBuilder(messageLayer, applicationContext); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String layer = LAYER.resolveModelAttribute(context, model).asString(); final String applicationContext = APPLICATION_CONTEXT.resolveModelAttribute(context, model).asString(); final String description = DESCRIPTION.resolveModelAttribute(context, model).asStringOrNull(); final String addressValue = context.getCurrentAddressValue(); final JaspiConfigurationBuilder builder = JaspiConfigurationBuilder.builder("*".equals(layer) ? null : layer, "*".equals(applicationContext) ? null : applicationContext) .setDescription(description); final List<ModelNode> serverAuthModules = SERVER_AUTH_MODULES.resolveModelAttribute(context, model).asList(); for (ModelNode serverAuthModule : serverAuthModules) { final String className = CLASS_NAME.resolveModelAttribute(context, serverAuthModule).asString(); final String module = MODULE.resolveModelAttribute(context, serverAuthModule).asStringOrNull(); final Flag flag = Flag.valueOf(FLAG.resolveModelAttribute(context, serverAuthModule).asString()); final Map<String, String> options = OPTIONS.unwrap(context, serverAuthModule); builder.addAuthModuleFactory(createServerAuthModuleSupplier(className, module), flag, options); } final String registrationId = builder.register(); REGISTRATION_MAP.put(addressValue, registrationId); }
/** * Set the description to be used for the provider once registered. * * @param description the description to be used for the provider once registered. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder setDescription(final String description) { assertNotRegistered(); this.description = description; return this; }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @param flag the flag to control the handling of the auth module. * @param options the configuration options to pass to the module during initialisation. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory, final Flag flag, final Map options) { assertNotRegistered(); serverAuthModules.add(new AuthenticationModuleDefinition(serverAuthModuleFactory, flag, options)); return this; }
/** * Register the assembled configuration against the supplied {@link AuthConfigFactory}. * * @param authConfigFactory the {@link AuthConfigFactory} to register the configuration against. * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register(AuthConfigFactory authConfigFactory) { assertNotRegistered(); registered = true; return authConfigFactory.registerConfigProvider( new ElytronAuthConfigProvider(messageLayer, applicationContext, serverAuthModules), messageLayer, applicationContext, description); }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
/** * Register the assembled configuration against the system wide {@link AuthConfigFactory}. * * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register() { return register(AuthConfigFactory.getFactory()); }
public static JaspiConfigurationBuilder builder(final String messageLayer, final String applicationContext) { return new JaspiConfigurationBuilder(messageLayer, applicationContext); }
/** * Set the description to be used for the provider once registered. * * @param description the description to be used for the provider once registered. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder setDescription(final String description) { assertNotRegistered(); this.description = description; return this; }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory) { return addAuthModuleFactory(serverAuthModuleFactory, Flag.REQUIRED, Collections.EMPTY_MAP); }
/** * Register the assembled configuration against the system wide {@link AuthConfigFactory}. * * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register() { return register(AuthConfigFactory.getFactory()); }
public static JaspiConfigurationBuilder builder(final String messageLayer, final String applicationContext) { return new JaspiConfigurationBuilder(messageLayer, applicationContext); }
/** * Set the description to be used for the provider once registered. * * @param description the description to be used for the provider once registered. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder setDescription(final String description) { assertNotRegistered(); this.description = description; return this; }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @param flag the flag to control the handling of the auth module. * @param options the configuration options to pass to the module during initialisation. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory, final Flag flag, final Map options) { assertNotRegistered(); serverAuthModules.add(new AuthenticationModuleDefinition(serverAuthModuleFactory, flag, options)); return this; }
/** * Add a {@link Supplier<ServerAuthModule>} to be used to create a {@link ServerAuthModule} instance for this message layer * and application context combination. * * @param serverAuthModuleFactory the {@link Supplier<ServerAuthModule>} to be added to the list of module factories. * @param flag the flag to control the handling of the auth module. * @param options the configuration options to pass to the module during initialisation. * @return this {@link JaspiConfigurationBuilder} to allow chaining of commands. * @throws IllegalStateException if the configuration has already been registered. */ public JaspiConfigurationBuilder addAuthModuleFactory(final Supplier<ServerAuthModule> serverAuthModuleFactory, final Flag flag, final Map options) { assertNotRegistered(); serverAuthModules.add(new AuthenticationModuleDefinition(serverAuthModuleFactory, flag, options)); return this; }
/** * Register the assembled configuration against the supplied {@link AuthConfigFactory}. * * @param authConfigFactory the {@link AuthConfigFactory} to register the configuration against. * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register(AuthConfigFactory authConfigFactory) { assertNotRegistered(); registered = true; return authConfigFactory.registerConfigProvider( new ElytronAuthConfigProvider(messageLayer, applicationContext, serverAuthModules), messageLayer, applicationContext, description); }
/** * Register the assembled configuration against the supplied {@link AuthConfigFactory}. * * @param authConfigFactory the {@link AuthConfigFactory} to register the configuration against. * @return The registration ID returned by the factory on registration. * @throws IllegalStateException if the configuration has already been registered. */ public String register(AuthConfigFactory authConfigFactory) { assertNotRegistered(); registered = true; return authConfigFactory.registerConfigProvider( new ElytronAuthConfigProvider(messageLayer, applicationContext, serverAuthModules), messageLayer, applicationContext, description); }