Defined API key authentication type in swagger docs

This commit is contained in:
Alejandro Celaya 2018-09-20 21:15:17 +02:00
parent 2241279bb6
commit bc46e2f509
7 changed files with 51 additions and 11 deletions

View File

@ -1,11 +1,12 @@
{
"post": {
"deprecated": true,
"operationId": "authenticate",
"tags": [
"Authentication"
],
"summary": "Perform authentication",
"description": "Performs an authentication",
"summary": "[Deprecated] Perform authentication",
"description": "**This endpoint is deprecated, since the authentication can be performed via API key now**. Performs an authentication.",
"requestBody": {
"description": "Request body.",
"required": true,

View File

@ -54,6 +54,9 @@
}
],
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -150,6 +153,9 @@
"summary": "Create short URL",
"description": "Creates a new short URL.<br><br>**Important note**: Before shlink v1.13, this endpoint used to use the `/short-codes` path instead of `/short-urls`. Both of them will keep working, while the first one is considered deprecated.",
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}

View File

@ -18,6 +18,9 @@
}
],
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -122,6 +125,9 @@
}
},
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -182,6 +188,9 @@
}
],
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}

View File

@ -41,6 +41,9 @@
}
},
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}

View File

@ -36,6 +36,9 @@
}
],
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}

View File

@ -7,6 +7,9 @@
"summary": "List existing tags",
"description": "Returns the list of all tags used in any short URL, ordered by name",
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -68,6 +71,9 @@
"summary": "Create tags",
"description": "Provided a list of tags, creates all that do not yet exist",
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -152,6 +158,9 @@
"summary": "Rename tag",
"description": "Renames one existing tag",
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}
@ -240,6 +249,9 @@
}
],
"security": [
{
"ApiKey": []
},
{
"Bearer": []
}

View File

@ -23,8 +23,14 @@
"components": {
"securitySchemes": {
"ApiKey": {
"description": "A valid shlink API key",
"type": "apiKey",
"in": "header",
"name": "X-API-KEY"
},
"Bearer": {
"description": "The JWT identifying a previously logged API key",
"description": "**[Deprecated]** The JWT identifying a previously authenticated API key",
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
@ -33,10 +39,6 @@
},
"tags": [
{
"name": "Authentication",
"description": "Authentication-related endpoints"
},
{
"name": "Short URLs",
"description": "Operations that can be performed on short URLs"
@ -48,14 +50,14 @@
{
"name": "Visits",
"description": "Operations to manage visits on short URLs"
},
{
"name": "Authentication",
"description": "Authentication-related endpoints"
}
],
"paths": {
"/v1/authenticate": {
"$ref": "paths/v1_authenticate.json"
},
"/v1/short-urls": {
"$ref": "paths/v1_short-urls.json"
},
@ -75,6 +77,10 @@
"/v1/short-urls/{shortCode}/visits": {
"$ref": "paths/v1_short-urls_{shortCode}_visits.json"
},
"/v1/authenticate": {
"$ref": "paths/v1_authenticate.json"
}
}
}