Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional authorized team configuration #88

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

robandpdx
Copy link
Collaborator

@robandpdx robandpdx commented Dec 8, 2023

This pull request introduces an option to configure an AUTHORIZED_TEAM which the application will check the users membership of in order to act. The changes are centered around the app.js file, with corresponding updates to the README.md, template.yml, and test.js files to reflect the new functionality.

The main changes include:

Authorization Mechanism:

  • app.js: Added an authorization check to various actions such as opening a pull request, adding a comment, and adding the EMERGENCY_LABEL. This check verifies if the user performing the action is a member of the authorized team specified in the AUTHORIZED_TEAM environment variable. If the user is not authorized, a comment is posted on the PR and the emergency label is removed if it was added. This authorization mechanism is implemented in the isAuthorized() function. [1] [2] [3] [4] [5] [6]

  • README.md: Updated the documentation to explain the new AUTHORIZED_TEAM environment variable and the authorization mechanism.

  • template.yml: Added the AUTHORIZED_TEAM parameter to the AWS SAM template. [1] [2]

Test Cases:

  • test.js: Updated and added new test cases to cover the new authorization mechanism. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]

Copy link

github-actions bot commented Dec 8, 2023


=============================== Coverage summary ===============================
Statements   : 100% ( 145/145 )
Branches     : 100% ( 84/84 )
Functions    : 100% ( 27/27 )
Lines        : 100% ( 144/144 )
================================================================================

Copy link

@pmartindev pmartindev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@robandpdx robandpdx merged commit 79beb09 into main Dec 18, 2023
2 checks passed
@robandpdx robandpdx deleted the add-team-option branch December 18, 2023 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants