From 1513ade19afd7cec4aa8017e5ca0265b28838325 Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Tue, 15 Mar 2016 22:19:31 -0400 Subject: [PATCH] Added API documentation for userpass backend --- website/source/docs/auth/userpass.html.md | 211 ++++++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/website/source/docs/auth/userpass.html.md b/website/source/docs/auth/userpass.html.md index 2e4a929b5..597e5bb83 100644 --- a/website/source/docs/auth/userpass.html.md +++ b/website/source/docs/auth/userpass.html.md @@ -92,3 +92,214 @@ $ vault write auth/userpass/users/mitchellh \ The above creates a new user "mitchellh" with the password "foo" that will be associated with the "root" policy. This is the only configuration necessary. + +## API + +### /auth/userpass/users/[username] +#### POST + +
+
Description
+
+ Create a new user or update an existing user. +
+ +
Method
+
POST
+ +
URL
+
`/auth/userpass/users/`
+ +
Parameters
+
+
    +
  • + username + required + Username for this user. +
  • +
+
+
+
    +
  • + password + required + Password for this user. +
  • +
+
+
+
    +
  • + policies + optional + Comma-separated list of policies. + If set to empty string, only the `default` policy will be applicable to the user. +
  • +
+
+
+
    +
  • + ttl + optional + The lease duration which decides login expiration. +
  • +
+
+
+
    +
  • + max_ttl + optional + Maximum duration after which login should expire. +
  • +
+
+ +
Returns
+
`204` response code. +
+
+ +### /auth/userpass/users/[username]/password +#### POST +
+
Description
+
+ Update the password for an existing user. +
+ +
Method
+
POST
+ +
URL
+
`/auth/userpass/users//password`
+ +
Parameters
+
+
    +
  • + username + required + Username for this user. +
  • +
+
+
+
    +
  • + password + required + Password for this user. +
  • +
+
+ +
Returns
+
`204` response code. +
+
+ +### /auth/userpass/users/[username]/policies +#### POST +
+
Description
+
+ Update the policies associated with an existing user. +
+ +
Method
+
POST
+ +
URL
+
`/auth/userpass/users//policies`
+ +
Parameters
+
+
    +
  • + username + required + Username for this user. +
  • +
+
+
+
    +
  • + policies + optional + Comma-separated list of policies. + If this is field is not supplied, the policies will be unchanged. + If set to empty string, only the `default` policy will be applicable to the user. +
  • +
+
+ +
Returns
+
`204` response code. +
+
+ + +### /auth/userpass/login/[username] +#### POST +
+
Description
+
+ Update the policies associated with an existing user. +
+ +
Method
+
POST
+ +
URL
+
`/auth/userpass/users//policies`
+ +
Parameters
+
+
    +
  • + username + required + Username for this user. +
  • +
+
+
+
    +
  • + password + required + Password for this user. +
  • +
+
+ +
Returns
+
+ + ```javascript + { + "lease_id": "", + "renewable": false, + "lease_duration": 0, + "data": null, + "warnings": null, + "auth": { + "client_token": "64d2a8f2-2a2f-5688-102b-e6088b76e344", + "accessor": "18bb8f89-826a-56ee-c65b-1736dc5ea27d", + "policies": ["default"], + "metadata": { + "username": "vishal" + }, + "lease_duration": 7200, + "renewable": true + } + } + ``` + +
+