Skip to content

Decorators and alternatives not working on IdentityStores #189

@glassfishrobot

Description

@glassfishrobot

I've created the following decorator to do some operations with the returned groups:

@Priority(2000)
@Decorator
public class IdentityStoreDecorator implements IdentityStore {

    @Inject
    @Delegate
    @Any
    private IdentityStore decorated;

    @Override
    public CredentialValidationResult validate(Credential credential) {
        return decorated.validate(credential);
    }

    @Override
    public Set<String> getCallerGroups(CredentialValidationResult validationResult) {
        return decorated.getCallerGroups(validationResult);
    }

}

But the CdiUtils#getBeanDefinitions() method which is internally called to get the enabled IdentityStores returns the original object (org.glassfish.soteria.cdi.CdiProducer interface javax.security.enterprise.identitystore.DatabaseIdentityStoreDefinition).

I guess the problem is on the org.glassfish.soteria.cdi.CdiProducer which is creating instances without taking decorators into account. The same applies to @Alternative's.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions