Skip to content

Commit

Permalink
🎨 address @davidsuehring's code review
Browse files Browse the repository at this point in the history
 - Remove OKTA_AWS_REGION as it is unused
  • Loading branch information
AlainODea committed Sep 28, 2018
1 parent 2525e83 commit 6580412
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion Readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ Here is the list of parameters that can be environment variables or settings in
- ```OKTA_BROWSER_AUTH``` set to **true** to use integrated web browser for authentication (default: **false**)
- ```OKTA_COOKIES_PATH``` is directory path to store cookies.properties for Okta. This is particularly useful when running this tool in many concurrent processes like you might with **OKTA_ENV_MODE** (default: ~/.okta)
- ```OKTA_PROFILE``` is the name of the AWS profile to create/reuse. May also be specified on the commandline by ```--profile```. (default: get AWS profile name based on per-session STS user name)
- ```OKTA_AWS_REGION``` is the default AWS region to store with the created profile.
- ```OKTA_AWS_ROLE_TO_ASSUME``` is the role to use. If present will try to match okta account's retrieved role list and use it. Will still prompt if no match found.
- ```OKTA_STS_DURATION``` is the duration the role will be assumed, in seconds. The maximum session duration allowed by AWS is 12 hours and this needs to be set on the role as well. Defaults to 1hr.
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/okta/tools/OktaAwsCliEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ public class OktaAwsCliEnvironment {
public String awsRoleToAssume;

public int stsDuration;
public final String awsRegion;
public final boolean oktaEnvMode;

public OktaAwsCliEnvironment()
{
this(false, null, null, null, null, null, null, null, 0, null, false);
this(false, null, null, null, null, null, null, null, 0, false);
}

public OktaAwsCliEnvironment(boolean browserAuth, String oktaOrg,
String oktaUsername, Supplier<String> oktaPassword, String oktaCookiesPath,
String oktaProfile, String oktaAwsAppUrl, String awsRoleToAssume,
int stsDuration, String awsRegion,
int stsDuration,
boolean oktaEnvMode) {
this.browserAuth = browserAuth;
this.oktaOrg = oktaOrg;
Expand All @@ -37,7 +36,6 @@ public OktaAwsCliEnvironment(boolean browserAuth, String oktaOrg,
this.oktaAwsAppUrl = oktaAwsAppUrl;
this.awsRoleToAssume = awsRoleToAssume;
this.stsDuration = stsDuration;
this.awsRegion = awsRegion;
this.oktaEnvMode = oktaEnvMode;
}
}
1 change: 0 additions & 1 deletion src/main/java/com/okta/tools/OktaAwsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ static OktaAwsCliEnvironment loadEnvironment(String profile) {
getEnvOrConfig(properties, "OKTA_AWS_APP_URL"),
getEnvOrConfig(properties, "OKTA_AWS_ROLE_TO_ASSUME"),
getStsDurationOrDefault(getEnvOrConfig(properties, "OKTA_STS_DURATION")),
getAwsRegionOrDefault(getEnvOrConfig(properties, "OKTA_AWS_REGION")),
Boolean.parseBoolean(getEnvOrConfig(properties, "OKTA_ENV_MODE"))
);
}
Expand Down

0 comments on commit 6580412

Please sign in to comment.