Skip to content

Commit f0278a3

Browse files
author
Lasim
committed
feat(backend): enhance API spec with health check and consent details
1 parent 2421487 commit f0278a3

File tree

4 files changed

+666
-80
lines changed

4 files changed

+666
-80
lines changed

services/backend/api-spec.json

Lines changed: 257 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@
5050
}
5151
}
5252
},
53+
"/api/plugin/example-plugin/health": {
54+
"get": {
55+
"responses": {
56+
"200": {
57+
"description": "Default Response"
58+
}
59+
}
60+
}
61+
},
5362
"/": {
5463
"get": {
5564
"summary": "API health check",
@@ -18662,13 +18671,13 @@
1866218671
}
1866318672
}
1866418673
},
18665-
"/api/oauth2/consent": {
18674+
"/api/oauth2/consent/details": {
1866618675
"get": {
18667-
"summary": "OAuth2 Consent Page",
18676+
"summary": "Get OAuth2 Consent Details",
1866818677
"tags": [
1866918678
"OAuth2"
1867018679
],
18671-
"description": "Displays consent page for user to approve or deny OAuth2 authorization request.",
18680+
"description": "Returns consent details as JSON for frontend to display consent page.",
1867218681
"parameters": [
1867318682
{
1867418683
"schema": {
@@ -18696,12 +18705,73 @@
1869618705
],
1869718706
"responses": {
1869818707
"200": {
18699-
"description": "HTML consent page",
18708+
"description": "Default Response",
1870018709
"content": {
1870118710
"application/json": {
1870218711
"schema": {
18703-
"type": "string",
18704-
"description": "HTML consent page"
18712+
"schema": {
18713+
"description": "Consent details",
18714+
"type": "object",
18715+
"properties": {
18716+
"success": {
18717+
"description": "Whether the request was found",
18718+
"type": "boolean"
18719+
},
18720+
"request_id": {
18721+
"description": "Authorization request ID",
18722+
"type": "string"
18723+
},
18724+
"client_id": {
18725+
"description": "OAuth2 client identifier",
18726+
"type": "string"
18727+
},
18728+
"client_name": {
18729+
"description": "Human-readable client name",
18730+
"type": "string"
18731+
},
18732+
"user_email": {
18733+
"description": "Email of the authenticated user",
18734+
"type": "string"
18735+
},
18736+
"scopes": {
18737+
"description": "Requested scopes with descriptions",
18738+
"type": "array",
18739+
"items": {
18740+
"type": "object",
18741+
"properties": {
18742+
"name": {
18743+
"description": "Scope name",
18744+
"type": "string"
18745+
},
18746+
"description": {
18747+
"description": "Human-readable scope description",
18748+
"type": "string"
18749+
}
18750+
},
18751+
"required": [
18752+
"name",
18753+
"description"
18754+
],
18755+
"additionalProperties": false
18756+
}
18757+
},
18758+
"expires_at": {
18759+
"description": "When the authorization request expires (ISO string)",
18760+
"type": "string"
18761+
}
18762+
},
18763+
"required": [
18764+
"success",
18765+
"request_id",
18766+
"client_id",
18767+
"client_name",
18768+
"user_email",
18769+
"scopes",
18770+
"expires_at"
18771+
],
18772+
"additionalProperties": false
18773+
},
18774+
"components": {}
1870518775
}
1870618776
}
1870718777
}
@@ -18715,6 +18785,78 @@
1871518785
"description": "Bad Request - Invalid request ID",
1871618786
"type": "object",
1871718787
"properties": {
18788+
"success": {
18789+
"description": "Always false for errors",
18790+
"type": "boolean"
18791+
},
18792+
"error": {
18793+
"description": "OAuth2 error code",
18794+
"type": "string"
18795+
},
18796+
"error_description": {
18797+
"description": "Human-readable error description",
18798+
"type": "string"
18799+
}
18800+
},
18801+
"required": [
18802+
"success",
18803+
"error",
18804+
"error_description"
18805+
],
18806+
"additionalProperties": false
18807+
},
18808+
"components": {}
18809+
}
18810+
}
18811+
}
18812+
},
18813+
"401": {
18814+
"description": "Default Response",
18815+
"content": {
18816+
"application/json": {
18817+
"schema": {
18818+
"schema": {
18819+
"description": "Unauthorized - User not authenticated",
18820+
"type": "object",
18821+
"properties": {
18822+
"success": {
18823+
"description": "Always false for errors",
18824+
"type": "boolean"
18825+
},
18826+
"error": {
18827+
"description": "OAuth2 error code",
18828+
"type": "string"
18829+
},
18830+
"error_description": {
18831+
"description": "Human-readable error description",
18832+
"type": "string"
18833+
}
18834+
},
18835+
"required": [
18836+
"success",
18837+
"error",
18838+
"error_description"
18839+
],
18840+
"additionalProperties": false
18841+
},
18842+
"components": {}
18843+
}
18844+
}
18845+
}
18846+
},
18847+
"403": {
18848+
"description": "Default Response",
18849+
"content": {
18850+
"application/json": {
18851+
"schema": {
18852+
"schema": {
18853+
"description": "Forbidden - User mismatch",
18854+
"type": "object",
18855+
"properties": {
18856+
"success": {
18857+
"description": "Always false for errors",
18858+
"type": "boolean"
18859+
},
1871818860
"error": {
1871918861
"description": "OAuth2 error code",
1872018862
"type": "string"
@@ -18725,6 +18867,7 @@
1872518867
}
1872618868
},
1872718869
"required": [
18870+
"success",
1872818871
"error",
1872918872
"error_description"
1873018873
],
@@ -18744,6 +18887,10 @@
1874418887
"description": "Not Found - Request not found or expired",
1874518888
"type": "object",
1874618889
"properties": {
18890+
"success": {
18891+
"description": "Always false for errors",
18892+
"type": "boolean"
18893+
},
1874718894
"error": {
1874818895
"description": "OAuth2 error code",
1874918896
"type": "string"
@@ -18754,6 +18901,7 @@
1875418901
}
1875518902
},
1875618903
"required": [
18904+
"success",
1875718905
"error",
1875818906
"error_description"
1875918907
],
@@ -18765,13 +18913,15 @@
1876518913
}
1876618914
}
1876718915
}
18768-
},
18916+
}
18917+
},
18918+
"/api/oauth2/consent": {
1876918919
"post": {
1877018920
"summary": "Process OAuth2 Consent",
1877118921
"tags": [
1877218922
"OAuth2"
1877318923
],
18774-
"description": "Processes user consent decision and redirects with authorization code or error.",
18924+
"description": "Processes user consent decision and returns redirect URL or error.",
1877518925
"requestBody": {
1877618926
"content": {
1877718927
"application/json": {
@@ -18805,13 +18955,30 @@
1880518955
}
1880618956
},
1880718957
"responses": {
18808-
"302": {
18809-
"description": "Redirect to client callback URL",
18958+
"200": {
18959+
"description": "Default Response",
1881018960
"content": {
1881118961
"application/json": {
1881218962
"schema": {
18813-
"type": "string",
18814-
"description": "Redirect to client callback URL"
18963+
"schema": {
18964+
"description": "Consent processed successfully",
18965+
"type": "object",
18966+
"properties": {
18967+
"success": {
18968+
"description": "Whether the consent was processed successfully",
18969+
"type": "boolean"
18970+
},
18971+
"redirect_url": {
18972+
"description": "URL to redirect to after consent",
18973+
"type": "string"
18974+
}
18975+
},
18976+
"required": [
18977+
"success"
18978+
],
18979+
"additionalProperties": false
18980+
},
18981+
"components": {}
1881518982
}
1881618983
}
1881718984
}
@@ -18825,6 +18992,10 @@
1882518992
"description": "Bad Request - Invalid parameters",
1882618993
"type": "object",
1882718994
"properties": {
18995+
"success": {
18996+
"description": "Always false for errors",
18997+
"type": "boolean"
18998+
},
1882818999
"error": {
1882919000
"description": "OAuth2 error code",
1883019001
"type": "string"
@@ -18835,6 +19006,75 @@
1883519006
}
1883619007
},
1883719008
"required": [
19009+
"success",
19010+
"error",
19011+
"error_description"
19012+
],
19013+
"additionalProperties": false
19014+
},
19015+
"components": {}
19016+
}
19017+
}
19018+
}
19019+
},
19020+
"401": {
19021+
"description": "Default Response",
19022+
"content": {
19023+
"application/json": {
19024+
"schema": {
19025+
"schema": {
19026+
"description": "Unauthorized - User not authenticated",
19027+
"type": "object",
19028+
"properties": {
19029+
"success": {
19030+
"description": "Always false for errors",
19031+
"type": "boolean"
19032+
},
19033+
"error": {
19034+
"description": "OAuth2 error code",
19035+
"type": "string"
19036+
},
19037+
"error_description": {
19038+
"description": "Human-readable error description",
19039+
"type": "string"
19040+
}
19041+
},
19042+
"required": [
19043+
"success",
19044+
"error",
19045+
"error_description"
19046+
],
19047+
"additionalProperties": false
19048+
},
19049+
"components": {}
19050+
}
19051+
}
19052+
}
19053+
},
19054+
"403": {
19055+
"description": "Default Response",
19056+
"content": {
19057+
"application/json": {
19058+
"schema": {
19059+
"schema": {
19060+
"description": "Forbidden - User mismatch",
19061+
"type": "object",
19062+
"properties": {
19063+
"success": {
19064+
"description": "Always false for errors",
19065+
"type": "boolean"
19066+
},
19067+
"error": {
19068+
"description": "OAuth2 error code",
19069+
"type": "string"
19070+
},
19071+
"error_description": {
19072+
"description": "Human-readable error description",
19073+
"type": "string"
19074+
}
19075+
},
19076+
"required": [
19077+
"success",
1883819078
"error",
1883919079
"error_description"
1884019080
],
@@ -18854,6 +19094,10 @@
1885419094
"description": "Not Found - Request not found or expired",
1885519095
"type": "object",
1885619096
"properties": {
19097+
"success": {
19098+
"description": "Always false for errors",
19099+
"type": "boolean"
19100+
},
1885719101
"error": {
1885819102
"description": "OAuth2 error code",
1885919103
"type": "string"
@@ -18864,6 +19108,7 @@
1886419108
}
1886519109
},
1886619110
"required": [
19111+
"success",
1886719112
"error",
1886819113
"error_description"
1886919114
],

0 commit comments

Comments
 (0)