summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec/api.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api-spec/api.yaml')
-rw-r--r--rust/fatcat-api-spec/api.yaml253
1 files changed, 251 insertions, 2 deletions
diff --git a/rust/fatcat-api-spec/api.yaml b/rust/fatcat-api-spec/api.yaml
index 0f52a8b6..625a0143 100644
--- a/rust/fatcat-api-spec/api.yaml
+++ b/rust/fatcat-api-spec/api.yaml
@@ -13,6 +13,12 @@ consumes:
produces:
- application/json
+securityDefinitions:
+ Bearer:
+ type: apiKey
+ name: Authorization
+ in: header
+
tags: # TAGLINE
- name: containers # TAGLINE
descriptions: "Container entities: such as journals, conferences, book series" # TAGLINE
@@ -437,10 +443,14 @@ definitions:
username:
type: string
example: "zerocool93"
+ is_admin:
+ type: boolean
+ is_bot:
+ type: boolean
+ is_active:
+ type: boolean
editgroup:
type: object
- required:
- - editor_id
properties:
editgroup_id:
<<: *FATCATIDENT
@@ -542,7 +552,45 @@ definitions:
additionalProperties: {}
role:
type: string
+ auth_oidc:
+ type: object
+ required:
+ - provider
+ - sub
+ - iss
+ - preferred_username
+ properties:
+ provider:
+ type: string
+ sub:
+ type: string
+ iss:
+ type: string
+ preferred_username:
+ type: string
+ auth_oidc_result:
+ type: object
+ required:
+ - editor
+ - token
+ properties:
+ editor:
+ $ref: "#/definitions/editor"
+ token:
+ type: string
+x-auth-responses: &AUTHRESPONSES
+ 401:
+ description: Not Authorized # "Authentication information is missing or invalid"
+ schema:
+ $ref: "#/definitions/error_response"
+ headers:
+ WWW_Authenticate:
+ type: string
+ 403:
+ description: Forbidden
+ schema:
+ $ref: "#/definitions/error_response"
x-entity-responses: &ENTITYRESPONSES
400:
description: Bad Request
@@ -573,12 +621,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/container/batch:
post:
operationId: "create_container_batch"
@@ -602,6 +653,8 @@ paths:
type: array
items:
$ref: "#/definitions/container_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -610,6 +663,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/container/{ident}:
parameters:
- name: ident
@@ -651,12 +705,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_container"
tags: # TAGLINE
@@ -666,12 +723,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/container/rev/{rev_id}:
parameters:
- name: rev_id
@@ -795,12 +855,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/creator:
post:
operationId: "create_creator"
@@ -816,12 +879,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/creator/batch:
post:
operationId: "create_creator_batch"
@@ -845,6 +911,8 @@ paths:
type: array
items:
$ref: "#/definitions/creator_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -853,6 +921,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/creator/{ident}:
parameters:
- name: ident
@@ -894,12 +963,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_creator"
tags: # TAGLINE
@@ -909,12 +981,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/creator/rev/{rev_id}:
parameters:
- name: rev_id
@@ -1061,12 +1136,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/file:
post:
operationId: "create_file"
@@ -1082,12 +1160,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/file/batch:
post:
operationId: "create_file_batch"
@@ -1111,6 +1192,8 @@ paths:
type: array
items:
$ref: "#/definitions/file_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -1119,6 +1202,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/file/{ident}:
parameters:
- name: ident
@@ -1160,12 +1244,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_file"
tags: # TAGLINE
@@ -1175,12 +1262,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/file/rev/{rev_id}:
parameters:
- name: rev_id
@@ -1309,12 +1399,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/fileset:
post:
operationId: "create_fileset"
@@ -1330,12 +1423,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/fileset/batch:
post:
operationId: "create_fileset_batch"
@@ -1359,6 +1455,8 @@ paths:
type: array
items:
$ref: "#/definitions/fileset_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -1367,6 +1465,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/fileset/{ident}:
parameters:
- name: ident
@@ -1408,12 +1507,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_fileset"
tags: # TAGLINE
@@ -1423,12 +1525,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/fileset/rev/{rev_id}:
parameters:
- name: rev_id
@@ -1523,12 +1628,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/webcapture:
post:
operationId: "create_webcapture"
@@ -1544,12 +1652,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/webcapture/batch:
post:
operationId: "create_webcapture_batch"
@@ -1573,6 +1684,8 @@ paths:
type: array
items:
$ref: "#/definitions/webcapture_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -1581,6 +1694,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/webcapture/{ident}:
parameters:
- name: ident
@@ -1622,12 +1736,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_webcapture"
tags: # TAGLINE
@@ -1637,12 +1754,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/webcapture/rev/{rev_id}:
parameters:
- name: rev_id
@@ -1737,12 +1857,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/release:
post:
operationId: "create_release"
@@ -1758,12 +1881,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/release/batch:
post:
operationId: "create_release_batch"
@@ -1787,6 +1913,8 @@ paths:
type: array
items:
$ref: "#/definitions/release_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -1795,6 +1923,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/release/{ident}:
parameters:
- name: ident
@@ -1836,12 +1965,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_release"
tags: # TAGLINE
@@ -1851,12 +1983,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/release/rev/{rev_id}:
parameters:
- name: rev_id
@@ -2066,12 +2201,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/work:
post:
operationId: "create_work"
@@ -2087,12 +2225,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
201:
description: Created Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/work/batch:
post:
operationId: "create_work_batch"
@@ -2116,6 +2257,8 @@ paths:
type: array
items:
$ref: "#/definitions/work_entity"
+ security:
+ - Bearer: []
responses:
201:
description: Created Entities
@@ -2124,6 +2267,7 @@ paths:
items:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/work/{ident}:
parameters:
- name: ident
@@ -2165,12 +2309,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Updated Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
delete:
operationId: "delete_work"
tags: # TAGLINE
@@ -2180,12 +2327,15 @@ paths:
in: query
required: false
type: string
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Entity
schema:
$ref: "#/definitions/entity_edit"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/work/rev/{rev_id}:
parameters:
- name: rev_id
@@ -2303,12 +2453,15 @@ paths:
in: path
required: true
<<: *FATCATUUID
+ security:
+ - Bearer: []
responses:
200:
description: Deleted Edit
schema:
$ref: "#/definitions/success"
<<: *ENTITYRESPONSES
+ <<: *AUTHRESPONSES
/editor/{editor_id}:
parameters:
- name: editor_id
@@ -2334,6 +2487,34 @@ paths:
description: Generic Error
schema:
$ref: "#/definitions/error_response"
+ put:
+ operationId: "update_editor"
+ parameters:
+ - name: editor
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/editor"
+ security:
+ - Bearer: []
+ responses:
+ 200:
+ description: Updated Editor
+ schema:
+ $ref: "#/definitions/editor"
+ 400:
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/error_response"
+ 404:
+ description: Not Found
+ schema:
+ $ref: "#/definitions/error_response"
+ 500:
+ description: Generic Error
+ schema:
+ $ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES
/editor/{editor_id}/changelog:
parameters:
- name: editor_id
@@ -2372,6 +2553,8 @@ paths:
required: true
schema:
$ref: "#/definitions/editgroup"
+ security:
+ - Bearer: []
responses:
201:
description: Successfully Created
@@ -2385,6 +2568,7 @@ paths:
description: Generic Error
schema:
$ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES
/editgroup/{editgroup_id}:
parameters:
- name: editgroup_id
@@ -2422,6 +2606,8 @@ paths:
operationId: "accept_editgroup"
tags: # TAGLINE
- edit-lifecycle # TAGLINE
+ security:
+ - Bearer: []
responses:
200:
description: Merged Successfully
@@ -2443,6 +2629,7 @@ paths:
description: Generic Error
schema:
$ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES
/changelog:
parameters:
- name: limit
@@ -2489,3 +2676,65 @@ paths:
description: Generic Error
schema:
$ref: "#/definitions/error_response"
+ /auth/oidc:
+ post:
+ operationId: "auth_oidc"
+ tags: # TAGLINE
+ security:
+ # required admin privs
+ - Bearer: []
+ parameters:
+ - name: oidc_params
+ in: body
+ required: true
+ schema:
+ $ref: "#/definitions/auth_oidc"
+ responses:
+ 200:
+ description: Found
+ schema:
+ $ref: "#/definitions/auth_oidc_result"
+ 201:
+ description: Created
+ schema:
+ $ref: "#/definitions/auth_oidc_result"
+ 400:
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/error_response"
+ 409:
+ description: Conflict
+ schema:
+ $ref: "#/definitions/error_response"
+ 500:
+ description: Generic Error
+ schema:
+ $ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES
+ /auth/check:
+ get:
+ operationId: "auth_check"
+ tags: # TAGLINE
+ security:
+ # required admin privs
+ - Bearer: []
+ parameters:
+ - name: role
+ in: query
+ required: false
+ type: string
+ responses:
+ 200:
+ description: Success
+ schema:
+ $ref: "#/definitions/success"
+ 400:
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/error_response"
+ 500:
+ description: Generic Error
+ schema:
+ $ref: "#/definitions/error_response"
+ <<: *AUTHRESPONSES
+