public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
/** * Create a new Authentication module with the specified settings. * * @param restletCloudConfig * The agent configuration. * @param modulesSettings * The modules settings. * @param context * The context */ public AuthenticationModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings, Context context) { super(context, ChallengeScheme.HTTP_BASIC, "realm"); authenticationSettings = new AuthenticationSettings(); authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled()); authenticateClientResource = AgentUtils.getClientResource( restletCloudConfig, modulesSettings, AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH); // config ChallengeAuthenticator setOptional(authenticationSettings.isOptional()); setVerifier(new AgentVerifier()); // Initialize the cache initializeCache(); }
.getClientResource(restletCloudConfig, modulesSettings, AuthorizationOperationsResource.class, OPERATIONS_AUTHORIZATIONS_PATH); try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get authorization module configuration from Restlet Cloud connector service", e); router.attach(operationAuthorization.getPathTemplate(), new RestletOperationAuthorization(operationAuthorization));
/** * Create a new Authentication module with the specified settings. * * @param restletCloudConfig * The agent configuration. * @param modulesSettings * The modules settings. * @param context * The context */ public AuthenticationModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings, Context context) { super(context, ChallengeScheme.HTTP_BASIC, "realm"); authenticationSettings = new AuthenticationSettings(); authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled()); authenticateClientResource = AgentUtils.getClientResource( restletCloudConfig, modulesSettings, AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH); // config ChallengeAuthenticator setOptional(authenticationSettings.isOptional()); setVerifier(new AgentVerifier()); // Initialize the cache initializeCache(); }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
.getClientResource(restletCloudConfig, modulesSettings, AuthorizationOperationsResource.class, OPERATIONS_AUTHORIZATIONS_PATH); try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get authorization module configuration from Restlet Cloud connector service", e); router.attach(operationAuthorization.getPathTemplate(), new RestletOperationAuthorization(operationAuthorization));
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
/** * Create a new Authentication module with the specified settings. * * @param restletCloudConfig * The agent configuration. * @param modulesSettings * The modules settings. * @param context * The context */ public AuthenticationModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings, Context context) { super(context, ChallengeScheme.HTTP_BASIC, "realm"); authenticationSettings = new AuthenticationSettings(); authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled()); authenticateClientResource = AgentUtils.getClientResource( restletCloudConfig, modulesSettings, AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH); // config ChallengeAuthenticator setOptional(authenticationSettings.isOptional()); setVerifier(new AgentVerifier()); // Initialize the cache initializeCache(); }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
.getClientResource(restletCloudConfig, modulesSettings, AuthorizationOperationsResource.class, OPERATIONS_AUTHORIZATIONS_PATH); try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get authorization module configuration from Restlet Cloud connector service", e); router.attach(operationAuthorization.getPathTemplate(), new RestletOperationAuthorization(operationAuthorization));
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }
/** * Create a new Authentication module with the specified settings. * * @param restletCloudConfig * The agent configuration. * @param modulesSettings * The modules settings. * @param context * The context */ public AuthenticationModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings, Context context) { super(context, ChallengeScheme.HTTP_BASIC, "realm"); authenticationSettings = new AuthenticationSettings(); authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled()); authenticateClientResource = AgentUtils.getClientResource( restletCloudConfig, modulesSettings, AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH); // config ChallengeAuthenticator setOptional(authenticationSettings.isOptional()); setVerifier(new AgentVerifier()); // Initialize the cache initializeCache(); }
public UserInfo load(UserIdentifier userIdentifier) { Credentials credentials = new Credentials( userIdentifier.getIdentifier(), userIdentifier.getSecret()); User user = authenticateClientResource .authenticate(credentials); if (user == null) { // Authentication should throw an error instead of // returning // null throw new AgentException( "Authentication should not return null"); } return new UserInfo(user, userIdentifier.getSecret()); } };
.getClientResource(restletCloudConfig, modulesSettings, AuthorizationOperationsResource.class, OPERATIONS_AUTHORIZATIONS_PATH); try { operationAuthorizations = authorizationOperationsClientResource .getAuthorizations(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get authorization module configuration from Restlet Cloud connector service", e); router.attach(operationAuthorization.getPathTemplate(), new RestletOperationAuthorization(operationAuthorization));
public FirewallModule(RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { FirewallSettingsResource firewallSettingsClientResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, FirewallSettingsResource.class, SETTINGS_PATH); try { firewallSettings = firewallSettingsClientResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Could not get firewall module configuration from Restlet Cloud connector service", e); } }
/** * Retrieves the modules settings from the service if it has changed, null * otherwise. * * @param restletCloudConfig * The service's configuration * @param modulesSettings * The current modules settings * @return The updated modules settings if it has changed, null otherwise. */ public static ModulesSettings getModulesSettings( RestletCloudConfig restletCloudConfig, ModulesSettings modulesSettings) { // When modulesSettings not null, cell revision header is set ModulesSettingsResource modulesSettingsResource = AgentUtils .getClientResource(restletCloudConfig, modulesSettings, ModulesSettingsResource.class, MODULE_PATH); try { return modulesSettingsResource.getSettings(); } catch (Exception e) { throw new AgentConfigurationException( "Unable to retrieve agent settings from platform", e); } }