Skip to content

Commit

Permalink
#128 Added methods for adding and removing a single server auth module
Browse files Browse the repository at this point in the history
Signed-off-by: arjantijms <arjan.tijms@gmail.com>
  • Loading branch information
arjantijms committed Nov 29, 2021
1 parent c7b87c0 commit 9fa1295
Showing 1 changed file with 31 additions and 0 deletions.
Expand Up @@ -27,6 +27,8 @@
import java.util.Map;
import java.util.Properties;

import jakarta.security.auth.message.module.ServerAuthModule;

/**
* This class is used to obtain <code>AuthConfigProvider</code> objects that can be used to obtain authentication
* context configuration objects, that is, <code>ClientAuthConfig</code> and <code>ServerAuthConfig</code> objects.
Expand Down Expand Up @@ -376,6 +378,35 @@ public static synchronized void setFactory(AuthConfigFactory factory) {
*/
public abstract String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description);

/**
* Registers within the (in-memory) factory, an instance of a <code>ServerAuthModule</code> for a
* message layer and application context identifier as identified by a profile specific context object.
*
* <p>
* This will override any other modules that have already been registered, either via proprietary
* means or using the standard API.
*
* @param serverAuthModule the <code>ServerAuthModule</code> instance to be registered
* @param context the profile specific context of the application for which the module is registered
* @return A String identifier assigned by the factory to the provider registration, and that may be used to remove the
* registration from the factory.
*/
public abstract String registerServerAuthModule(ServerAuthModule serverAuthModule, Object context);

/**
* Remove the <code>ServerAuthModule</code> (and potentially encompassing wrappers/factories) that was previously registered via a call
* to <code>registerServerAuthModule</code>.
*
* <p>
* Note that this method is a convenience method that can be used instead of <code>removeRegistration</code>, but should ultimately
* have the same effect. That is calling <code>removeRegistration</code> with the return value from <code>registerServerAuthModule</code>
* must have the same effect in that the <code>ServerAuthModule</code> is removed.
*
* @param context the profile specific context of the application for which the module is removed.
*/
public abstract void removeServerAuthModule(Object context);


/**
* Remove the identified provider registration from the factory (and from the persistent declarative representation of
* provider registrations, if appropriate) and invoke any listeners associated with the removed registration.
Expand Down

0 comments on commit 9fa1295

Please sign in to comment.