Added option to define project for admin user
Change-Id: I201162a2da2552d745b8cc393fe532b2655ccfb8
This commit is contained in:
parent
a1d26e4535
commit
398ca98982
@ -46,6 +46,8 @@ For secure operation of the Monasca API, the API must be configured to use Keyst
|
||||
* adminAuthMethod - "password" if the Monasca API should adminUser and adminPassword to login to the Keystone server to check the user's token, "token" if the Monasca API should use adminToken
|
||||
* adminUser - Admin user name
|
||||
* adminPassword - Admin user password
|
||||
* adminProjectId - Specify the project ID the api should use to request an admin token. Defaults to the admin user's default project. The adminProjectId option takes precedence over adminProjectName.
|
||||
* adminProjectName - Specify the project name the api should use to request an admin token. Defaults to the admin user's default project. The adminProjectId option takes precedence over adminProjectName.
|
||||
* adminToken - A valid admin user token if adminAuthMethod is token
|
||||
* timeToCacheToken - How long the Monasca API should cache the user's token before checking it again
|
||||
|
||||
|
@ -157,6 +157,8 @@ public class MonApiApplication extends Application<ApiConfig> {
|
||||
authInitParams.put("AdminAuthMethod", config.middleware.adminAuthMethod);
|
||||
authInitParams.put("AdminUser", config.middleware.adminUser);
|
||||
authInitParams.put("AdminPassword", config.middleware.adminPassword);
|
||||
authInitParams.put(AuthConstants.ADMIN_PROJECT_ID, config.middleware.adminProjectId);
|
||||
authInitParams.put(AuthConstants.ADMIN_PROJECT_NAME, config.middleware.adminProjectName);
|
||||
authInitParams.put("MaxTokenCacheSize", config.middleware.maxTokenCacheSize);
|
||||
setIfNotNull(authInitParams, AuthConstants.TRUSTSTORE, config.middleware.truststore);
|
||||
setIfNotNull(authInitParams, AuthConstants.TRUSTSTORE_PASS, config.middleware.truststorePassword);
|
||||
|
@ -59,6 +59,10 @@ public class MiddlewareConfiguration {
|
||||
@JsonProperty
|
||||
public String adminPassword;
|
||||
@JsonProperty
|
||||
public String adminProjectId = "";
|
||||
@JsonProperty
|
||||
public String adminProjectName = "";
|
||||
@JsonProperty
|
||||
public String maxTokenCacheSize = "1048576";
|
||||
@JsonProperty
|
||||
public String truststore;
|
||||
|
@ -77,6 +77,8 @@ middleware:
|
||||
adminAuthMethod: password
|
||||
adminUser: admin
|
||||
adminPassword: admin
|
||||
adminProjectId:
|
||||
adminProjectName:
|
||||
adminToken:
|
||||
timeToCacheToken: 600
|
||||
maxTokenCacheSize: 1048576
|
||||
|
Loading…
Reference in New Issue
Block a user