Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/cosbench-keystone/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ Import-Package: com.intel.cosbench.api.auth,
org.apache.http.message;version="[4.1.4,5.0.0)",
org.apache.http.util;version="[4.1.4,5.0.0)",
org.codehaus.jackson;version="[1.4.2,2.0.0)",
org.codehaus.jackson.annotate;version="1.4.2",
org.codehaus.jackson.map;version="[1.4.2,2.0.0)",
org.codehaus.jackson.map.annotate;version="[1.4.2,2.0.0)"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* This class encapsulates an Openstack Keystone implementation for the
* Auth-API.
*
* @author ywang19, qzheng7
* @author ywang19, qzheng7, osmboy, digvijay2040
*
*/
class KeystoneAuth extends NoneAuth {
Expand All @@ -43,22 +43,18 @@ class KeystoneAuth extends NoneAuth {
private String url;
private String username;
private String password;
private String userToken;

/* tenant info */
private String tenantId;
private String tenantName;

/*keystone region*/
private String region;

/* domain info */
private String userdomain;
private String projectdomain;
/* service info */
private String service;

/* connection setting */
private int timeout;

Logger logger = null;

public KeystoneAuth() {
/* empty */
Expand All @@ -67,33 +63,31 @@ public KeystoneAuth() {
@Override
public void init(Config config, Logger logger) {
super.init(config, logger);
this.logger = logger;

url = config.get(AUTH_URL_KEY, config.get(AUTH_URL_ALTKEY, URL_DEFAULT));
username = config.get(AUTH_USERNAME_KEY, AUTH_USERNAME_DEFAULT);
password = config.get(AUTH_PASSWORD_KEY, AUTH_PASSWORD_DEFAULT);
userToken = config.get(AUTH_USERTOKEN_KEY, AUTH_USERTOKEN_DEFAULT);
tenantId = config.get(AUTH_TENANT_ID_KEY, AUTH_TENANT_ID_DEFAULT);
tenantName = config.get(AUTH_TENANT_NAME_KEY, config.get(AUTH_TENANT_NAME_ALTKEY, AUTH_TENANT_NAME_DEFAULT));
userdomain = config.get(AUTH_USER_DOMAIN_KEY, AUTH_USER_DOMAIN_DEFAULT);
projectdomain = config.get(AUTH_PROJECT_DOMAIN_KEY, AUTH_PROJECT_DOMAIN_DEFAULT);
service = config.get(AUTH_SERVICE_KEY, AUTH_SERVICE_DEFAULT);
timeout = config.getInt(CONN_TIMEOUT_KEY, CONN_TIMEOUT_DEFAULT);
region = config.get(AUTH_REGION_KEY, AUTH_REGION_DEFAULT);

parms.put(AUTH_URL_KEY, url);
parms.put(AUTH_USERNAME_KEY, username);
parms.put(AUTH_PASSWORD_KEY, password);
parms.put(AUTH_USERTOKEN_KEY, userToken);
parms.put(AUTH_TENANT_ID_KEY, tenantId);
parms.put(AUTH_USER_DOMAIN_KEY, userdomain);
parms.put(AUTH_PROJECT_DOMAIN_KEY, projectdomain);

parms.put(AUTH_TENANT_NAME_KEY, tenantName);
parms.put(AUTH_SERVICE_KEY, service);
parms.put(CONN_TIMEOUT_KEY, timeout);
parms.put(AUTH_REGION_KEY, AUTH_REGION_DEFAULT);


logger.debug("using auth config: {}", parms);

HttpClient httpClient = HttpClientUtil.createHttpClient(timeout);
client = new KeystoneClient(logger, httpClient, url, username, password,
tenantName, timeout);
client = new KeystoneClient(httpClient, url, username, password,
tenantName, userdomain,projectdomain, timeout);
logger.debug("keystone client has been initialized");
}

Expand Down Expand Up @@ -125,7 +119,7 @@ private AuthContext createContext() {
// context.put(AUTH_TOKEN_KEY, client.getKeystoneTokenId());
// context.put(STORAGE_URL_KEY, client.getServiceUrl(service));
// return context;
KeystoneAuthContext context = new KeystoneAuthContext(url, username, password, service, client.getKeystoneTokenId(), client.getServiceUrl(service,region));
KeystoneAuthContext context = new KeystoneAuthContext(url, username, password, service, client.getKeystoneTokenId(), client.getServiceUrl(service));

return context;
}
Expand Down
Loading