Search in sources :

Example 1 with HashicorpVaultAliasService

use of org.apache.knox.gateway.backend.hashicorp.vault.HashicorpVaultAliasService in project knox by apache.

the class AliasServiceFactory method createService.

@Override
protected Service createService(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException {
    Service service = null;
    if (shouldCreateService(implementation)) {
        final AliasService defaultAliasService = new DefaultAliasService();
        ((DefaultAliasService) defaultAliasService).setMasterService(getMasterService(gatewayServices));
        ((DefaultAliasService) defaultAliasService).setKeystoreService(getKeystoreService(gatewayServices));
        // invoking init on DefaultAliasService twice is ok (in case implementation is set to 'default')
        defaultAliasService.init(gatewayConfig, options);
        if (matchesImplementation(implementation, DefaultAliasService.class, true)) {
            service = defaultAliasService;
        } else if (matchesImplementation(implementation, HashicorpVaultAliasService.class)) {
            service = new HashicorpVaultAliasService(defaultAliasService);
        } else if (matchesImplementation(implementation, RemoteAliasService.class)) {
            service = new RemoteAliasService(defaultAliasService, getMasterService(gatewayServices));
        } else if (matchesImplementation(implementation, ZookeeperRemoteAliasService.class)) {
            service = new ZookeeperRemoteAliasServiceProvider().newInstance(gatewayServices, defaultAliasService, getMasterService(gatewayServices));
        }
        logServiceUsage(implementation, serviceType);
    }
    return service;
}
Also used : HashicorpVaultAliasService(org.apache.knox.gateway.backend.hashicorp.vault.HashicorpVaultAliasService) AliasService(org.apache.knox.gateway.services.security.AliasService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) ZookeeperRemoteAliasService(org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService) RemoteAliasService(org.apache.knox.gateway.services.security.impl.RemoteAliasService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) ZookeeperRemoteAliasService(org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService) HashicorpVaultAliasService(org.apache.knox.gateway.backend.hashicorp.vault.HashicorpVaultAliasService) AliasService(org.apache.knox.gateway.services.security.AliasService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) ZookeeperRemoteAliasService(org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService) RemoteAliasService(org.apache.knox.gateway.services.security.impl.RemoteAliasService) Service(org.apache.knox.gateway.services.Service) HashicorpVaultAliasService(org.apache.knox.gateway.backend.hashicorp.vault.HashicorpVaultAliasService) ZookeeperRemoteAliasService(org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService) RemoteAliasService(org.apache.knox.gateway.services.security.impl.RemoteAliasService) ZookeeperRemoteAliasServiceProvider(org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasServiceProvider)

Aggregations

HashicorpVaultAliasService (org.apache.knox.gateway.backend.hashicorp.vault.HashicorpVaultAliasService)1 Service (org.apache.knox.gateway.services.Service)1 AliasService (org.apache.knox.gateway.services.security.AliasService)1 DefaultAliasService (org.apache.knox.gateway.services.security.impl.DefaultAliasService)1 RemoteAliasService (org.apache.knox.gateway.services.security.impl.RemoteAliasService)1 ZookeeperRemoteAliasService (org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService)1 ZookeeperRemoteAliasServiceProvider (org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasServiceProvider)1