Skip to content

Commit

Permalink
Requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robsweet committed Dec 24, 2017
1 parent 017bdda commit 03fa105
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ aws_account_id = account-3-alias

If you sign-in a base account, target roles of the other base accounts are excluded.

The 'Show only matching roles' setting is for use with more sophisticated account structures where you're using AWS Organizations with multiple accounts along with AWS Federated Logins via something like ActiveDirectory or Google GSuite. Common practice is to have a role in the master account that is allowed to assume a role of the same name in other member accounts. Checking this box means that if you're logged in to the 'Developer' role in the master account, only member accounts with a role_arn ending in 'role/Developer' will be shown. You won't see roles that your current role can't actually assume.
The 'Show only matching roles' setting is for use with more sophisticated account structures where you're using AWS Organizations with multiple accounts along with AWS Federated Logins via something like Active Directory or Google GSuite. Common practice is to have a role in the master account that is allowed to assume a role of the same name in other member accounts. Checking this box means that if you're logged in to the 'Developer' role in the master account, only member accounts with a role_arn ending in 'role/Developer' will be shown. You won't see roles that your current role can't actually assume.

## Settings

Expand Down
2 changes: 1 addition & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function generateEmptyRoleList() {
return ul;
}

function loadProfiles(profile, list, csrf, hidesHistory, hidesAccountId, showOnlyMatchingRoles) {
function loadProfiles(profile, list, csrf, hidesHistory, hidesAccountId) {
var recentNames = [];

if (hidesHistory) {
Expand Down
11 changes: 2 additions & 9 deletions src/lib/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ function Profile(items, showOnlyMatchingRoles) {

function getAssumedRole(elId) {
var el = document.getElementById(elId);
if (!el) return null;

var role = el.textContent;
if (role.indexOf('/') > -1) {
return role.split("/")[0];
} else {
return role;
}
return ( !el ? null : el.textContent.split("/")[0] );
}

var baseAccountId = getAccountId('awsc-login-display-name-account');
Expand Down Expand Up @@ -49,7 +42,7 @@ function Profile(items, showOnlyMatchingRoles) {
var baseProfile = srcProfileMap[baseAccountId];
if (baseProfile) {
var name = baseProfile.profile;
var profiles = (destProfileMap[name] || []);
var profiles = destProfileMap[name] || [];
if (showOnlyMatchingRoles) {
profiles = profiles.filter(function(el) { return (el.role_name == baseRole); })
}
Expand Down

0 comments on commit 03fa105

Please sign in to comment.