Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Add an uid to make API Keys determinists, plus add a non-unique human…
Browse files Browse the repository at this point in the history
… readable name field to ease reading information
  • Loading branch information
gmourier committed May 16, 2022
1 parent 28ae026 commit 6c0fdaf
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 380 deletions.
48 changes: 38 additions & 10 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,13 @@ components:
title: key
type: object
properties:
uid:
type: string
description: A uuid v4 to identify the API Key. If not specified, it's generated by Meilisearch.
example: 01b4bc42-eb33-4041-b481-254d00cce834
key:
type: string
description: The generated key. Generated by Meilisearch.
description: The derived key to use in the Authorization header to authorize requests. Generated by Meilisearch with a SHA-256 hash of the uid and the master key.
example: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
readOnly: true
actions:
Expand Down Expand Up @@ -618,6 +622,12 @@ components:
items:
type: string
example: movies
name:
type:
- string
- 'null'
description: A human-readable name for the key. null if empty.
default: null
description:
type:
- string
Expand Down Expand Up @@ -2643,20 +2653,22 @@ paths:
example-1:
value:
results:
- key: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
- uid: 01b4bc42-eb33-4041-b481-254d00cce834
key: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
name: An API Key
description: null
actions:
- documents.add
indexes:
- movies
description: An API Key
expiresAt: '2022-11-12T10:00:00Z'
createdAt: '2021-11-12T10:00:00Z'
updatedAt: '2021-11-12T10:00:00Z'
'401':
$ref: '#/components/responses/401'
'/keys/{key}':
'/keys/{uid}':
get:
summary: Get an API key
summary: Get an API key from its uid
tags:
- Keys
security:
Expand All @@ -2671,8 +2683,10 @@ paths:
examples:
Fetch an API Key details:
value:
description: Indexing Products API key
uid: 01b4bc42-eb33-4041-b481-254d00cce834
key: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
name: Indexing Products API key
description: null
actions:
- documents.add
indexes:
Expand Down Expand Up @@ -2717,8 +2731,10 @@ paths:
examples:
Patch an API Key Response:
value:
description: Indexing Products API key
uid: 01b4bc42-eb33-4041-b481-254d00cce834
key: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
name: Indexing Products API key
description: null
actions:
- documents.add
indexes:
Expand All @@ -2733,7 +2749,17 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/key'
type: object
properties:
name:
type:
- string
- 'null'
description:
type:
- string
- 'null'
additionalProperties: false
examples:
Patch an API Key Request:
value:
Expand All @@ -2755,8 +2781,10 @@ paths:
examples:
Create an API Key:
value:
description: Indexing Products API key
uid: 01b4bc42-eb33-4041-b481-254d00cce834
key: d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4
name: Indexing Products API key
description: null
actions:
- documents.add
indexes:
Expand All @@ -2774,7 +2802,7 @@ paths:
examples:
API Key Creation:
value:
description: Indexing Products API key
name: Indexing Products API key
actions:
- documents.add
indexes:
Expand Down
Loading

0 comments on commit 6c0fdaf

Please sign in to comment.