From cc150e6abe02a94121f34577af8cdab27eddc26d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 6 Sep 2021 01:16:58 -0700 Subject: [PATCH] Updated Amazon S3 API (markdown) --- Amazon-S3-API.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Amazon-S3-API.md b/Amazon-S3-API.md index 7b4da2c..1faeb25 100644 --- a/Amazon-S3-API.md +++ b/Amazon-S3-API.md @@ -79,9 +79,38 @@ By default, `weed s3` will automatically remove empty folders, to be consistent You can use `weed s3 -allowEmptyFolder` to toggle this behavior. # Authentication -By default, the access key and secret key to access `weed s3` is not authenticated. To enable credential based access, create a config.json file similar to the example below, and specify it via `weed s3 -config=config.json`. +By default, the access key and secret key to access `weed s3` is not authenticated. To enable credential based access, you can choose static or dynamic configuration: +* **Dynamic Configuration**: setup auth with `s3.configure` in `weed shell` +* **Static Configuration**: create a config.json file similar to the example below, and specify it via `weed s3 -config=config.json` -## Configuration Example +## Dynamic Configuration +``` +> s3.configure -access_key=any -secret_key=any -buckets=bucket1 -user=me -actions=Read,Write,List,Tagging,Admin -apply +{ + "identities": [ + { + "name": "me", + "credentials": [ + { + "accessKey": "any", + "secretKey": "any" + } + ], + "actions": [ + "Read:bucket1", + "Write:bucket1", + "List:bucket1", + "Tagging:bucket1", + "Admin:bucket1" + ] + } + ] +} +``` + +## Static Configuration + +To enable credential based access, create a config.json file similar to the example below, and specify it via `weed s3 -config=config.json`. You just need to create a user with all "Admin", "Read", "Write", "List", "Tagging" actions. You can create as many users as needed. Each user can have multiple credentials.