Skip to content

Commit

Permalink
Specify which SSP to update
Browse files Browse the repository at this point in the history
  • Loading branch information
selenaxiao-nist committed Sep 30, 2024
1 parent 699d0b3 commit 34bbbcc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/account_management_request_form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ body:
multiple: false
validations:
required: true
- type: input
id: ssp-file-path
attributes:
label: File path of SSP
description: Type in the file path of the SSP to update
placeholder: .sims/
validations:
required: true
- type: checkboxes
id: attestation
attributes:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/account_request_approve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
user-username: ${{ steps.issue-parser.outputs.issueparser_user-username }}
user-email: ${{ steps.issue-parser.outputs.issueparser_user-email }}
account-type: ${{ steps.issue-parser.outputs.issueparser_account-type }}
ssp-file-path: ${{ steps.issue-parser.outputs.issueparser_ssp-file-path }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -72,8 +73,9 @@ jobs:
USER_EMAIL: ${{ needs.parse-issue.outputs.user-email }}
USER_ROLE: ${{ needs.parse-issue.outputs.account-type }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
SSP_FILE_PATH: ${{ needs.parse-issue.outputs.ssp-file-path }}
run: |
python ato/secops/create_user.py --user-name "$USER_NAME" --user-username "$USER_USERNAME" --user-email "$USER_EMAIL" --user-role "$USER_ROLE" --issue-number "$ISSUE_NUMBER"
python ato/secops/create_user.py --user-name "$USER_NAME" --user-username "$USER_USERNAME" --user-email "$USER_EMAIL" --user-role "$USER_ROLE" --issue-number "$ISSUE_NUMBER" --ssp-path "$SSP_FILE_PATH"
- name: Store user yaml in repo
run: |
Expand All @@ -86,7 +88,7 @@ jobs:
git push origin "$BRANCH_NAME"
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
BRANCH_NAME: "account-request-${{ github.event.issue.number }}"
BRANCH_NAME: "account-request"

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 # v4
Expand Down
5 changes: 4 additions & 1 deletion ato/secops/create_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@click.option('--location-uuid', help='UUID of physical location of user')
@click.option('--org-member', help='UUID of organization that user is member of')
@click.option('--issue-number', help='Issue number of user account request')
def create_user(user_name, user_username, user_email, user_role, location_uuid, org_member, issue_number):
@click.option('--ssp-path', help='File path of SSP to update')
def create_user(user_name, user_username, user_email, user_role, location_uuid, org_member, issue_number, ssp_path):
"""
Creates a yaml file containing information about a new user
Expand All @@ -22,6 +23,7 @@ def create_user(user_name, user_username, user_email, user_role, location_uuid,
location_uuid (string): String containing UUID of physical location of user
org_member (string): String containing UUID of organization that user is member of
issue_number (string): String containing issue number of user account request
ssp_path (string): String containing file path of SSP to update
"""

# Structure of yaml file
Expand All @@ -34,6 +36,7 @@ def create_user(user_name, user_username, user_email, user_role, location_uuid,
"role":f"{user_role}",
"location-uuid":f"{location_uuid}",
"member-of-organization":f"{org_member}",
"ssp-path": f"{ssp_path}",
},
}

Expand Down

0 comments on commit 34bbbcc

Please sign in to comment.