You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[NooBaa Non Containerized README](../NooBaaNonContainerized/README.md)
6
5
2.[IAM Design Documentation](../design/iam.md)
7
6
8
7
## Get Started
9
-
Currently, we do not validate the input, so the test should use only valid input.
10
-
11
-
1. Create the `FS_ROOT` and a directory for a bucket: `mkdir -p /tmp/nsfs_root1/my-bucket` and give permissions `chmod 777 /tmp/nsfs_root1/``chmod 777 /tmp/nsfs_root1/my-bucket`.
12
-
This will be the argument for:
13
-
-`new_buckets_path` flag `/tmp/nsfs_root1` (that we will use in the account commands)
14
-
-`path` in the buckets commands `/tmp/nsfs_root1/my-bucket` (that we will use in bucket commands).
3. Start the NSFS server (using debug mode and the port for IAM): `sudo node src/cmd/nsfs --debug 5 --https_port_iam 7005`
18
-
Note: 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) {`)
`nc-user-1-iam-regular iam get-access-key-last-used --access-key-id <access-key>`
36
55
37
56
### Demo Examples:
38
57
#### Deactivate Access Key:
39
-
`alias nc-user-1-iam-regular='AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443'` (port for s3)
58
+
We will start with the steps in the part [Basic Steps](#get-started).
59
+
40
60
1. Use the root account credentials to create a user: `nc-user-1-iam iam create-user --user-name <username>`
41
61
2. Use the root account credentials to create access keys for the user: `nc-user-1-iam iam create-access-key --user-name <username>`
42
62
3. The alias for s3 service: `alias nc-user-1-s3-regular='AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443'`
43
63
2. Create a bucket (so we can list it) `nc-user-1-s3-regular s3 mb s3://<bucket-name`
44
64
3. List bucket (use s3 service)`nc-user-1-s3-regular s3 ls`
45
65
4. List access keys (use IAM service) `nc-user-1-iam-regular iam list-access-keys`
6. It should throw an error for both s3 service (`nc-user-1-s3-regular s3 ls`) and iam service (`nc-user-1-iam-regular iam list-access-keys`) that uses the deactivated access key.
48
-
Note: Currently we clean the cache after update, but it happens for the specific endpoint, if there are more endpoints (using forks) developers can change the expiry cache in the line `expiry_ms: 1` inside `account_cache` (currently inside object_sdk).
67
+
6. It should throw an error for both S3 service (`nc-user-1-s3-regular s3 ls`) and IAM service (`nc-user-1-iam-regular iam list-access-keys`) that uses the deactivated access key.
49
68
50
69
#### Rename Username:
70
+
We will start with the steps in the part [Basic Steps](#get-started).
71
+
51
72
1. Use the root account credentials to create a user: `nc-user-1-iam iam create-user --user-name <username>` (You should see the config file in under the accounts directory).
52
73
2. Use the root account credentials to create access keys for the user:(first time): `nc-user-1-iam iam create-access-key --user-name <username>` (You should see the first symbolic link in under the access_keys directory).
53
74
3. Use the root account credentials to create access keys for the user (second time): `nc-user-1-iam iam create-access-key --user-name <username>` (You should see the second symbolic link in under the access_keys directory).
54
75
4. Update the username: `nc-user-1-iam iam update-user --user-name <username> --new-user-name <new-username>` (You should see the following changes: config file name updated, symlinks updated according to the current config).
55
76
56
-
#### Create root account using the IAM API (requesting account is root accounts manager):
77
+
#### Create Root Account Using the IAM API (Requesting Account is Root Accounts Manager):
2. Use the root accounts manager details in the alias:
@@ -63,35 +84,25 @@ Note: Currently we clean the cache after update, but it happens for the specific
63
84
4. Use the root account credentials to create access keys for the root account: `nc-user-manager-iam iam create-access-key --user-name <username>`
64
85
65
86
#### One Account With 2 Users With Bucket Policy
66
-
Note: Currently we have implementation of the Principal field as name or ID in NC - not with ARN at this point, so we will use what we currently have in this example (we can support it in the future).
67
-
68
-
##### Basic steps (create account and bucket and check connection to endpoint)
Note: before creating the account need to give permission to the `new_buckets_path`: `chmod 777 /Users/buckets/`.
71
-
2. Start the NSFS server (using debug mode and the port for IAM): `sudo node src/cmd/nsfs --debug 5 --https_port_iam 7005`
72
-
3. Create the alias for S3 service:`alias nc-user-1-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’`.
73
-
4. Check the connection to the endpoint and try to list the buckets (should be empty): `nc-user-1-s3 s3 ls; echo $?`
74
-
5. Add bucket to the account using AWS CLI: `nc-user-1-s3 s3 mb s3://bucket-01` (`bucket-01` is the bucket name in this example) or noobaa CLI: `sudo node src/cmd/manage_nsfs bucket add --name bucket-01 --path /Users/buckets/bucket-01 --owner <account-name>`
7. Check the connection to the endpoint and try to list the users (should be empty): `nc-user-1-iam iam list-users`
87
+
Note: Currently, we have implementation of the Principal field as name or ID in NC ([S3 Ops, Bucket Policy - Principal Field](../NooBaaNonContainerized//S3Ops.md#principal-field)) - not with ARN at this point, so we will use what we have at this example (we can support it in the future).
88
+
We will start with the steps in the part [Basic Steps](#get-started).
78
89
79
-
##### IAM steps (create 3 users with access keys)
90
+
##### IAM Steps (Create 3 Users With Access Keys)
80
91
We will create 3 users:
81
92
(1) user for read-write permission user-rw
82
93
(2) user for read permission user-ro
83
94
(3) user without any permission user-no
84
95
85
96
We will give example of user-rw, but it is the same for the rest
86
-
8. Create user: `nc-user-1-iam iam create-user --user-name user-rw`
87
-
9. Create access key for user user-rw: `nc-user-1-iam iam create-access-key --user-name user-rw`
88
-
10. Create alias for S3 service:`alias nc-user-rw-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’`.
89
-
11. Check the connection to the endpoint and try to list the buckets (should be one): `nc-user-rw-s3 s3 ls; echo $?`
97
+
1. Create user: `nc-user-1-iam iam create-user --user-name user-rw`
98
+
2. Create access key for user user-rw: `nc-user-1-iam iam create-access-key --user-name user-rw`
99
+
3. Create alias for S3 service:`alias nc-user-rw-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’`.
100
+
4. Check the connection to the endpoint and try to list the buckets (should be one): `nc-user-rw-s3 s3 ls; echo $?`
90
101
91
102
we will have 3 alias: `nc-user-rw-s3`, `nc-user-ro-s3`, `nc-user-no-s3`
92
103
93
-
##### S3 steps (bucket policy and s3 operations)
94
-
12. Root account will put the bucket policy - `nc-user-1-s3 s3api put-bucket-policy --bucket bucket-01 --policy file://policy.json`
104
+
##### S3 Steps (Bucket Policy and S3 Operations)
105
+
5. Root account will put the bucket policy - `nc-user-1-s3 s3api put-bucket-policy --bucket bucket-01 --policy file://policy.json`
95
106
96
107
policy with IDs (can be done in master branch)
97
108
@@ -142,25 +153,24 @@ policy with names (can be done in version 5.17)
142
153
```
143
154
144
155
user user-rw:
145
-
13. user-rw can put object: `echo 'hello_world1' | nc-user-rw-s3 s3 cp - s3://bucket-01/hello_world1.txt #valid`
146
-
14. user-rw can get object: `nc-user-rw-s3 s3api get-object --bucket bucket-01 --key hello_world1.txt /dev/stdout`
147
-
15. user-rw can list the objects in the bucket: `nc-user-rw-s3 s3api list-objects-v2 --bucket bucket-01` (expected to see `hello_world1.txt`)
156
+
6. user-rw can put object: `echo 'hello_world1' | nc-user-rw-s3 s3 cp - s3://bucket-01/hello_world1.txt #valid`
157
+
7. user-rw can get object: `nc-user-rw-s3 s3api get-object --bucket bucket-01 --key hello_world1.txt /dev/stdout`
158
+
8. user-rw can list the objects in the bucket: `nc-user-rw-s3 s3api list-objects-v2 --bucket bucket-01` (expected to see `hello_world1.txt`)
0 commit comments