From 8198991e1d25a301e4d4dc385405262591f7c342 Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Wed, 18 Oct 2023 20:42:57 +0530 Subject: [PATCH] Upd: Add api key endpoints Signed-off-by: George J Padayatti --- openapi/v2023.8.2/bundled.yaml | 134 ++++++++++++++++++ openapi/v2023.8.2/definitions/ApiKey.yaml | 36 +++++ openapi/v2023.8.2/index.yaml | 8 ++ openapi/v2023.8.2/parameters/apiKeyId.yaml | 6 + .../v2023.8.2/paths/configCreateApikey.yaml | 36 +++++ .../v2023.8.2/paths/configDeleteApiKey.yaml | 23 +++ openapi/v2023.8.2/paths/configReadApiKey.yaml | 25 ++++ .../v2023.8.2/paths/configUpdateApiKey.yaml | 36 +++++ 8 files changed, 304 insertions(+) create mode 100644 openapi/v2023.8.2/definitions/ApiKey.yaml create mode 100644 openapi/v2023.8.2/parameters/apiKeyId.yaml create mode 100644 openapi/v2023.8.2/paths/configCreateApikey.yaml create mode 100644 openapi/v2023.8.2/paths/configDeleteApiKey.yaml create mode 100644 openapi/v2023.8.2/paths/configReadApiKey.yaml create mode 100644 openapi/v2023.8.2/paths/configUpdateApiKey.yaml diff --git a/openapi/v2023.8.2/bundled.yaml b/openapi/v2023.8.2/bundled.yaml index 3daa59a..086d8a6 100644 --- a/openapi/v2023.8.2/bundled.yaml +++ b/openapi/v2023.8.2/bundled.yaml @@ -2441,6 +2441,140 @@ paths: x-specification-pii-or-sensitive: 'False' x-specification-scenario: '' x-specification-usecase: UC-C-PIC-A-004 + /config/admin/apikey: + post: + description: CREATE - Create an API key + operationId: configCreateApikey + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + apiKey: + $ref: '#/paths/~1config~1admin~1apikey~1%7BapiKeyId%7D/delete/responses/200/content/application~1json/schema' + description: An object of type ApiKey + required: + - apiKey + type: object + responses: + '200': + content: + application/json: + schema: + type: object + properties: + apiKey: + $ref: '#/paths/~1config~1admin~1apikey~1%7BapiKeyId%7D/delete/responses/200/content/application~1json/schema' + description: 'A set consisting of the new ApiKey object created, together with the initial Revision object.' + '400': + description: bad input parameter + security: + - BearerAuth: [] + summary: CREATE - Create an API key + tags: + - config + x-specification-crudl-model: ApiKey + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-A-001 + '/config/admin/apikey/{apiKeyId}': + put: + description: UPDATE - Update an API key + operationId: configUpdateApiKey + parameters: + - description: Unique ID of an object + in: path + name: apiKeyId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + apiKey: + $ref: '#/paths/~1config~1admin~1apikey~1%7BapiKeyId%7D/delete/responses/200/content/application~1json/schema' + description: An object of type ApiKey + required: + - apiKey + type: object + responses: + '200': + content: + application/json: + schema: + type: object + properties: + apiKey: + $ref: '#/paths/~1config~1admin~1apikey~1%7BapiKeyId%7D/delete/responses/200/content/application~1json/schema' + description: '' + '400': + description: bad input parameter + security: + - BearerAuth: [] + summary: UPDATE - Update an API key + tags: + - config + x-specification-crudl-model: ApiKey + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-A-002 + delete: + description: DELETE - Deletes an API key DataAgreement. + operationId: configDeletePolicy + parameters: + - $ref: '#/paths/~1config~1admin~1apikey~1%7BapiKeyId%7D/put/parameters/0' + responses: + '200': + content: + application/json: + schema: + type: object + title: ApiKey + description: Api key + x-not-in-database: false + required: + - scopes + properties: + id: + type: string + format: '' + example: '' + description: API key Id + scopes: + type: array + items: + type: string + enum: + - config + - audit + - service + - onboard + description: Scopes for API key + apiKey: + type: string + format: '' + example: '' + description: API key + expiryInDays: + type: integer + format: '' + default: 30 + description: 'Expiry in days. If expiry is 0, then default to 30 days' + description: '' + '400': + description: bad input parameter + security: + - BearerAuth: [] + summary: DELETE - Deletes an API key + tags: + - config + x-specification-crudl-model: ApiKey + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-A-004 /onboard/admin/login: post: tags: diff --git a/openapi/v2023.8.2/definitions/ApiKey.yaml b/openapi/v2023.8.2/definitions/ApiKey.yaml new file mode 100644 index 0000000..e6ffe77 --- /dev/null +++ b/openapi/v2023.8.2/definitions/ApiKey.yaml @@ -0,0 +1,36 @@ +type: object +title: ApiKey +description: "Api key" +x-not-in-database: false + +required: + - scopes +properties: + id: + type: string + format: "" + example: "" + description: "API key Id" + + scopes: + type: array + items: + type: string + enum: + - config + - audit + - service + - onboard + description: "Scopes for API key" + + apiKey: + type: string + format: "" + example: "" + description: "API key" + + expiryInDays: + type: integer + format: "" + default: 30 + description: "Expiry in days. If expiry is 0, then default to 30 days" diff --git a/openapi/v2023.8.2/index.yaml b/openapi/v2023.8.2/index.yaml index 8e550b4..0e2ff0c 100644 --- a/openapi/v2023.8.2/index.yaml +++ b/openapi/v2023.8.2/index.yaml @@ -181,6 +181,14 @@ paths: $ref: "./paths/configUpdateIdp.yaml" delete: $ref: "./paths/configDeleteIdp.yaml" + /config/admin/apikey: + post: + $ref: "./paths/configCreateApikey.yaml" + /config/admin/apikey/{apiKeyId}: + put: + $ref: "./paths/configUpdateApiKey.yaml" + delete: + $ref: "./paths/configDeleteApiKey.yaml" /onboard/admin/login: post: $ref: ./paths/loginOrganisationAdmin.yaml diff --git a/openapi/v2023.8.2/parameters/apiKeyId.yaml b/openapi/v2023.8.2/parameters/apiKeyId.yaml new file mode 100644 index 0000000..42727db --- /dev/null +++ b/openapi/v2023.8.2/parameters/apiKeyId.yaml @@ -0,0 +1,6 @@ +description: Unique ID of an object +in: path +name: apiKeyId +required: true +schema: + type: string \ No newline at end of file diff --git a/openapi/v2023.8.2/paths/configCreateApikey.yaml b/openapi/v2023.8.2/paths/configCreateApikey.yaml new file mode 100644 index 0000000..8b12bd9 --- /dev/null +++ b/openapi/v2023.8.2/paths/configCreateApikey.yaml @@ -0,0 +1,36 @@ +description: CREATE - Create an API key +operationId: configCreateApikey +parameters: [] +requestBody: + content: + application/json: + schema: + properties: + apiKey: + $ref: ../definitions/ApiKey.yaml + description: An object of type ApiKey + required: + - apiKey + type: object +responses: + '200': + content: + application/json: + schema: + type: object + properties: + apiKey: + $ref: ../definitions/ApiKey.yaml + description: A set consisting of the new ApiKey object created, together with + the initial Revision object. + '400': + description: bad input parameter +security: + - BearerAuth: [] +summary: CREATE - Create an API key +tags: +- config +x-specification-crudl-model: ApiKey +x-specification-pii-or-sensitive: 'False' +x-specification-scenario: '' +x-specification-usecase: UC-C-PIC-A-001 diff --git a/openapi/v2023.8.2/paths/configDeleteApiKey.yaml b/openapi/v2023.8.2/paths/configDeleteApiKey.yaml new file mode 100644 index 0000000..c2bed8f --- /dev/null +++ b/openapi/v2023.8.2/paths/configDeleteApiKey.yaml @@ -0,0 +1,23 @@ +description: DELETE - Deletes an API key + DataAgreement. +operationId: configDeletePolicy +parameters: + - $ref: "../parameters/apiKeyId.yaml" +responses: + "200": + content: + application/json: + schema: + $ref: ../definitions/ApiKey.yaml + description: "" + "400": + description: bad input parameter +security: + - BearerAuth: [] +summary: DELETE - Deletes an API key +tags: + - config +x-specification-crudl-model: ApiKey +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" +x-specification-usecase: UC-C-PIC-A-004 diff --git a/openapi/v2023.8.2/paths/configReadApiKey.yaml b/openapi/v2023.8.2/paths/configReadApiKey.yaml new file mode 100644 index 0000000..8ac62b9 --- /dev/null +++ b/openapi/v2023.8.2/paths/configReadApiKey.yaml @@ -0,0 +1,25 @@ +description: READ - Read an API key +operationId: configReadApiKey +parameters: + - $ref: "../parameters/apiKeyId.yaml" +responses: + "200": + content: + application/json: + schema: + type: object + properties: + apiKey: + $ref: ../definitions/ApiKey.yaml + description: "" + "400": + description: bad input parameter +security: + - BearerAuth: [] +summary: READ - Read an API key +tags: + - config +x-specification-crudl-model: ApiKey +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" +x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/configUpdateApiKey.yaml b/openapi/v2023.8.2/paths/configUpdateApiKey.yaml new file mode 100644 index 0000000..87f3507 --- /dev/null +++ b/openapi/v2023.8.2/paths/configUpdateApiKey.yaml @@ -0,0 +1,36 @@ +description: UPDATE - Update an API key +operationId: configUpdateApiKey +parameters: + - $ref: "../parameters/apiKeyId.yaml" +requestBody: + content: + application/json: + schema: + properties: + apiKey: + $ref: ../definitions/ApiKey.yaml + description: An object of type ApiKey + required: + - apiKey + type: object +responses: + "200": + content: + application/json: + schema: + type: object + properties: + apiKey: + $ref: ../definitions/ApiKey.yaml + description: "" + "400": + description: bad input parameter +security: + - BearerAuth: [] +summary: UPDATE - Update an API key +tags: + - config +x-specification-crudl-model: ApiKey +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" +x-specification-usecase: UC-C-PIC-A-002