From 390120abb7c82ae6111c21a86ebc3d1b97189403 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 10 Jan 2024 19:32:11 +0530 Subject: [PATCH 01/33] Add initial api_spec --- api_spec.yaml | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/api_spec.yaml b/api_spec.yaml index 99b78736..23ce3550 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1231,6 +1231,166 @@ paths: type: array items: type: string + /dashboard/api/tenants/list-with-user-count: + get: + tags: + - Multitenancy + summary: Get all tenants created in the core with the number of users for each tenant + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + status: + type: string + default: "OK" + tenants: + type: array + items: + type: object + properties: + tenantId: + type: string + userCount: + type: number + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access + /dashboard/api/tenant: + get: + tags: + - Multitenancy + summary: Get tenant info from the core + parameters: + - name: tenantId + in: query + required: true + schema: + type: string + example: "tenant1" + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + coreConfig: + type: object + tenants: + type: array + items: + type: object + properties: + tenantId: + type: string + emailPassword: + type: object + properties: + enabled: + type: boolean + passwordless: + type: object + properties: + enabled: + type: boolean + thirdParty: + type: object + properties: + enabled: + type: boolean + providers: + type: array + items: + type: object + properties: + name: + type: string + id: + type: string + coreConfig: + type: object + - type: object + properties: + status: + type: string + default: "UNKNOWN_TENANT_ERROR" + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access + delete: + tags: + - Multitenancy + summary: Delete the tenant + parameters: + - name: tenantId + in: query + required: true + schema: + type: string + example: "tenant1" + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + - type: object + properties: + status: + type: string + default: "UNKNOWN_TENANT_ERROR" + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/list: get: tags: From 903c9c552e85c78099c8bcdda8cd4ce26f66268e Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 11 Jan 2024 11:59:00 +0530 Subject: [PATCH 02/33] Fix get tenant spec --- api_spec.yaml | 78 ++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 23ce3550..016755d2 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1298,49 +1298,45 @@ paths: oneOf: - type: object properties: - status: - type: string - default: "OK" - coreConfig: - type: object - tenants: - type: array - items: - type: object - properties: - tenantId: - type: string - emailPassword: - type: object - properties: - enabled: - type: boolean - passwordless: - type: object - properties: - enabled: - type: boolean - thirdParty: - type: object - properties: - enabled: - type: boolean - providers: - type: array - items: - type: object - properties: - name: - type: string - id: - type: string - coreConfig: - type: object + status: + type: string + default: "OK" + tenant: + type: object + properties: + id: + type: string + emailPassword: + type: object + properties: + enabled: + type: boolean + passwordless: + type: object + properties: + enabled: + type: boolean + thirdParty: + type: object + properties: + enabled: + type: boolean + providers: + type: array + items: + type: object + properties: + name: + type: string + id: + type: string + coreConfig: + type: object - type: object properties: - status: - type: string - default: "UNKNOWN_TENANT_ERROR" + status: + type: string + default: "UNKNOWN_TENANT_ERROR" 401: description: Unauthorised access content: From ff22620074b92aa2494e8b47077d3b96f496c7c2 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 11 Jan 2024 19:02:55 +0530 Subject: [PATCH 03/33] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2fa4db5..eb7eaf98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant + ## [0.10.1] - 2024-01-09 - Fixed access denied modals zIndex value. From 54b87730e6273c5c7e065b9f2ab4f136e9cb3183 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Mon, 15 Jan 2024 13:25:43 +0530 Subject: [PATCH 04/33] Add create or update tenant API spec --- api_spec.yaml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/api_spec.yaml b/api_spec.yaml index 016755d2..0f2bb3ef 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1387,6 +1387,55 @@ paths: type: string enum: - Unauthorised access + post: + tags: + - Multitenancy + summary: Create or update a tenant + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + requestBody: + content: + application/json: + schema: + type: object + properties: + tenantId: + type: string + emailPasswordEnabled: + type: boolean + passwordlessEnabled: + type: boolean + thirdPartyEnabled: + type: boolean + coreConfig: + type: object + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/list: get: tags: From 3f07dc09f4842de846eb792454f7d42bb9f62330 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Mon, 15 Jan 2024 13:27:21 +0530 Subject: [PATCH 05/33] Update Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7eaf98..3cebb57c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] -- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant +- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant and creating or updating a tenant ## [0.10.1] - 2024-01-09 From 77639a82aa373700c48d546364c204fdd99ebdba Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Mon, 15 Jan 2024 19:40:20 +0530 Subject: [PATCH 06/33] Add associate and disassociate tenant APIs to the spec --- api_spec.yaml | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/api_spec.yaml b/api_spec.yaml index 0f2bb3ef..78852466 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1477,6 +1477,125 @@ paths: properties: enabled: type: boolean + /dashboard/api/tenants/user/associate: + put: + tags: + - Multitenancy + summary: Associate a user to a tenant + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + requestBody: + content: + application/json: + schema: + type: object + properties: + tenantId: + type: string + userId: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + wasAlreadyAssociated: + type: boolean + default: false + + - type: object + properties: + status: + type: string + default: "UNKNOWN_USER_ID_ERROR" + - type: object + properties: + status: + type: string + default: "EMAIL_ALREADY_EXISTS_ERROR" + - type: object + properties: + status: + type: string + default: "PHONE_NUMBER_ALREADY_EXISTS_ERROR" + - type: object + properties: + status: + type: string + default: "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" + - type: object + properties: + status: + type: string + default: "ASSOCIATION_NOT_ALLOWED_ERROR" + reason: + type: string + + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access + /dashboard/api/tenants/user/disassociate: + put: + tags: + - Multitenancy + summary: Disassociate a user from a tenant + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + requestBody: + content: + application/json: + schema: + type: object + properties: + tenantId: + type: string + userId: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + status: + type: string + default: "OK" + wasAssociated: + type: boolean + default: true + + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: From 2ad9c13d9409a7ddc9a871924e0ee4dd95e4a55b Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 16 Jan 2024 11:37:51 +0530 Subject: [PATCH 07/33] Update Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cebb57c..eb5cc704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] -- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant and creating or updating a tenant +- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant, creating or updating a tenant and associating or dissociating users with a tenant. ## [0.10.1] - 2024-01-09 From 07fc107e7ca936b123923cb73ac1a41167350e0b Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 16 Jan 2024 15:07:53 +0530 Subject: [PATCH 08/33] Add all details for providers --- api_spec.yaml | 121 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 49 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 78852466..8afe1b11 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1231,46 +1231,6 @@ paths: type: array items: type: string - /dashboard/api/tenants/list-with-user-count: - get: - tags: - - Multitenancy - summary: Get all tenants created in the core with the number of users for each tenant - parameters: - - name: authorization - in: header - required: true - schema: - type: string - example: "Bearer API_KEY" - responses: - 200: - description: Success - content: - application/json: - schema: - type: object - properties: - status: - type: string - default: "OK" - tenants: - type: array - items: - type: object - properties: - tenantId: - type: string - userCount: - type: number - 401: - description: Unauthorised access - content: - text/plain: - schema: - type: string - enum: - - Unauthorised access /dashboard/api/tenant: get: tags: @@ -1328,8 +1288,50 @@ paths: properties: name: type: string - id: + thirdPartyId: + type: string + authorisationEndpoint: + type: string + authorizationEndpointQueryParams: + type: object + tokenEndpoint: + type: string + tokenEndpointBodyParams: + type: object + userInfoEndpoint: + type: string + userInfoEndpointQueryParams: + type: object + userInfoEndpointHeaders: + type: object + jwksURI: type: string + oidcDiscoveryEndpoint: + type: string + userInfoMap: + type: object + requireEmail: + type: boolean + clients: + type: array + items: + type: object + properties: + clientType: + type: string + clientId: + type: string + clientSecret: + type: string + scope: + type: array + items: + type: string + forcePKCE: + type: boolean + additionalConfig: + type: object + coreConfig: type: object - type: object @@ -1420,13 +1422,19 @@ paths: content: application/json: schema: - type: object - properties: - status: - type: string - default: "OK" - createdNew: - type: boolean + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + - type: object + properties: + status: + type: string + default: "INVALID_TENANT_ID" 401: description: Unauthorised access @@ -1441,6 +1449,19 @@ paths: tags: - Multitenancy summary: Get all tenants created in the core + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + - name: withUserCount + in: query + required: false + schema: + type: boolean + default: false responses: 200: description: Success @@ -1471,12 +1492,14 @@ paths: properties: enabled: type: boolean - thirdParty: type: object properties: enabled: type: boolean + usersCount: + type: number + example: 1000 /dashboard/api/tenants/user/associate: put: tags: From 2b601228dc01e9ac2e95952cc98bdf9ebd369b69 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 16 Jan 2024 16:03:38 +0530 Subject: [PATCH 09/33] Add third party APIs --- api_spec.yaml | 162 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 151 insertions(+), 11 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 8afe1b11..fbb6b427 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1370,17 +1370,11 @@ paths: content: application/json: schema: - oneOf: - - type: object - properties: - status: - type: string - default: "OK" - - type: object - properties: - status: - type: string - default: "UNKNOWN_TENANT_ERROR" + type: object + properties: + status: + type: string + default: "OK" 401: description: Unauthorised access content: @@ -1619,11 +1613,157 @@ paths: type: string enum: - Unauthorised access + /dashboard/api/tenants/third-party: + post: + tags: + - Multitenancy + summary: Create or update third party config for a tenant + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + requestBody: + content: + application/json: + schema: + type: object + properties: + tenantId: + type: string + providerConfig: + type: object + properties: + name: + type: string + thirdPartyId: + type: string + authorisationEndpoint: + type: string + authorizationEndpointQueryParams: + type: object + tokenEndpoint: + type: string + tokenEndpointBodyParams: + type: object + userInfoEndpoint: + type: string + userInfoEndpointQueryParams: + type: object + userInfoEndpointHeaders: + type: object + jwksURI: + type: string + oidcDiscoveryEndpoint: + type: string + userInfoMap: + type: object + requireEmail: + type: boolean + clients: + type: array + items: + type: object + properties: + clientType: + type: string + clientId: + type: string + clientSecret: + type: string + scope: + type: array + items: + type: string + forcePKCE: + type: boolean + additionalConfig: + type: object + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + default: true + - type: object + properties: + status: + type: string + default: "INVALID_PROVIDER_CONFIG" + + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access + delete: + tags: + - Multitenancy + summary: Delete thirdParty config for a tenant + parameters: + - name: tenantId + in: query + required: true + schema: + type: string + example: "tenant1" + - name: thirdPartyId + in: query + required: true + schema: + type: string + example: "google" + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + status: + type: string + default: "OK" + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: - Multitenancy summary: Get all tenants and available login methods. + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" responses: 200: description: Success From d958705960f1e3d813d2a60a3d9ae31d8da8c69d Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 16 Jan 2024 16:26:10 +0530 Subject: [PATCH 10/33] Added API spec --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb5cc704..de9b963d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] -- Added API spec for certain multitenancy APIs which include getting all tenants with their user counts, getting all the info for a particular tenant and deleting a tenant, creating or updating a tenant and associating or dissociating users with a tenant. +- Added API spec for Multitenancy dashboard ## [0.10.1] - 2024-01-09 From 480516f2306d625311e2953d86f54b90e09aeed2 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 17 Jan 2024 16:52:23 +0530 Subject: [PATCH 11/33] Add API spec for SAML with boxy and address reviews --- api_spec.yaml | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index fbb6b427..659a5c8a 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1331,6 +1331,10 @@ paths: type: boolean additionalConfig: type: object + required: + - clientId + required: + - thirdPartyId coreConfig: type: object @@ -1450,7 +1454,7 @@ paths: schema: type: string example: "Bearer API_KEY" - - name: withUserCount + - name: includeUserCount in: query required: false schema: @@ -1681,6 +1685,10 @@ paths: type: boolean additionalConfig: type: object + required: + - clientId + required: + - thirdPartyId responses: 200: description: Success @@ -1752,6 +1760,81 @@ paths: type: string enum: - Unauthorised access + /dashboard/api/tenants/third-party/boxy-saml: + put: + tags: + - Multitenancy + summary: Create or update third party config for a tenant with BoxyHQ + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + requestBody: + content: + application/json: + schema: + type: object + properties: + thirdPartyIdSuffix: + type: string + boxyUrl: + type: string + boxyApiKey: + type: string + encodedRawMetadata: + type: string + redirectUrl: + type: string + tenantId: + type: string + product: + type: string + name: + type: string + description: + type: string + required: + - boxyUrl + - boxyApiKey + - encodedRawMetadata + - redirectUrl + - tenantId + - product + - name + - description + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + default: true + - type: object + properties: + status: + type: string + default: "INVALID_CONFIG" + reason: + type: string + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: From 0eb11911762018ee0011755ff8a11a007847ad08 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 17 Jan 2024 19:02:36 +0530 Subject: [PATCH 12/33] Review updates for the SAML API --- api_spec.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 659a5c8a..f4ce05e6 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1760,11 +1760,11 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/tenants/third-party/boxy-saml: + /dashboard/api/tenants/third-party/boxy-saml/clients-with-saml-metadata: put: tags: - Multitenancy - summary: Create or update third party config for a tenant with BoxyHQ + summary: Create or update client of Boxy SAML provider using SAML XML. parameters: - name: authorization in: header @@ -1773,6 +1773,7 @@ paths: type: string example: "Bearer API_KEY" requestBody: + description: Learn more about the options and how it works [here](https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/saml/with-boxyhq/flow-diagram). content: application/json: schema: @@ -1780,13 +1781,20 @@ paths: properties: thirdPartyIdSuffix: type: string - boxyUrl: + description: Optional suffix for the thirdPartyId + boxyURL: type: string - boxyApiKey: + description: Base URL of the SAML Jackson server + boxyAPIKey: type: string + description: API key of the SAML Jackson server encodedRawMetadata: type: string - redirectUrl: + description: Base64 encoded XML metadata file. Not required if samlMetadataURL is provided. + samlMetadataURL: + type: string + description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. + redirectURL: type: string tenantId: type: string @@ -1799,7 +1807,6 @@ paths: required: - boxyUrl - boxyApiKey - - encodedRawMetadata - redirectUrl - tenantId - product From d72b508d3e86d575658e64efbe3d9b715da82e93 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 17 Jan 2024 19:07:47 +0530 Subject: [PATCH 13/33] Update link --- api_spec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index f4ce05e6..749032dc 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1773,7 +1773,7 @@ paths: type: string example: "Bearer API_KEY" requestBody: - description: Learn more about the options and how it works [here](https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/saml/with-boxyhq/flow-diagram). + description: Learn more about the options and how it works [here](https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/saml/with-boxyhq/integration-steps). content: application/json: schema: @@ -1790,8 +1790,8 @@ paths: description: API key of the SAML Jackson server encodedRawMetadata: type: string - description: Base64 encoded XML metadata file. Not required if samlMetadataURL is provided. - samlMetadataURL: + description: Base64 encoded XML metadata file. Not required if metadataURL is provided. + metadataURL: type: string description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. redirectURL: From 89aaa5a8c98e0e43133f830ff9897e84eb97d447 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 18 Jan 2024 11:56:21 +0530 Subject: [PATCH 14/33] Update boxy API spec --- api_spec.yaml | 96 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 749032dc..e8724192 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1777,41 +1777,67 @@ paths: content: application/json: schema: - type: object - properties: - thirdPartyIdSuffix: - type: string - description: Optional suffix for the thirdPartyId - boxyURL: - type: string - description: Base URL of the SAML Jackson server - boxyAPIKey: - type: string - description: API key of the SAML Jackson server - encodedRawMetadata: - type: string - description: Base64 encoded XML metadata file. Not required if metadataURL is provided. - metadataURL: - type: string - description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. - redirectURL: - type: string - tenantId: - type: string - product: - type: string - name: - type: string - description: - type: string - required: - - boxyUrl - - boxyApiKey - - redirectUrl - - tenantId - - product - - name - - description + oneOf: + - type: object + properties: + thirdPartyIdSuffix: + type: string + description: Optional suffix for the thirdPartyId + boxyURL: + type: string + description: Base URL of the SAML Jackson server + boxyAPIKey: + type: string + description: API key of the SAML Jackson server + base64EncodedSAMLMetadata: + type: string + description: Base64 encoded XML metadata file. Not required if metadataURL is provided. + tenantId: + type: string + product: + type: string + name: + type: string + description: + type: string + required: + - boxyURL + - boxyAPIKey + - base64EncodedSAMLMetadata + - tenantId + - product + - name + - description + - type: object + properties: + thirdPartyIdSuffix: + type: string + description: Optional suffix for the thirdPartyId + boxyURL: + type: string + description: Base URL of the SAML Jackson server + boxyAPIKey: + type: string + description: API key of the SAML Jackson server + SAMLMetadataURL: + type: string + description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. + tenantId: + type: string + product: + type: string + name: + type: string + description: + type: string + required: + - boxyURL + - boxyAPIKey + - SAMLMetadataURL + - tenantId + - product + - name + - description responses: 200: description: Success From 7532d8ce7e5386bf962e7f94ff720337f64ddee5 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 18 Jan 2024 15:19:42 +0530 Subject: [PATCH 15/33] Minor updates for consistency --- api_spec.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index e8724192..538d54fb 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1264,7 +1264,7 @@ paths: tenant: type: object properties: - id: + tenantId: type: string emailPassword: type: object @@ -1379,6 +1379,9 @@ paths: status: type: string default: "OK" + didExist: + type: boolean + default: true 401: description: Unauthorised access content: From ce66e712d179f47543afc43a8adb83a4379aee16 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 18 Jan 2024 16:05:56 +0530 Subject: [PATCH 16/33] Create common config and extend from that --- api_spec.yaml | 106 +++++++++++++++++++++----------------------------- 1 file changed, 45 insertions(+), 61 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 538d54fb..44360921 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1781,66 +1781,24 @@ paths: application/json: schema: oneOf: - - type: object - properties: - thirdPartyIdSuffix: - type: string - description: Optional suffix for the thirdPartyId - boxyURL: - type: string - description: Base URL of the SAML Jackson server - boxyAPIKey: - type: string - description: API key of the SAML Jackson server - base64EncodedSAMLMetadata: - type: string - description: Base64 encoded XML metadata file. Not required if metadataURL is provided. - tenantId: - type: string - product: - type: string - name: - type: string - description: - type: string - required: - - boxyURL - - boxyAPIKey - - base64EncodedSAMLMetadata - - tenantId - - product - - name - - description - - type: object - properties: - thirdPartyIdSuffix: - type: string - description: Optional suffix for the thirdPartyId - boxyURL: - type: string - description: Base URL of the SAML Jackson server - boxyAPIKey: - type: string - description: API key of the SAML Jackson server - SAMLMetadataURL: - type: string - description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. - tenantId: - type: string - product: - type: string - name: - type: string - description: - type: string - required: - - boxyURL - - boxyAPIKey - - SAMLMetadataURL - - tenantId - - product - - name - - description + - allOf: + - $ref: "#/components/schemas/boxySAMLBaseConfig" + - type: object + properties: + base64EncodedSAMLMetadata: + type: string + description: Base64 encoded XML metadata file. Not required if metadataURL is provided. + required: + - base64EncodedSAMLMetadata + - allOf: + - $ref: "#/components/schemas/boxySAMLBaseConfig" + - type: object + properties: + SAMLMetadataURL: + type: string + description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. + required: + - SAMLMetadataURL responses: 200: description: Success @@ -2544,7 +2502,33 @@ components: tenantId: type: string example: "customer1" - + boxySAMLBaseConfig: + type: object + properties: + thirdPartyIdSuffix: + type: string + description: Optional suffix for the thirdPartyId + boxyURL: + type: string + description: Base URL of the SAML Jackson server + boxyAPIKey: + type: string + description: API key of the SAML Jackson server + tenantId: + type: string + product: + type: string + name: + type: string + description: + type: string + required: + - boxyURL + - boxyAPIKey + - tenantId + - product + - name + - description servers: # Added by API Auto Mocking Plugin - description: SwaggerHub API Auto Mocking From 15632a7243a4e5c27df5296e19ca6300f7e36dc0 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 18 Jan 2024 16:44:13 +0530 Subject: [PATCH 17/33] Add didConfigExist to delete thirdPartyConfig API --- api_spec.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api_spec.yaml b/api_spec.yaml index 44360921..f576c448 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1755,6 +1755,9 @@ paths: status: type: string default: "OK" + didConfigExist: + type: boolean + default: true 401: description: Unauthorised access content: From 6bc3cf01fa9e7895c170649095a71d3cc47ea321 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 23 Jan 2024 15:16:33 +0530 Subject: [PATCH 18/33] Add core config list API --- api_spec.yaml | 115 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 105 insertions(+), 10 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index f576c448..27980f58 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1335,7 +1335,19 @@ paths: - clientId required: - thirdPartyId - + firstFactors: + type: array + items: + type: string + example: + - "emailpassword" + - "thirdparty" + requiredSecondaryFactors: + type: array + items: + type: string + example: + - "otp-email" coreConfig: type: object - type: object @@ -1417,6 +1429,21 @@ paths: type: boolean coreConfig: type: object + firstFactors: + type: array + items: + type: string + example: + - "emailpassword" + - "thirdparty" + requiredSecondaryFactors: + type: array + items: + type: string + example: + - "otp-email" + required: + - tenantId responses: 200: description: Success @@ -1457,12 +1484,6 @@ paths: schema: type: string example: "Bearer API_KEY" - - name: includeUserCount - in: query - required: false - schema: - type: boolean - default: false responses: 200: description: Success @@ -1498,9 +1519,6 @@ paths: properties: enabled: type: boolean - usersCount: - type: number - example: 1000 /dashboard/api/tenants/user/associate: put: tags: @@ -1832,6 +1850,60 @@ paths: type: string enum: - Unauthorised access + /dashboard/api/tenants/core-config/list: + get: + tags: + - Multitenancy + summary: Gets all the possible core config options. + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + items: + oneOf: + - allOf: + - $ref: "#/components/schemas/coreConfigType" + - type: object + properties: + type: + type: string + enum: + - string + - boolean + - number + description: Data type of the property + - allOf: + - $ref: "#/components/schemas/coreConfigType" + - type: object + properties: + type: + type: string + enum: + - enum + description: Data type of the property + options: + type: array + items: + type: string + description: List of possible values for the property in case it is of enum type + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: @@ -2532,6 +2604,29 @@ components: - product - name - description + coreConfigType: + type: object + properties: + name: + type: string + description: Name of the property + defaultValue: + oneOf: + - type: string + - type: boolean + - type: number + nullable: true + description: Default value of the property + description: + type: string + description: Description of the property + differentAcrossTenants: + type: boolean + description: True if the property is different across tenants + isNullable: + type: boolean + description: True if the property is nullable + servers: # Added by API Auto Mocking Plugin - description: SwaggerHub API Auto Mocking From 53e028985d9d73f4e7491f9b366703b5bcc89f2d Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 23 Jan 2024 16:02:27 +0530 Subject: [PATCH 19/33] Add API to list built in factors and create a common schema for third party config --- api_spec.yaml | 187 +++++++++++++++++++++++--------------------------- 1 file changed, 85 insertions(+), 102 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 27980f58..d7adfccf 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1284,57 +1284,7 @@ paths: providers: type: array items: - type: object - properties: - name: - type: string - thirdPartyId: - type: string - authorisationEndpoint: - type: string - authorizationEndpointQueryParams: - type: object - tokenEndpoint: - type: string - tokenEndpointBodyParams: - type: object - userInfoEndpoint: - type: string - userInfoEndpointQueryParams: - type: object - userInfoEndpointHeaders: - type: object - jwksURI: - type: string - oidcDiscoveryEndpoint: - type: string - userInfoMap: - type: object - requireEmail: - type: boolean - clients: - type: array - items: - type: object - properties: - clientType: - type: string - clientId: - type: string - clientSecret: - type: string - scope: - type: array - items: - type: string - forcePKCE: - type: boolean - additionalConfig: - type: object - required: - - clientId - required: - - thirdPartyId + $ref: "#/components/schemas/thirdPartyProvider" firstFactors: type: array items: @@ -1350,6 +1300,8 @@ paths: - "otp-email" coreConfig: type: object + usersCount: + type: number - type: object properties: status: @@ -1659,57 +1611,7 @@ paths: tenantId: type: string providerConfig: - type: object - properties: - name: - type: string - thirdPartyId: - type: string - authorisationEndpoint: - type: string - authorizationEndpointQueryParams: - type: object - tokenEndpoint: - type: string - tokenEndpointBodyParams: - type: object - userInfoEndpoint: - type: string - userInfoEndpointQueryParams: - type: object - userInfoEndpointHeaders: - type: object - jwksURI: - type: string - oidcDiscoveryEndpoint: - type: string - userInfoMap: - type: object - requireEmail: - type: boolean - clients: - type: array - items: - type: object - properties: - clientType: - type: string - clientId: - type: string - clientSecret: - type: string - scope: - type: array - items: - type: string - forcePKCE: - type: boolean - additionalConfig: - type: object - required: - - clientId - required: - - thirdPartyId + $ref: "#/components/schemas/thirdPartyProvider" responses: 200: description: Success @@ -1904,6 +1806,35 @@ paths: type: string enum: - Unauthorised access + /dashboard/api/tenants/built-in-factors/list: + get: + tags: + - Multitenancy + summary: Gets the list of built-in factors that can be used for firstFactor and requiredSecondaryFactors. + parameters: + - name: authorization + in: header + required: true + schema: + type: string + example: "Bearer API_KEY" + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + items: + type: string + 401: + description: Unauthorised access + content: + text/plain: + schema: + type: string + enum: + - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: @@ -2577,6 +2508,58 @@ components: tenantId: type: string example: "customer1" + thirdPartyProvider: + type: object + properties: + name: + type: string + thirdPartyId: + type: string + authorisationEndpoint: + type: string + authorizationEndpointQueryParams: + type: object + tokenEndpoint: + type: string + tokenEndpointBodyParams: + type: object + userInfoEndpoint: + type: string + userInfoEndpointQueryParams: + type: object + userInfoEndpointHeaders: + type: object + jwksURI: + type: string + oidcDiscoveryEndpoint: + type: string + userInfoMap: + type: object + requireEmail: + type: boolean + clients: + type: array + items: + type: object + properties: + clientType: + type: string + clientId: + type: string + clientSecret: + type: string + scope: + type: array + items: + type: string + forcePKCE: + type: boolean + additionalConfig: + type: object + required: + - clientId + required: + - thirdPartyId boxySAMLBaseConfig: type: object properties: From 57607427b5ce37095d5be8e81b4c6a2ca8e1568c Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 25 Jan 2024 12:39:12 +0530 Subject: [PATCH 20/33] Minor type changes --- api_spec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index d7adfccf..4b923846 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1752,7 +1752,7 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/tenants/core-config/list: + /dashboard/api/multitenancy/core-config/list: get: tags: - Multitenancy @@ -1806,7 +1806,7 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/tenants/built-in-factors/list: + /dashboard/api/mfa/built-in-factors/list: get: tags: - Multitenancy From b864ad131b4130786aa8ec786982b44ae6b3e847 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 25 Jan 2024 19:35:27 +0530 Subject: [PATCH 21/33] Minor updates to the API spec --- api_spec.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index 4b923846..6de561ac 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1300,7 +1300,7 @@ paths: - "otp-email" coreConfig: type: object - usersCount: + userCount: type: number - type: object properties: @@ -1415,6 +1415,15 @@ paths: status: type: string default: "INVALID_TENANT_ID" + message: + type: string + - type: object + properties: + status: + type: string + default: "UNKNOWN_TENANT_ERROR" + message: + type: string 401: description: Unauthorised access @@ -1632,6 +1641,8 @@ paths: status: type: string default: "INVALID_PROVIDER_CONFIG" + message: + type: string 401: description: Unauthorised access @@ -2572,6 +2583,9 @@ components: boxyAPIKey: type: string description: API key of the SAML Jackson server + redirectURI: + type: string + description: The URL to redirect to after completing the login flow tenantId: type: string product: @@ -2580,6 +2594,8 @@ components: type: string description: type: string + clientType: + type: string required: - boxyURL - boxyAPIKey From 672c424439409fbbe4a335fe287ff0025cacfc6d Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 25 Jan 2024 19:40:12 +0530 Subject: [PATCH 22/33] Mark redirectURI as required --- api_spec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/api_spec.yaml b/api_spec.yaml index 6de561ac..14cd221b 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -2603,6 +2603,7 @@ components: - product - name - description + - redirectURI coreConfigType: type: object properties: From dcae70a67f7e39c26f116bc4b83bca96f956df94 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Fri, 26 Jan 2024 16:41:55 +0530 Subject: [PATCH 23/33] Update different across tenants description --- api_spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index 14cd221b..16ed4711 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -2622,7 +2622,7 @@ components: description: Description of the property differentAcrossTenants: type: boolean - description: True if the property is different across tenants + description: True if the property can be set different values per tenant isNullable: type: boolean description: True if the property is nullable From 11683b7861fdc3ff0991be22350fd32155a04050 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Mon, 29 Jan 2024 12:23:25 +0530 Subject: [PATCH 24/33] Remove unused errors --- CHANGELOG.md | 1 - api_spec.yaml | 58 +++++++++++++++------------------------------------ 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49651396..9703da7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix typo on user roles section on user details page. - ## [0.10.1] - 2024-01-09 - Fixed access denied modals zIndex value. diff --git a/api_spec.yaml b/api_spec.yaml index 16ed4711..b7870062 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1354,7 +1354,7 @@ paths: type: string enum: - Unauthorised access - post: + put: tags: - Multitenancy summary: Create or update a tenant @@ -1402,28 +1402,13 @@ paths: content: application/json: schema: - oneOf: - - type: object - properties: - status: - type: string - default: "OK" - createdNew: - type: boolean - - type: object - properties: - status: - type: string - default: "INVALID_TENANT_ID" - message: - type: string - - type: object - properties: - status: - type: string - default: "UNKNOWN_TENANT_ERROR" - message: - type: string + type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean 401: description: Unauthorised access @@ -1600,7 +1585,7 @@ paths: enum: - Unauthorised access /dashboard/api/tenants/third-party: - post: + put: tags: - Multitenancy summary: Create or update third party config for a tenant @@ -1627,23 +1612,14 @@ paths: content: application/json: schema: - oneOf: - - type: object - properties: - status: - type: string - default: "OK" - createdNew: - type: boolean - default: true - - type: object - properties: - status: - type: string - default: "INVALID_PROVIDER_CONFIG" - message: - type: string - + type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + default: true 401: description: Unauthorised access content: From 638bfd68d8adf980d71879c0d4ad2913a2f65fd9 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Mon, 29 Jan 2024 16:31:21 +0530 Subject: [PATCH 25/33] Remove boxy API from the spec --- api_spec.yaml | 99 --------------------------------------------------- 1 file changed, 99 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index b7870062..b8da7915 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1673,72 +1673,6 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/tenants/third-party/boxy-saml/clients-with-saml-metadata: - put: - tags: - - Multitenancy - summary: Create or update client of Boxy SAML provider using SAML XML. - parameters: - - name: authorization - in: header - required: true - schema: - type: string - example: "Bearer API_KEY" - requestBody: - description: Learn more about the options and how it works [here](https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/saml/with-boxyhq/integration-steps). - content: - application/json: - schema: - oneOf: - - allOf: - - $ref: "#/components/schemas/boxySAMLBaseConfig" - - type: object - properties: - base64EncodedSAMLMetadata: - type: string - description: Base64 encoded XML metadata file. Not required if metadataURL is provided. - required: - - base64EncodedSAMLMetadata - - allOf: - - $ref: "#/components/schemas/boxySAMLBaseConfig" - - type: object - properties: - SAMLMetadataURL: - type: string - description: URL of the XML metadata file. Not required if encodedRawMetadata is provided. - required: - - SAMLMetadataURL - responses: - 200: - description: Success - content: - application/json: - schema: - oneOf: - - type: object - properties: - status: - type: string - default: "OK" - createdNew: - type: boolean - default: true - - type: object - properties: - status: - type: string - default: "INVALID_CONFIG" - reason: - type: string - 401: - description: Unauthorised access - content: - text/plain: - schema: - type: string - enum: - - Unauthorised access /dashboard/api/multitenancy/core-config/list: get: tags: @@ -2547,39 +2481,6 @@ components: - clientId required: - thirdPartyId - boxySAMLBaseConfig: - type: object - properties: - thirdPartyIdSuffix: - type: string - description: Optional suffix for the thirdPartyId - boxyURL: - type: string - description: Base URL of the SAML Jackson server - boxyAPIKey: - type: string - description: API key of the SAML Jackson server - redirectURI: - type: string - description: The URL to redirect to after completing the login flow - tenantId: - type: string - product: - type: string - name: - type: string - description: - type: string - clientType: - type: string - required: - - boxyURL - - boxyAPIKey - - tenantId - - product - - name - - description - - redirectURI coreConfigType: type: object properties: From f9f0c8bf4481accd46c3797b954791a134d40a7f Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 29 Feb 2024 00:30:59 +0530 Subject: [PATCH 26/33] Update the spec to match the API --- api_spec.yaml | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index b8da7915..1275fa5d 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1727,35 +1727,6 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/mfa/built-in-factors/list: - get: - tags: - - Multitenancy - summary: Gets the list of built-in factors that can be used for firstFactor and requiredSecondaryFactors. - parameters: - - name: authorization - in: header - required: true - schema: - type: string - example: "Bearer API_KEY" - responses: - 200: - description: Success - content: - application/json: - schema: - type: array - items: - type: string - 401: - description: Unauthorised access - content: - text/plain: - schema: - type: string - enum: - - Unauthorised access /dashboard/api/tenants/login-methods: get: tags: @@ -2487,22 +2458,12 @@ components: name: type: string description: Name of the property - defaultValue: - oneOf: - - type: string - - type: boolean - - type: number - nullable: true - description: Default value of the property description: type: string description: Description of the property differentAcrossTenants: type: boolean description: True if the property can be set different values per tenant - isNullable: - type: boolean - description: True if the property is nullable servers: # Added by API Auto Mocking Plugin From 997c85476815abe272f72af9c211a4fea24d9ae4 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Thu, 29 Feb 2024 01:25:45 +0530 Subject: [PATCH 27/33] Fix typo in core config list API --- api_spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index 1275fa5d..190eb095 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -2461,7 +2461,7 @@ components: description: type: string description: Description of the property - differentAcrossTenants: + isDifferentAcrossTenants: type: boolean description: True if the property can be set different values per tenant From 367b0ee453011a3d7380612e8875d9f8fd4f1185 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 13 Mar 2024 18:44:17 +0530 Subject: [PATCH 28/33] Update core config API spec --- api_spec.yaml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index 190eb095..bac01e88 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1302,6 +1302,18 @@ paths: type: object userCount: type: number + validFirstFactors: + type: array + items: + type: string + example: + - "emailpassword" + - "thirdparty" + description: The first factors that the tenant can use based on the recipes initialized and login methods enabled + mergedProvidersFromCoreAndStatic: + type: array + items: + $ref: "#/components/schemas/thirdPartyProvider" - type: object properties: status: @@ -2458,12 +2470,24 @@ components: name: type: string description: Name of the property + value: + oneOf: + - type: string + - type: boolean + - type: number + description: Value of the property description: type: string description: Description of the property - isDifferentAcrossTenants: + isConfigYamlOnly: type: boolean description: True if the property can be set different values per tenant + isNotConflictingInApp: + type: boolean + description: True if the property can be set different values per app + isSaasProtected: + type: boolean + description: True if the property protected and cannot be set because the user is using SuperTokens SaaS servers: # Added by API Auto Mocking Plugin From 6f9cef1698c899aade5d6c6070f3439adb18532c Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 19 Mar 2024 14:02:02 +0530 Subject: [PATCH 29/33] Review fixes for API spec --- api_spec.yaml | 212 ++++++++++++++------------------------------------ 1 file changed, 59 insertions(+), 153 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index bac01e88..0116c733 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -23,6 +23,8 @@ tags: description: APIs related to multitenancy - name: "User Roles and Permissions" description: APIs related to user roles and permisssions + - name: Miscellaneous + description: Miscellaneous APIs paths: /dashboard/api/signin: @@ -1285,6 +1287,10 @@ paths: type: array items: $ref: "#/components/schemas/thirdPartyProvider" + mergedProvidersFromCoreAndStatic: + type: array + items: + $ref: "#/components/schemas/thirdPartyProvider" firstFactors: type: array items: @@ -1310,15 +1316,17 @@ paths: - "emailpassword" - "thirdparty" description: The first factors that the tenant can use based on the recipes initialized and login methods enabled - mergedProvidersFromCoreAndStatic: - type: array - items: - $ref: "#/components/schemas/thirdPartyProvider" + required: + - status + - tenant + - type: object properties: status: type: string default: "UNKNOWN_TENANT_ERROR" + required: + - status 401: description: Unauthorised access content: @@ -1358,6 +1366,8 @@ paths: didExist: type: boolean default: true + required: + - status 401: description: Unauthorised access content: @@ -1421,6 +1431,8 @@ paths: default: "OK" createdNew: type: boolean + required: + - status 401: description: Unauthorised access @@ -1477,125 +1489,6 @@ paths: properties: enabled: type: boolean - /dashboard/api/tenants/user/associate: - put: - tags: - - Multitenancy - summary: Associate a user to a tenant - parameters: - - name: authorization - in: header - required: true - schema: - type: string - example: "Bearer API_KEY" - requestBody: - content: - application/json: - schema: - type: object - properties: - tenantId: - type: string - userId: - type: string - responses: - 200: - description: Success - content: - application/json: - schema: - oneOf: - - type: object - properties: - status: - type: string - default: "OK" - wasAlreadyAssociated: - type: boolean - default: false - - - type: object - properties: - status: - type: string - default: "UNKNOWN_USER_ID_ERROR" - - type: object - properties: - status: - type: string - default: "EMAIL_ALREADY_EXISTS_ERROR" - - type: object - properties: - status: - type: string - default: "PHONE_NUMBER_ALREADY_EXISTS_ERROR" - - type: object - properties: - status: - type: string - default: "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" - - type: object - properties: - status: - type: string - default: "ASSOCIATION_NOT_ALLOWED_ERROR" - reason: - type: string - - 401: - description: Unauthorised access - content: - text/plain: - schema: - type: string - enum: - - Unauthorised access - /dashboard/api/tenants/user/disassociate: - put: - tags: - - Multitenancy - summary: Disassociate a user from a tenant - parameters: - - name: authorization - in: header - required: true - schema: - type: string - example: "Bearer API_KEY" - requestBody: - content: - application/json: - schema: - type: object - properties: - tenantId: - type: string - userId: - type: string - responses: - 200: - description: Success - content: - application/json: - schema: - type: object - properties: - status: - type: string - default: "OK" - wasAssociated: - type: boolean - default: true - - 401: - description: Unauthorised access - content: - text/plain: - schema: - type: string - enum: - - Unauthorised access /dashboard/api/tenants/third-party: put: tags: @@ -1632,6 +1525,8 @@ paths: createdNew: type: boolean default: true + required: + - status 401: description: Unauthorised access content: @@ -1677,6 +1572,8 @@ paths: didConfigExist: type: boolean default: true + required: + - status 401: description: Unauthorised access content: @@ -1685,10 +1582,10 @@ paths: type: string enum: - Unauthorised access - /dashboard/api/multitenancy/core-config/list: + /dashboard/api/core/config/list: get: tags: - - Multitenancy + - Miscellaneous summary: Gets all the possible core config options. parameters: - name: authorization @@ -1703,34 +1600,43 @@ paths: content: application/json: schema: - type: array - items: - oneOf: - - allOf: - - $ref: "#/components/schemas/coreConfigType" - - type: object - properties: - type: - type: string - enum: - - string - - boolean - - number - description: Data type of the property - - allOf: - - $ref: "#/components/schemas/coreConfigType" - - type: object - properties: - type: - type: string - enum: - - enum - description: Data type of the property - options: - type: array - items: - type: string - description: List of possible values for the property in case it is of enum type + type: object + properties: + status: + type: string + default: "OK" + config: + type: array + items: + oneOf: + - allOf: + - $ref: "#/components/schemas/coreConfigType" + - type: object + properties: + type: + type: string + enum: + - string + - boolean + - number + description: Data type of the property + - allOf: + - $ref: "#/components/schemas/coreConfigType" + - type: object + properties: + type: + type: string + enum: + - enum + description: Data type of the property + options: + type: array + items: + type: string + description: List of possible values for the property in case it is of enum type + required: + - status + - config 401: description: Unauthorised access content: From 1442e5f39844dd36539abc18ce1403d2ec66cbe2 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 19 Mar 2024 16:09:29 +0530 Subject: [PATCH 30/33] Use tenant id from path --- api_spec.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 0116c733..09947c52 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1233,14 +1233,14 @@ paths: type: array items: type: string - /dashboard/api/tenant: + //dashboard/api/tenant: get: tags: - Multitenancy summary: Get tenant info from the core parameters: - name: tenantId - in: query + in: path required: true schema: type: string @@ -1341,7 +1341,7 @@ paths: summary: Delete the tenant parameters: - name: tenantId - in: query + in: path required: true schema: type: string @@ -1376,6 +1376,7 @@ paths: type: string enum: - Unauthorised access + /dashboard/api/tenant: put: tags: - Multitenancy @@ -1489,7 +1490,7 @@ paths: properties: enabled: type: boolean - /dashboard/api/tenants/third-party: + /dashboard/api/tenants/third-party: put: tags: - Multitenancy @@ -1501,14 +1502,18 @@ paths: schema: type: string example: "Bearer API_KEY" + - name: tenantId + in: path + required: true + schema: + type: string + example: "tenant1" requestBody: content: application/json: schema: type: object properties: - tenantId: - type: string providerConfig: $ref: "#/components/schemas/thirdPartyProvider" responses: @@ -1541,7 +1546,7 @@ paths: summary: Delete thirdParty config for a tenant parameters: - name: tenantId - in: query + in: path required: true schema: type: string From b325bafc487ca08a4a6a115b170dbb444006a7c4 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 19 Mar 2024 20:04:22 +0530 Subject: [PATCH 31/33] Fix formatting errors in spec --- api_spec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 09947c52..24a01a1a 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1233,7 +1233,7 @@ paths: type: array items: type: string - //dashboard/api/tenant: + /{tenantId}/dashboard/api/tenant: get: tags: - Multitenancy @@ -1490,7 +1490,7 @@ paths: properties: enabled: type: boolean - /dashboard/api/tenants/third-party: + /{tenantId}/dashboard/api/tenants/third-party: put: tags: - Multitenancy From a855a9a717cc05adbddf1a5c085743c394722971 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Tue, 19 Mar 2024 20:06:16 +0530 Subject: [PATCH 32/33] Update spec according to review change sin implementation --- api_spec.yaml | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/api_spec.yaml b/api_spec.yaml index 24a01a1a..4d461969 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -1425,15 +1425,23 @@ paths: content: application/json: schema: - type: object - properties: - status: - type: string - default: "OK" - createdNew: - type: boolean - required: - - status + oneOf: + - type: object + properties: + status: + type: string + default: "OK" + createdNew: + type: boolean + required: + - status + - type: object + properties: + status: + type: string + default: "MULTITENANCY_NOT_ENABLED_IN_CORE" + required: + - status 401: description: Unauthorised access @@ -1685,12 +1693,6 @@ paths: properties: enabled: type: boolean - thirdPartyEmailPassword: - type: object - properties: - enabled: - type: boolean - nullable: true passwordless: type: object properties: @@ -1700,16 +1702,6 @@ paths: type: string enum: [PHONE, EMAIL, EMAIL_OR_PHONE] nullable: true - thirdPartPasswordless: - type: object - properties: - enabled: - type: boolean - contactMethod: - type: string - enum: [PHONE, EMAIL, EMAIL_OR_PHONE] - nullable: true - nullable: true thirdParty: type: object properties: From 73c8cb43a6bcf3b7adaf24d8df5358e8ce9e9218 Mon Sep 17 00:00:00 2001 From: Prateek Surana Date: Wed, 20 Mar 2024 11:14:09 +0530 Subject: [PATCH 33/33] Update config API spec --- api_spec.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api_spec.yaml b/api_spec.yaml index 4d461969..1184ed87 100644 --- a/api_spec.yaml +++ b/api_spec.yaml @@ -2384,10 +2384,13 @@ components: description: Description of the property isConfigYamlOnly: type: boolean - description: True if the property can be set different values per tenant + description: True if the property can only be set in the config.yaml file isNotConflictingInApp: type: boolean description: True if the property can be set different values per app + isDifferentAcrossTenants: + type: boolean + description: True if the property can be set different values per tenant isSaasProtected: type: boolean description: True if the property protected and cannot be set because the user is using SuperTokens SaaS