summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-09-18 17:48:02 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-09-18 17:48:02 -0700
commit792addd1e4f58d5782a2cb8afc93b4e4081cb7fc (patch)
tree013e0dc4d2b76c1a9eeb82eeb8163aa9a773489a
parent398202b781c7666fc0ecbf6645f8291f671ed862 (diff)
downloadfatcat-792addd1e4f58d5782a2cb8afc93b4e4081cb7fc.tar.gz
fatcat-792addd1e4f58d5782a2cb8afc93b4e4081cb7fc.zip
api spec: auth token endpoint
-rw-r--r--fatcat-openapi2.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/fatcat-openapi2.yml b/fatcat-openapi2.yml
index 3de72126..065d7756 100644
--- a/fatcat-openapi2.yml
+++ b/fatcat-openapi2.yml
@@ -1392,6 +1392,14 @@ definitions:
token:
type: string
example: "AgEPZGV2LmZhdGNhdC53aWtpAhYyMDE5MDEwMS1kZXYtZHVtbXkta2V5AAImZWRpdG9yX2lkID0gYWFhYWFhYWFhYWFhYmt2a2FhYWFhYWFhYWkAAht0aW1lID4gMjAxOS0wMS0wOVQwMDo1Nzo1MloAAAYgnroNha1hSftChtxHGTnLEmM/pY8MeQS/jBSV0UNvXug="
+ auth_token_result:
+ type: object
+ required:
+ - token
+ properties:
+ token:
+ type: string
+ example: "AgEPZGV2LmZhdGNhdC53aWtpAhYyMDE5MDEwMS1kZXYtZHVtbXkta2V5AAImZWRpdG9yX2lkID0gYWFhYWFhYWFhYWFhYmt2a2FhYWFhYWFhYWkAAht0aW1lID4gMjAxOS0wMS0wOVQwMDo1Nzo1MloAAAYgnroNha1hSftChtxHGTnLEmM/pY8MeQS/jBSV0UNvXug="
x-auth-responses: &AUTHRESPONSES
401:
@@ -4024,4 +4032,43 @@ paths:
schema:
$ref: "#/definitions/error_response"
<<: *AUTHRESPONSES
+ /auth/token/{editor_id}:
+ parameters:
+ - name: editor_id
+ in: path
+ type: string
+ required: true
+ post:
+ operationId: "create_auth_token"
+ tags: # TAGLINE
+ - auth # TAGLINE
+ description: |
+ Generate a new auth token for a given editor (internal method).
+ This method is used by the web interface to generate API tokens for
+ users. It can not be called by editors (human or bot) to generate new
+ tokens for themselves, at least at this time.
+ security:
+ # required admin privs
+ - Bearer: []
+ parameters:
+ - name: duration_seconds
+ in: query
+ type: integer
+ example: 86400
+ required: false
+ description: "How long API token should be valid for (in seconds)"
+ responses:
+ 200:
+ description: Success
+ schema:
+ $ref: "#/definitions/auth_token_result"
+ 400:
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/error_response"
+ 500:
+ description: Generic Error
+ schema:
+ $ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES