Browse Source

docs: fix typos in auth_api.md

Yicheng Qin 10 years ago
parent
commit
9c695dce25
1 changed files with 25 additions and 24 deletions
  1. 25 24
      Documentation/auth_api.md

+ 25 - 24
Documentation/auth_api.md

@@ -111,14 +111,14 @@ The User JSON object is formed as follows:
 
 
 ```
 ```
 {
 {
-  "user": "userName"
-  "password": "password"
+  "user": "userName",
+  "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": {
-            "prefixesAllowed": ["/fleet/"],
-          },
-          "write": {
-            "prefixesAllowed": ["/fleet/"],
-          },
+          "permissions" : {
+            "kv" : {
+              "read": [ "/fleet/" ],
+              "write": [ "/fleet/" ]
+            }
+          }
         }
         }
 
 
 **Create Or Update A Role**
 **Create Or Update A Role**
@@ -308,11 +308,11 @@ 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:
-      {
+        {
           "role" : "guest",
           "role" : "guest",
           "revoke" : {
           "revoke" : {
             "kv" : {
             "kv" : {
@@ -322,7 +322,6 @@ PUT  /v2/auth/users/guest
             }
             }
           }
           }
         }
         }
-      }
 ```
 ```
 
 
 
 
@@ -334,7 +333,7 @@ Create the rkt role fully specified:
 PUT /v2/auth/roles/rkt
 PUT /v2/auth/roles/rkt
     Headers:
     Headers:
         Authorization: Basic <root:betterRootPW!>
         Authorization: Basic <root:betterRootPW!>
-    Body: 
+    Body:
         {
         {
           "role" : "rkt",
           "role" : "rkt",
           "permissions" : {
           "permissions" : {
@@ -356,9 +355,9 @@ But let's make fleet just a basic role for now:
 PUT /v2/auth/roles/fleet
 PUT /v2/auth/roles/fleet
     Headers:
     Headers:
       Authorization: Basic <root:betterRootPW!>
       Authorization: Basic <root:betterRootPW!>
-    Body: 
+    Body:
         {
         {
-            "role" : "fleet",
+          "role" : "fleet"
         }
         }
 ```
 ```
 
 
@@ -415,7 +414,7 @@ PUT /v2/auth/users/fleetuser
     Headers:
     Headers:
         Authorization: Basic <root:betterRootPW!>
         Authorization: Basic <root:betterRootPW!>
     Body:
     Body:
-      {"user": "fleetuser", "grant": ["fleet"]}
+        {"user": "fleetuser", "grant": ["fleet"]}
 ```
 ```
 
 
 #### Start to use fleetuser and rktuser
 #### Start to use fleetuser and rktuser
@@ -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.