/** * <p>Check if the configuration supports credential management.</p> * * <p>Credential management is supported if any of the configured identity stores support it.</p> * * @return True if the configuration supports credential. Otherwise is false. */ public boolean supportsAttribute() { for (IdentityStoreConfiguration storeConfiguration: getStoreConfiguration()) { if (storeConfiguration.supportsAttribute()) { return true; } } return false; }
/** * <p>Check if the configuration supports credential management.</p> * * <p>Credential management is supported if any of the configured identity stores support it.</p> * * @return True if the configuration supports credential. Otherwise is false. */ public boolean supportsAttribute() { for (IdentityStoreConfiguration storeConfiguration: getStoreConfiguration()) { if (storeConfiguration.supportsAttribute()) { return true; } } return false; }
@Override public <T extends AttributeStore<?>> T getStoreForAttributeOperation(IdentityContext context) { IdentityConfiguration attributeManagementConfig = this.configuration.getAttributeManagementConfig(); if (attributeManagementConfig != null) { Map<IdentityStoreConfiguration, IdentityStore<?>> configStores = stores.get(attributeManagementConfig); for (IdentityStoreConfiguration cfg : configStores.keySet()) { if (cfg.supportsAttribute()) { T store = getIdentityStoreAndInitializeContext(context, attributeManagementConfig, cfg); if (!AttributeStore.class.isInstance(store)) { throw MESSAGES.storeUnexpectedType(store.getClass(), AttributeStore.class); } return store; } } } return null; }
@Override public <T extends AttributeStore<?>> T getStoreForAttributeOperation(IdentityContext context) { IdentityConfiguration attributeManagementConfig = this.configuration.getAttributeManagementConfig(); if (attributeManagementConfig != null) { Map<IdentityStoreConfiguration, IdentityStore<?>> configStores = stores.get(attributeManagementConfig); for (IdentityStoreConfiguration cfg : configStores.keySet()) { if (cfg.supportsAttribute()) { T store = getIdentityStoreAndInitializeContext(context, attributeManagementConfig, cfg); if (!AttributeStore.class.isInstance(store)) { throw MESSAGES.storeUnexpectedType(store.getClass(), AttributeStore.class); } return store; } } } return null; }
@Override protected Builder<T> readFrom(T configuration) { for (Class<? extends CredentialHandler> credentialHandler : configuration.getCredentialHandlers()) { addCredentialHandler(credentialHandler); } for (String credentialProperty : configuration.getCredentialHandlerProperties().keySet()) { Object value = configuration.getCredentialHandlerProperties().get(credentialProperty); setCredentialHandlerProperty(credentialProperty, value); } for (Class<? extends AttributedType> supportedType : configuration.getSupportedTypes().keySet()) { supportType(supportedType); if (Relationship.class.isAssignableFrom(supportedType)) { supportGlobalRelationship((Class<? extends Relationship>) supportedType); } } for (Class<? extends AttributedType> unsupportedType : configuration.getUnsupportedTypes().keySet()) { unsupportType(unsupportedType); } for (ContextInitializer contextInitializer : configuration.getContextInitializers()) { addContextInitializer(contextInitializer); } supportAttributes(configuration.supportsAttribute()); supportCredentials(configuration.supportsCredential()); supportPermissions(configuration.supportsPermissions()); return this; }
@Override protected Builder<T> readFrom(T configuration) { for (Class<? extends CredentialHandler> credentialHandler : configuration.getCredentialHandlers()) { addCredentialHandler(credentialHandler); } for (String credentialProperty : configuration.getCredentialHandlerProperties().keySet()) { Object value = configuration.getCredentialHandlerProperties().get(credentialProperty); setCredentialHandlerProperty(credentialProperty, value); } for (Class<? extends AttributedType> supportedType : configuration.getSupportedTypes().keySet()) { supportType(supportedType); if (Relationship.class.isAssignableFrom(supportedType)) { supportGlobalRelationship((Class<? extends Relationship>) supportedType); } } for (Class<? extends AttributedType> unsupportedType : configuration.getUnsupportedTypes().keySet()) { unsupportType(unsupportedType); } for (ContextInitializer contextInitializer : configuration.getContextInitializers()) { addContextInitializer(contextInitializer); } supportAttributes(configuration.supportsAttribute()); supportCredentials(configuration.supportsCredential()); supportPermissions(configuration.supportsPermissions()); return this; }
if (storeConfig.supportsAttribute()) { attributeCfg = config;
if (storeConfig.supportsAttribute()) { attributeCfg = config;
@Override public void setup(C config) { IDENTITY_STORE_LOGGER.storeInitializing(getClass()); this.configuration = config; if (IDENTITY_STORE_LOGGER.isDebugEnabled()) { IDENTITY_STORE_LOGGER.debugf("[%s]: [", this.configuration); IDENTITY_STORE_LOGGER.debugf(" Type: %s", this.configuration.getIdentityStoreType()); IDENTITY_STORE_LOGGER.debugf(" Supports partition: %s", this.configuration.supportsPartition()); IDENTITY_STORE_LOGGER.debugf(" Supports attribute: %s", this.configuration.supportsAttribute()); IDENTITY_STORE_LOGGER.debugf(" Supports credential: %s", this.configuration.supportsCredential()); IDENTITY_STORE_LOGGER.debugf(" Credential Handlers: %s", this.configuration.getCredentialHandlers()); IDENTITY_STORE_LOGGER.debugf(" Supported types: %s", this.configuration.getSupportedTypes().keySet()); IDENTITY_STORE_LOGGER.debugf(" Unsupported types: %s", this.configuration.getUnsupportedTypes().keySet()); IDENTITY_STORE_LOGGER.debugf(" Context Initializers: %s", this.configuration.getContextInitializers()); IDENTITY_STORE_LOGGER.debug("]"); } if (config.supportsCredential()) { initializeCredentialHandlers(); } }
@Override public void setup(C config) { IDENTITY_STORE_LOGGER.storeInitializing(getClass()); this.configuration = config; if (IDENTITY_STORE_LOGGER.isDebugEnabled()) { IDENTITY_STORE_LOGGER.debugf("[%s]: [", this.configuration); IDENTITY_STORE_LOGGER.debugf(" Type: %s", this.configuration.getIdentityStoreType()); IDENTITY_STORE_LOGGER.debugf(" Supports partition: %s", this.configuration.supportsPartition()); IDENTITY_STORE_LOGGER.debugf(" Supports attribute: %s", this.configuration.supportsAttribute()); IDENTITY_STORE_LOGGER.debugf(" Supports credential: %s", this.configuration.supportsCredential()); IDENTITY_STORE_LOGGER.debugf(" Credential Handlers: %s", this.configuration.getCredentialHandlers()); IDENTITY_STORE_LOGGER.debugf(" Supported types: %s", this.configuration.getSupportedTypes().keySet()); IDENTITY_STORE_LOGGER.debugf(" Unsupported types: %s", this.configuration.getUnsupportedTypes().keySet()); IDENTITY_STORE_LOGGER.debugf(" Context Initializers: %s", this.configuration.getContextInitializers()); IDENTITY_STORE_LOGGER.debug("]"); } if (config.supportsCredential()) { initializeCredentialHandlers(); } }