noobaa-core
noobaa-core copied to clipboard
NC | NSFS | Config Dir Restructure - Add `users/` Dir
Explain the changes
- Update IAM API Users, Access Keys and additional changes in
accountspace_fs
:
- Move the config creation from the function
_copy_data_from_requesting_account_to_account_config
to thecreate_user
. - Fix the ARN account ID for root accounts that were operated by the roots accounts manager (before we copied the
requesting_account._id
which was true only for root accounts on IAM users). - Fix
_check_root_account
as it has a redundant line that was not relevant (it was there when we thought of additional case, but we never get to it). - Add 2 helper functions:
_get_account_owner_id_for_arn
,_get_owner_account_argument
. - Improve performance in the function
_check_if_root_account_does_not_have_IAM_users_before_deletion
after we have the new structure. - Remove the comment about performance improvement on the function
_check_if_root_account_does_not_have_buckets_before_deletion
since there is no change in the config structure related to buckets.
- Update the
ConfigFS
module to support the new structure and also operate on users configs. - Update docs with the config dire restructure (
identities/
,accounts_by_name/
,users/
directories). - Update the IAM API tests:
- Mainly reading the config file in the new structure.
- Add account validation to accounts that were created hardcoded (to avoid schema changes without them updated).
- Refactor
it
names to multiple lines.
Issues:
Open questions to answer in the CR:
- Should we delete the directory
users/
if there are no users in the account? I decided not to delete it. - What should the ARN of the account (not a user, the identity that the root accounts manager operates on) look like? I decided it will be
arn:aws:iam::${account_id}:user/${username}
theaccount_id
is his_id
and theusername
it is the account name.
List of GAPS:
- Add JSDoc in
accountspace_fs
methods.
Testing Instructions:
Unit Tests:
Please run: sudo npx jest test_accountspace_fs.test.js
Manual Tests:
Operate any IAM actions on users and access keys on the NSFS server as described in Non Containerized NSFS IAM (Developers Documentation)
- [X] Doc added/updated
- [X] Tests added