From 8faa31155129c81ae4de6059372bfe23bb94da50 Mon Sep 17 00:00:00 2001 From: DmitryAnansky Date: Wed, 3 Jun 2026 18:27:35 +0300 Subject: [PATCH] feat: update revenue endpoint auth --- @theme/ext/use-configure-replay.ts | 2 +- openapi/cafe.yaml | 2 ++ openapi/components/schemas/OAuth2Client.yaml | 1 + openapi/components/schemas/RegisterClientObject.yaml | 1 + openapi/paths/oauth2_register.yaml | 1 + openapi/paths/revenue.yaml | 2 ++ 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/@theme/ext/use-configure-replay.ts b/@theme/ext/use-configure-replay.ts index 9457266..f80c254 100644 --- a/@theme/ext/use-configure-replay.ts +++ b/@theme/ext/use-configure-replay.ts @@ -19,7 +19,7 @@ type ContextProps = { userClaims: UserClaims; }; -const SCOPES = ['menu:read', 'menu:write', 'orders:read', 'orders:write']; +const SCOPES = ['menu:read', 'menu:write', 'orders:read', 'orders:write', 'revenue:read']; const BASE_URL = 'https://cafe.cloud.redocly.com'; const CLIENT_NAME = 'auth'; diff --git a/openapi/cafe.yaml b/openapi/cafe.yaml index ca93a70..0692ca6 100644 --- a/openapi/cafe.yaml +++ b/openapi/cafe.yaml @@ -58,6 +58,7 @@ components: menu:write: Write access to menu items (create, delete) orders:read: Read access to orders orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics clientCredentials: tokenUrl: https://cafe.cloud.redocly.com/oauth2/token scopes: @@ -65,6 +66,7 @@ components: menu:write: Write access to menu items (create, delete) orders:read: Read access to orders orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics ApiKey: type: apiKey name: X-API-Key diff --git a/openapi/components/schemas/OAuth2Client.yaml b/openapi/components/schemas/OAuth2Client.yaml index c7901dd..dd98342 100644 --- a/openapi/components/schemas/OAuth2Client.yaml +++ b/openapi/components/schemas/OAuth2Client.yaml @@ -40,6 +40,7 @@ properties: - menu:write - orders:read - orders:write + - revenue:read description: List of scopes (registered metadata). grantTypes: type: array diff --git a/openapi/components/schemas/RegisterClientObject.yaml b/openapi/components/schemas/RegisterClientObject.yaml index 468b120..070fcd4 100644 --- a/openapi/components/schemas/RegisterClientObject.yaml +++ b/openapi/components/schemas/RegisterClientObject.yaml @@ -18,6 +18,7 @@ properties: - menu:write - orders:read - orders:write + - revenue:read description: List of scopes. grantTypes: type: array diff --git a/openapi/paths/oauth2_register.yaml b/openapi/paths/oauth2_register.yaml index ce5d377..f8e499a 100644 --- a/openapi/paths/oauth2_register.yaml +++ b/openapi/paths/oauth2_register.yaml @@ -39,6 +39,7 @@ post: - menu:write - orders:read - orders:write + - revenue:read grantTypes: - client_credentials responses: diff --git a/openapi/paths/revenue.yaml b/openapi/paths/revenue.yaml index cc5d312..783f957 100644 --- a/openapi/paths/revenue.yaml +++ b/openapi/paths/revenue.yaml @@ -8,6 +8,8 @@ get: operationId: getRevenue security: - ApiKey: [] + - OAuth2: + - revenue:read parameters: - name: startDate in: query