Skip to content

Commit

Permalink
fix: 🐛 remove all-org-members which is pushing over char limit
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria committed Oct 24, 2024
1 parent d96cab7 commit 8813f78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions add-github-teams-to-aws-saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ exports.onExecutePostLogin = async (event, api) => {
t.replace("github:", ""),
);

api.user.GithubTeam = ":" + git_teams.join(":") + ":";
const filteredTeams = git_teams.filter((t) => t != "all-org-members");

api.user.GithubTeam = ":" + filteredTeams.join(":") + ":";
api.user.awsRoleSession = event.user.nickname;
api.user.awsTagKeys = ["GithubTeam"];
api.user.awsRole = rolePrefix + ":role/" + role + "," + samlIdP;
Expand All @@ -27,7 +29,7 @@ exports.onExecutePostLogin = async (event, api) => {

api.samlResponse.setAttribute(
"https://aws.amazon.com/SAML/Attributes/PrincipalTag:GithubTeam",
":" + git_teams.join(":") + ":",
":" + filteredTeams.join(":") + ":",
);
}
};

0 comments on commit 8813f78

Please sign in to comment.