Merge pull request #3062 from yichengq/fix-auth-doc

docs: fix typos in auth_api.md
This commit is contained in:
Yicheng Qin 2015-06-25 17:54:05 -07:00
commit 3e455ed104

View File

@ -111,14 +111,14 @@ The User JSON object is formed as follows:
``` ```
{ {
"user": "userName" "user": "userName",
"password": "password" "password": "password",
"roles": [ "roles": [
"role1", "role1",
"role2" "role2"
], ],
"grant": [], "grant": [],
"revoke": [], "revoke": []
} }
``` ```
@ -126,7 +126,7 @@ Password is only passed when necessary.
**Get a list of users** **Get a list of users**
GET/HEAD /v2/auth/user GET/HEAD /v2/auth/users
Sent Headers: Sent Headers:
Authorization: Basic <BasicAuthString> Authorization: Basic <BasicAuthString>
@ -154,7 +154,7 @@ GET/HEAD /v2/auth/users/alice
Content-type: application/json Content-type: application/json
200 Body: 200 Body:
{ {
"user" : "alice" "user" : "alice",
"roles" : ["fleet", "etcd"] "roles" : ["fleet", "etcd"]
} }
@ -203,13 +203,13 @@ A full role structure may look like this. A Permission List structure is used fo
{ {
"role" : "fleet", "role" : "fleet",
"permissions" : { "permissions" : {
"kv" { "kv" : {
"read" : [ "/fleet/" ], "read" : [ "/fleet/" ],
"write": [ "/fleet/" ], "write": [ "/fleet/" ]
}
} }
},
"grant" : {"kv": {...}}, "grant" : {"kv": {...}},
"revoke": {"kv": {...}}, "revoke": {"kv": {...}}
} }
``` ```
@ -244,12 +244,12 @@ GET/HEAD /v2/auth/roles/fleet
200 Body: 200 Body:
{ {
"role" : "fleet", "role" : "fleet",
"read": { "permissions" : {
"prefixesAllowed": ["/fleet/"], "kv" : {
}, "read": [ "/fleet/" ],
"write": { "write": [ "/fleet/" ]
"prefixesAllowed": ["/fleet/"], }
}, }
} }
**Create Or Update A Role** **Create Or Update A Role**
@ -308,7 +308,7 @@ PUT /v2/auth/enable
### Modify guest role (revoke write permission) ### Modify guest role (revoke write permission)
``` ```
PUT /v2/auth/users/guest PUT /v2/auth/roles/guest
Headers: Headers:
Authorization: Basic <root:betterRootPW!> Authorization: Basic <root:betterRootPW!>
Put Body: Put Body:
@ -322,7 +322,6 @@ PUT /v2/auth/users/guest
} }
} }
} }
}
``` ```
@ -358,7 +357,7 @@ PUT /v2/auth/roles/fleet
Authorization: Basic <root:betterRootPW!> Authorization: Basic <root:betterRootPW!>
Body: Body:
{ {
"role" : "fleet", "role" : "fleet"
} }
``` ```
@ -424,9 +423,11 @@ PUT /v2/auth/users/fleetuser
For example: For example:
``` ```
PUT /v2/keys/rocket/RktData PUT /v2/keys/rkt/RktData
Headers: Headers:
Authorization: Basic <rocketuser:rocketpw> Authorization: Basic <rktuser:rktpw>
Body:
value=launch
``` ```
Reads and writes outside the prefixes granted will fail with a 401 Unauthorized. Reads and writes outside the prefixes granted will fail with a 401 Unauthorized.