Skip to content

NC | NSFS | CLI Basic Support of IAM Accounts Configs - Delete Account #8238

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

Merged

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Jul 29, 2024

Explain the changes

  1. Handle the case where an account has more than 1 access key object.

Issues: Fixed

  1. In PR NC | NSFS | CLI Basic Support of IAM Accounts Configs #8195 we didn't add this handling.
  2. GAP: Add override with a Sensitive string of access key object in a loop (instead of only the first element), see this comment.
    Note: we probably need to delete the undefined secret_key that we have earlier than it was suggested here.

Testing Instructions:

Unit Tests:

Please run: sudo npx jest test_nc_nsfs_account_cli.test.js

Manual Tests:

  1. Create the root user account with the CLI: sudo node src/cmd/manage_nsfs account add --name shira-1001 --new_buckets_path /tmp/nsfs_root1 --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>
    Note: before creating the account need to give permission to the new_buckets_path: chmod 777 /tmp/nsfs_root1.
  2. Start the NSFS server with: sudo node src/cmd/nsfs --debug 5 --https_port_iam 7005
    Notes:
  • Before starting the server please add this line: process.env.NOOBAA_LOG_LEVEL = 'nsfs'; in the endpoint.js (before the condition if (process.env.NOOBAA_LOG_LEVEL) {)
  • I Change the config.NSFS_CHECK_BUCKET_BOUNDARIES = false; //SDSD because I'm using the /tmp/ and not /private/tmp/.
  1. Create the alias for IAM service: alias nc-user-1-iam='AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:7005'.
  2. Use AWS CLI to create an IAM account with 2 access keys:
    • nc-user-1-iam iam create-user --user-name Benny
    • nc-user-1-iam iam create-access-key --user-name Benny
    • nc-user-1-iam iam create-access-key --user-name Benny
  3. Test noobaa-cli account delete: sudo node src/cmd/manage_nsfs account delete --name Benny
    Make sure that there are no symlinks left that point to Benny by sudo tree /etc/noobaa.conf.d/.
  • Doc added/updated
  • Tests added

@shirady shirady force-pushed the nsfs-iam-minor-cli-changes-delete-account branch from edecea2 to e890486 Compare July 29, 2024 12:30
@shirady shirady self-assigned this Jul 29, 2024
Copy link
Contributor

@alphaprinz alphaprinz left a comment

Choose a reason for hiding this comment

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

LGTM

@shirady
Copy link
Contributor Author

shirady commented Jul 30, 2024

@alphaprinz I added a commit, hence asking for re-reviewing it.

@shirady shirady requested a review from alphaprinz July 30, 2024 08:04
@shirady shirady mentioned this pull request Jul 30, 2024
2 tasks
1. Handle the case where an account has more than 1 access key object

Signed-off-by: shirady <[email protected]>
@shirady shirady force-pushed the nsfs-iam-minor-cli-changes-delete-account branch from f7c32e5 to c286886 Compare July 31, 2024 06:49
@shirady shirady merged commit a7069fc into noobaa:master Jul 31, 2024
10 checks passed
@shirady shirady deleted the nsfs-iam-minor-cli-changes-delete-account branch July 31, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants