basho/riak_cs — pull request #958 by kuenishi (2014-08-22 05:48:31+00:00)
Title: Single user mode

When all the access goes to single bucket (and single user) then getting user record and bucket object from Riak might be bottleneck, because every single operation is serialized there. This patch makes a new separate mode that does not use `moss.buckets` nor `moss.users`, but takes them from `app.config`. Also, if single user mode is enabled there is no need for stanchion.

Limitations are: no ACLs, policies can be modified at runtime. No users and no buckets can be created on runtime. Enabled APIs are: PUT,GET,DELETE Object, GET Bucket. And pre-defined canned ACLs. This mode cannot be mixed with existing Riak CS setup (or, if very carefully configured, maybe).

To enable this mode, add lines like this to `app.config`:
```erlang
{single_user_mode, enabled},
{single_users_buckets,
[
"su-flat-bucket",
{"su-acl-public-read", [{canned_acl, "public-read"}]},
{"su-acl-public-rw", [{canned_acl, "public-read-write"}]}
]
},
```
The only accessible user is admin, defined via `admin_key` and `admin_secret`.