-
Notifications
You must be signed in to change notification settings - Fork 80
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
NC | NSFS | Bucket Policy With Principal as account ID #8280
Conversation
Additional Testing instructions:
note: replace the
Note: in order to see the changes immediately, change the Object SDK bucket cache expiration time |
3f6944e
to
b2b325a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to add full S3 flow test (test_s3_bucket_policy.js) for testing put_bucket_policy using S3 and the authorization of some functionalities
b2b325a
to
f4f5ba9
Compare
@shirady looks good, added a few minor comments |
a3537f7
to
8783f0b
Compare
This PR is based on @alphaprinz noobaa#8167 PR. 1. In s3_rest under the function authorize_request_policy rename account_identifier to account_identifier_name and add account_identifier_id. 2. In bucketspace_fs where we use put_bucket_policy and in manage_nsfs_validations where we validate the bucket policy use is_account_exists_by_principal that accepts both account name and id. 3. Both in authorize_request_policy (s3_rest) and has_bucket_action_permission (bucketspace_fs) check the principal by ID first and then the principal by name. Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
8783f0b
to
4c60720
Compare
Explain the changes
This PR is based on @alphaprinz #8167 PR.
s3_rest
under the functionauthorize_request_policy
renameaccount_identifier
toaccount_identifier_name
and addaccount_identifier_id
.bucketspace_fs
where we useput_bucket_policy
and inmanage_nsfs_validations
where we validate the bucket policy useis_account_exists_by_principal
that accepts both account name and id.authorize_request_policy
(s3_rest
) andhas_bucket_action_permission
(bucketspace_fs
) check the principal by ID first and then the principal by name.Issues: Fixed #xxx / Gap #xxx
List of GAPs
noobaa-core/src/sdk/bucketspace_fs.js
Lines 670 to 671 in 906ba38
Testing Instructions:
Unit Tests:
Please run:
sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha ./src/test/unit_tests/test_bucketspace_fs.js
sudo npx jest test_nc_nsfs_bucket_cli.test.js
sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha ./src/test/unit_tests/test_s3_bucket_policy.js
Manual Tests:
High level - more details in the comment below:
"Principal": { "AWS": [ "<account-id>" ] }
).