From 66a50a7a25417a0bf76c1fd803c8acf2be12f023 Mon Sep 17 00:00:00 2001 From: kong-apiops <122612077+kong-apiops@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:00:05 +0000 Subject: [PATCH] Automated OAS Update (#86) --- openapi.yaml | 96 +++++++++++++++++++++++++++++++--------- src/api.ts | 123 ++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 179 insertions(+), 40 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index bb532ee..e16f22b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -694,7 +694,6 @@ paths: - portalAccessToken: [] - {} /api/v2/products/{productId}/actions: - x-unstable: true parameters: - $ref: '#/components/parameters/ProductId' get: @@ -1437,6 +1436,12 @@ components: type: string format: uuid nullable: true + AuthStrategyCredentialType: + type: string + enum: + - client_credentials + - self_managed_client_credentials + - key_auth ListAuthStrategiesItem: type: object additionalProperties: false @@ -1447,19 +1452,9 @@ components: type: string example: Okta Strategy credential_type: - type: string - enum: - - client_credentials - - self_managed_client_credentials - - key_auth - example: client_credentials + $ref: '#/components/schemas/AuthStrategyCredentialType' auth_methods: - type: array - items: - description: Auth Methods enabled for this strategy - type: string - example: - - bearer + $ref: '#/components/schemas/AuthMethods' required: - id - credential_type @@ -1509,8 +1504,8 @@ components: redirect_uri: type: string nullable: true - auth_strategy_id: - $ref: '#/components/schemas/AuthStrategyId' + auth_strategy: + $ref: '#/components/schemas/AuthStrategy' created_at: $ref: '#/components/schemas/CreatedAt' updated_at: @@ -1607,7 +1602,7 @@ components: - description - created_at - updated_at - - auth_strategy_id + - auth_strategy properties: id: $ref: '#/components/schemas/UUID' @@ -1632,8 +1627,8 @@ components: type: string client_secret: type: string - auth_strategy_id: - $ref: '#/components/schemas/AuthStrategyId' + auth_strategy: + $ref: '#/components/schemas/AuthStrategy' created_at: $ref: '#/components/schemas/CreatedAt' updated_at: @@ -1687,8 +1682,8 @@ components: type: string example: https://example.com/callback nullable: true - auth_strategy_id: - $ref: '#/components/schemas/AuthStrategyId' + auth_strategy: + $ref: '#/components/schemas/AuthStrategy' created_at: $ref: '#/components/schemas/CreatedAt' updated_at: @@ -1754,6 +1749,67 @@ components: Cannot be set when using Dynamic Client Registration. type: string maxLength: 255 + AuthStrategyKeyAuth: + description: KeyAuth Auth strategy that the application uses. + type: object + required: + - id + - name + - credential_type + properties: + id: + type: string + format: uuid + example: b9e81174-b5bb-4638-a3c3-8afe61a0abf8 + description: The Application Auth Strategy ID. + readOnly: true + name: + type: string + example: name + default: name + credential_type: + type: string + enum: + - key_auth + AuthMethods: + type: array + items: + description: Auth Methods enabled for this strategy + type: string + example: + - bearer + AuthStrategyClientCredentials: + description: Client Credential Auth strategy that the application uses. + type: object + required: + - id + - name + - credential_type + - auth_methods + properties: + id: + type: string + format: uuid + example: b9e81174-b5bb-4638-a3c3-8afe61a0abf8 + description: The Application Auth Strategy ID. + readOnly: true + name: + type: string + example: name + default: name + credential_type: + type: string + enum: + - client_credentials + - self_managed_client_credentials + auth_methods: + $ref: '#/components/schemas/AuthMethods' + AuthStrategy: + oneOf: + - $ref: '#/components/schemas/AuthStrategyKeyAuth' + - $ref: '#/components/schemas/AuthStrategyClientCredentials' + discriminator: + propertyName: credential_type CreatedAt: type: string format: date-time diff --git a/src/api.ts b/src/api.ts index 43bc0e0..f4c56b3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -125,11 +125,11 @@ export interface ApplicationCreationResponse { */ 'credentials'?: ApplicationCreationResponseCredentials; /** - * ID of the auth strategy to use for the application. If null or not included, the default application auth strategy will be used. - * @type {string} + * + * @type {AuthStrategy} * @memberof ApplicationCreationResponse */ - 'auth_strategy_id': string | null; + 'auth_strategy': AuthStrategy; /** * An ISO-8601 timestamp representation of entity creation date. * @type {string} @@ -231,11 +231,11 @@ export interface ApplicationUpdateResponse { */ 'redirect_uri'?: string | null; /** - * ID of the auth strategy to use for the application. If null or not included, the default application auth strategy will be used. - * @type {string} + * + * @type {AuthStrategy} * @memberof ApplicationUpdateResponse */ - 'auth_strategy_id'?: string | null; + 'auth_strategy'?: AuthStrategy; /** * An ISO-8601 timestamp representation of entity creation date. * @type {string} @@ -249,6 +249,98 @@ export interface ApplicationUpdateResponse { */ 'updated_at': string; } +/** + * @type AuthStrategy + * @export + */ +export type AuthStrategy = AuthStrategyClientCredentials | AuthStrategyKeyAuth; + +/** + * Client Credential Auth strategy that the application uses. + * @export + * @interface AuthStrategyClientCredentials + */ +export interface AuthStrategyClientCredentials { + /** + * The Application Auth Strategy ID. + * @type {string} + * @memberof AuthStrategyClientCredentials + */ + 'id': string; + /** + * + * @type {string} + * @memberof AuthStrategyClientCredentials + */ + 'name': string; + /** + * + * @type {string} + * @memberof AuthStrategyClientCredentials + */ + 'credential_type': AuthStrategyClientCredentialsCredentialTypeEnum; + /** + * + * @type {Array} + * @memberof AuthStrategyClientCredentials + */ + 'auth_methods': Array; +} + +export const AuthStrategyClientCredentialsCredentialTypeEnum = { + ClientCredentials: 'client_credentials', + SelfManagedClientCredentials: 'self_managed_client_credentials' +} as const; + +export type AuthStrategyClientCredentialsCredentialTypeEnum = typeof AuthStrategyClientCredentialsCredentialTypeEnum[keyof typeof AuthStrategyClientCredentialsCredentialTypeEnum]; + +/** + * + * @export + * @enum {string} + */ + +export const AuthStrategyCredentialType = { + ClientCredentials: 'client_credentials', + SelfManagedClientCredentials: 'self_managed_client_credentials', + KeyAuth: 'key_auth' +} as const; + +export type AuthStrategyCredentialType = typeof AuthStrategyCredentialType[keyof typeof AuthStrategyCredentialType]; + + +/** + * KeyAuth Auth strategy that the application uses. + * @export + * @interface AuthStrategyKeyAuth + */ +export interface AuthStrategyKeyAuth { + /** + * The Application Auth Strategy ID. + * @type {string} + * @memberof AuthStrategyKeyAuth + */ + 'id': string; + /** + * + * @type {string} + * @memberof AuthStrategyKeyAuth + */ + 'name': string; + /** + * + * @type {string} + * @memberof AuthStrategyKeyAuth + */ + 'credential_type': AuthStrategyKeyAuthCredentialTypeEnum; +} + +export const AuthStrategyKeyAuthCredentialTypeEnum = { + KeyAuth: 'key_auth' +} as const; + +export type AuthStrategyKeyAuthCredentialTypeEnum = typeof AuthStrategyKeyAuthCredentialTypeEnum[keyof typeof AuthStrategyKeyAuthCredentialTypeEnum]; + /** * The request schema for the authenticate endpoint. * @export @@ -901,11 +993,11 @@ export interface GetApplicationResponse { */ 'redirect_uri'?: string | null; /** - * ID of the auth strategy to use for the application. If null or not included, the default application auth strategy will be used. - * @type {string} + * + * @type {AuthStrategy} * @memberof GetApplicationResponse */ - 'auth_strategy_id'?: string | null; + 'auth_strategy'?: AuthStrategy; /** * An ISO-8601 timestamp representation of entity creation date. * @type {string} @@ -1327,10 +1419,10 @@ export interface ListAuthStrategiesItem { 'name': string; /** * - * @type {string} + * @type {AuthStrategyCredentialType} * @memberof ListAuthStrategiesItem */ - 'credential_type': ListAuthStrategiesItemCredentialTypeEnum; + 'credential_type': AuthStrategyCredentialType; /** * * @type {Array} @@ -1338,15 +1430,6 @@ export interface ListAuthStrategiesItem { */ 'auth_methods'?: Array; } - -export const ListAuthStrategiesItemCredentialTypeEnum = { - ClientCredentials: 'client_credentials', - SelfManagedClientCredentials: 'self_managed_client_credentials', - KeyAuth: 'key_auth' -} as const; - -export type ListAuthStrategiesItemCredentialTypeEnum = typeof ListAuthStrategiesItemCredentialTypeEnum[keyof typeof ListAuthStrategiesItemCredentialTypeEnum]; - /** * * @export