From 4b7cd5405dea9003f31af1aa9cd584d8ccf2141f Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 23 Aug 2023 09:54:43 +0200 Subject: Consistently use the preferences and history names in the bff code base - rename openapi clients (client-portal-prefs -> client-preferences, client-portal-history -> client-history, client-portal-keycloak -> client-keycloak) - rename related spring configurations (portal-prefs -> preferences, portal-history -> history) - rename related environment variables (PORTAL_PREFS_URL -> PREFERENCES_URL, PORTAL_HISTORY_URL -> HISTORY_URL) Note that the changes to the configurations and variables affect external services using it and the bff chart Issue-ID: PORTALNG-49 Change-Id: I434abdf130a5a81534c2387143b296122408d452 Signed-off-by: Fiete Ostkamp --- openapi/build.gradle | 12 +- openapi/client-history/LICENSE | 201 +++++++ openapi/client-history/build.gradle | 62 ++ openapi/client-history/src/api.yaml | 457 +++++++++++++++ openapi/client-keycloak/LICENSE | 201 +++++++ openapi/client-keycloak/build.gradle | 62 ++ openapi/client-keycloak/src/api.yaml | 651 +++++++++++++++++++++ openapi/client-portal-history/LICENSE | 201 ------- openapi/client-portal-history/build.gradle | 62 -- .../src/portal_history_openapi.yaml | 457 --------------- openapi/client-portal-keycloak/LICENSE | 201 ------- openapi/client-portal-keycloak/build.gradle | 62 -- .../src/portal_keycloak_openapi.yaml | 651 --------------------- openapi/client-portal-prefs/LICENSE | 201 ------- openapi/client-portal-prefs/build.gradle | 62 -- .../src/portal_prefs_openapi.yaml | 341 ----------- openapi/client-preferences/LICENSE | 201 +++++++ openapi/client-preferences/build.gradle | 66 +++ openapi/client-preferences/src/api.yaml | 341 +++++++++++ openapi/server/build.gradle | 2 +- openapi/server/src/main/resources/static/api.yaml | 2 +- 21 files changed, 2248 insertions(+), 2248 deletions(-) create mode 100644 openapi/client-history/LICENSE create mode 100644 openapi/client-history/build.gradle create mode 100644 openapi/client-history/src/api.yaml create mode 100644 openapi/client-keycloak/LICENSE create mode 100644 openapi/client-keycloak/build.gradle create mode 100644 openapi/client-keycloak/src/api.yaml delete mode 100644 openapi/client-portal-history/LICENSE delete mode 100644 openapi/client-portal-history/build.gradle delete mode 100644 openapi/client-portal-history/src/portal_history_openapi.yaml delete mode 100644 openapi/client-portal-keycloak/LICENSE delete mode 100644 openapi/client-portal-keycloak/build.gradle delete mode 100644 openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml delete mode 100644 openapi/client-portal-prefs/LICENSE delete mode 100644 openapi/client-portal-prefs/build.gradle delete mode 100644 openapi/client-portal-prefs/src/portal_prefs_openapi.yaml create mode 100644 openapi/client-preferences/LICENSE create mode 100644 openapi/client-preferences/build.gradle create mode 100644 openapi/client-preferences/src/api.yaml (limited to 'openapi') diff --git a/openapi/build.gradle b/openapi/build.gradle index 0b3e556..34d949b 100644 --- a/openapi/build.gradle +++ b/openapi/build.gradle @@ -5,15 +5,11 @@ plugins { dependencies { implementation project('server') - implementation project('client-portal-history') - implementation project('client-portal-keycloak') - implementation project('client-portal-prefs') + implementation project('client-history') + implementation project('client-keycloak') + implementation project('client-preferences') } + ext { openapiVersion = '7.0.0-beta' -} -subprojects { - repositories { - mavenCentral() - } } \ No newline at end of file diff --git a/openapi/client-history/LICENSE b/openapi/client-history/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-history/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-history/build.gradle b/openapi/client-history/build.gradle new file mode 100644 index 0000000..20b5258 --- /dev/null +++ b/openapi/client-history/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_history" + apiPackage = "org.onap.portalng.bff.openapi.client_history.api" + modelPackage = "org.onap.portalng.bff.openapi.client_history.model" + modelNameSuffix = "HistoryDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-history/src/api.yaml b/openapi/client-history/src/api.yaml new file mode 100644 index 0000000..22c6ae5 --- /dev/null +++ b/openapi/client-history/src/api.yaml @@ -0,0 +1,457 @@ +openapi: 3.0.2 +info: + title: Config API + version: '1.0' + description: API to provide actions for history + contact: + name: TNAP Team Tesla + url: 'https://www.telekom.de' + email: info@telekom.de +servers: + - url: 'http://localhost:9002' +tags: + - name: actions +paths: + '/v1/actions/{userId}': + parameters: + - $ref: '#/components/parameters/userIdPathParam' + - $ref: '#/components/parameters/xRequestIdHeader' + get: + summary: Retrieve all actions for a specific user + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + operationId: getActions + parameters: + - $ref: '#/components/parameters/pageQueryParam' + - $ref: '#/components/parameters/pageSizeQueryParam' + - schema: + type: integer + format: int32 + in: query + name: showLastHours + description: Get all actions within the last X hours. + description: Get actions for the given userId + tags: + - actions + post: + summary: Create an action for a given user + operationId: createAction + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateActionRequest' + description: Only one action in each POST request + description: Create a user action + tags: + - actions + delete: + summary: Delete user actions after given time + operationId: deleteActions + parameters: + - schema: + type: integer + format: int32 + in: query + name: deleteAfterHours + description: If parameter is given actions older than value will be deleted for the user + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + tags: + - actions + description: Delete user actions after given time + '/v1/actions': + get: + summary: Retrieve all actions from the portal with an optional timeframe + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + operationId: listActions + parameters: + - $ref: '#/components/parameters/xRequestIdHeader' + - $ref: '#/components/parameters/pageQueryParam' + - $ref: '#/components/parameters/pageSizeQueryParam' + - schema: + type: integer + format: int32 + in: query + name: showLastHours + description: Get all actions within the last X hours. + description: Get portal actions from all users + tags: + - actions + '/actuator/info': + get: + tags: + - actions + summary: Retrieve actuator information + description: Proxy for actuator info endpoint + operationId: getActuatorInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActuatorInfoResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + +components: + parameters: + xRequestIdHeader: + name: X-Request-Id + in: header + description: The unique identifier of the request + required: true + schema: + type: string + pageQueryParam: + name: page + in: query + description: Page index (1..N) + required: false + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + pageSizeQueryParam: + name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 5000 + default: 10 + userIdPathParam: + name: userId + in: path + description: User ID + required: true + schema: + $ref: '#/components/schemas/ValidString' + schemas: + ActionResponse: + title: ActionResponse + type: object + properties: + actionCreatedAt: + type: string + format: date-time + action: + type: object + saveInterval: + type: integer + format: int32 + required: + - action + - actionCreatedAt + CreateActionRequest: + title: CreateActionRequest + type: object + properties: + userId: + type: string + actionCreatedAt: + type: string + format: date-time + action: + type: object + required: + - userId + - actionCreatedAt + - action + ActionsListResponse: + title: ActionsListResponse + type: object + properties: + actionsList: + type: array + items: + $ref: '#/components/schemas/ActionResponse' + totalCount: + type: integer + format: int32 + description: Total number of items matching criteria + required: + - actionsList + - totalCount + ActuatorInfoResponse: + title: ActuatorInfoResponse + type: object + properties: + git: + $ref: '#/components/schemas/ActuatorGitInfo' + build: + $ref: '#/components/schemas/ActuatorBuildInfo' + java: + $ref: '#/components/schemas/ActuatorJavaInfo' + ActuatorGitInfo: + title: ActuatorGitInfo + type: object + properties: + branch: + type: string + commit: + $ref: '#/components/schemas/GitCommitInfo' + ActuatorBuildInfo: + title: ActuatorBuildInfo + type: object + properties: + artifact: + type: string + name: + type: string + time: + type: string + version: + type: string + group: + type: string + GitCommitInfo: + title: GitCommitInfo + type: object + properties: + id: + type: string + time: + type: string + ActuatorJavaInfo: + title: ActuatorJavaInfo + type: object + properties: + version: + type: string + vendor: + $ref: '#/components/schemas/JavaVendorInfo' + runtime: + $ref: '#/components/schemas/JavaRuntimeInfo' + jvm: + $ref: '#/components/schemas/JavaJvmInfo' + JavaVendorInfo: + title: JavaVendorInfo + type: object + properties: + name: + type: string + version: + type: string + JavaRuntimeInfo: + title: JavaRuntimeInfo + type: object + properties: + name: + type: string + version: + type: string + JavaJvmInfo: + title: JavaJvmInfo + type: object + properties: + name: + type: string + vendor: + type: string + version: + type: string + Problem: + type: object + properties: + type: + type: string + format: uri-reference + description: | + A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. + default: 'about:blank' + example: /problem/connection-error + title: + type: string + description: | + A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Service Unavailable + status: + type: integer + format: int32 + description: | + The HTTP status code generated by the origin server for this occurrence of the problem. + minimum: 100 + maximum: 600 + exclusiveMaximum: true + example: 503 + detail: + type: string + description: | + A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Connection to database timed out + instance: + type: string + format: uri-reference + description: | + A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. + example: /problem/connection-error#token-info-read-timed-out + ValidString: + type: string + pattern: '[\w,/!=§#@€:µ.*+?'' \-\u00C0-\u017F]*' + responses: + BadRequest: + description: '400: Bad Request' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Unauthorized: + description: '401: Unauthorized' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Forbidden: + description: '403: Forbidden' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotFound: + description: '404: Not Found' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotAllowed: + description: '405: Method Not Allowed' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Conflict: + description: '409: Conflict' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + BadGateway: + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response diff --git a/openapi/client-keycloak/LICENSE b/openapi/client-keycloak/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-keycloak/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-keycloak/build.gradle b/openapi/client-keycloak/build.gradle new file mode 100644 index 0000000..46c842d --- /dev/null +++ b/openapi/client-keycloak/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_keycloak" + apiPackage = "org.onap.portalng.bff.openapi.client_keycloak.api" + modelPackage = "org.onap.portalng.bff.openapi.client_keycloak.model" + modelNameSuffix = "KeycloakDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-keycloak/src/api.yaml b/openapi/client-keycloak/src/api.yaml new file mode 100644 index 0000000..a09f0f4 --- /dev/null +++ b/openapi/client-keycloak/src/api.yaml @@ -0,0 +1,651 @@ +openapi: 3.0.2 +info: + title: Keycloak API + version: '1.0' + description: API to provide Keycloak actions + contact: + name: TNAP Team Tesla + url: 'https://www.telekom.de' + email: info@telekom.de +servers: + - url: 'http://localhost:9003/{base}/{version}' + variables: + base: + default: 'portal-keycloak' + description: Basepath + version: + default: 'v1' + description: Version +paths: + '/roles': + get: + tags: + - keycloak + summary: Get all roles + description: Retrieves all keycloak roles for the realm or client + operationId: getRoles + parameters: + - name: search + in: query + schema: + type: string + - name: first + in: query + schema: + type: integer + format: int32 + - name: max + in: query + schema: + type: integer + format: int32 + - name: briefRepresentation + in: query + schema: + type: boolean + responses: + 2XX: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + post: + tags: + - keycloak + summary: Create a new role + description: Creates a new role for the realm or client + operationId: createRole + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + 2XX: + description: OK + '/roles/{roleName}/users': + get: + tags: + - keycloak + summary: Get all users for the role + description: Returns a stream of users that have the specified role name + operationId: getUsersByRole + parameters: + - name: first + in: query + description: 'First result to return. Ignored if negative or {@code null}' + schema: + type: integer + format: int32 + - name: max + in: query + description: 'Maximum number of results to return. Ignored if negative or {@code null}' + schema: + type: integer + format: int32 + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + parameters: + - name: roleName + in: path + description: The role name + required: true + schema: + type: string + '/users': + post: + tags: + - keycloak + summary: Create a new keycloak user + description: Creates a new user in keycloak. Username must be unique + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 2XX: + description: Success + get: + tags: + - keycloak + summary: Get keycloak users + description: Returns a stream of users, filtered according to query. + operationId: getUsers + parameters: + - name: search + in: query + schema: + type: string + - name: lastName + in: query + schema: + type: string + - name: firstName + in: query + schema: + type: string + - name: email + in: query + schema: + type: string + - name: username + in: query + schema: + type: string + - name: emailVerified + in: query + schema: + type: boolean + - name: idpAlias + in: query + schema: + type: string + - name: idpUserId + in: query + schema: + type: string + - name: first + in: query + schema: + type: integer + format: int32 + - name: max + in: query + schema: + type: integer + format: int32 + - name: enabled + in: query + schema: + type: boolean + - name: briefRepresentation + in: query + schema: + type: boolean + - name: exact + in: query + schema: + type: boolean + - name: q + in: query + schema: + type: string + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '/users/count': + get: + tags: + - keycloak + summary: Get users count + description: Returns the number of users that match the given criteria + operationId: getUsersCount + parameters: + - name: search + in: query + schema: + type: string + - name: lastName + in: query + schema: + type: string + - name: firstName + in: query + schema: + type: string + - name: email + in: query + schema: + type: string + - name: emailVerified + in: query + schema: + type: boolean + - name: username + in: query + schema: + type: string + - name: enabled + in: query + schema: + type: boolean + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: integer + format: int32 + '/users/{id}': + put: + tags: + - keycloak + summary: Update user + description: Updates the user + operationId: updateUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 2XX: + description: Success + get: + tags: + - keycloak + summary: Get user + description: Returns representation of the user + operationId: getUser + responses: + 2XX: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/User' + delete: + tags: + - keycloak + summary: Delete the user + description: Deletes the user + operationId: deleteUser + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/reset-password': + put: + tags: + - keycloak + summary: Reset user password + description: Sets up a new password for the user + operationId: resetUserPassword + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/role-mappings/realm': + get: + tags: + - keycloak + summary: Get realm role mappings + description: Returns realm-level role mappings + operationId: getRealmRoleMappingsByUserId + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + post: + tags: + - keycloak + summary: Add realm role mappings + description: Adds realm-level role mappings to the user + operationId: addRealmRoleMappingsToUser + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + responses: + 2XX: + description: Success + delete: + tags: + - keycloak + summary: Delete realm role mappings + description: Deletes realm-level role mappings + operationId: deleteRealmRoleMappingsByUserId + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/role-mappings/realm/available': + get: + tags: + - keycloak + summary: Get available realm roles + description: Returns realm-level roles that can be mapped + operationId: getAvailableRealmRoleMappingsByUserId + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/execute-actions-email': + put: + tags: + - keycloak + summary: Execute actions email + description: Send an update account email to the user. An email contains a link the user can click to perform a set of required actions. The redirectUri and clientId parameters are optional. If no redirect is given, then there will be no link back to click after actions have completed. Redirect uri must be a valid uri for the particular clientId + operationId: executeActionsEmail + parameters: + - name: OIDCLoginProtocol.REDIRECT_URI_PARAM + in: query + description: Redirect uri + schema: + type: string + - name: OIDCLoginProtocol.CLIENT_ID_PARAM + in: query + description: Client id + schema: + type: string + - name: lifespan + in: query + description: Number of seconds after which the generated token expires + schema: + type: integer + format: int32 + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RequiredActions' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string +components: + schemas: + Role: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + scopeParamRequired: + type: boolean + composites: + $ref: '#/components/schemas/Composites' + composite: + type: boolean + clientRole: + type: boolean + containerId: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + Composites: + type: object + properties: + realm: + type: array + items: + type: string + client: + type: object + additionalProperties: + type: array + items: + type: string + application: + type: object + additionalProperties: + type: array + items: + type: string + User: + type: object + properties: + self: + type: string + id: + type: string + createdTimestamp: + type: integer + format: int64 + firstName: + type: string + lastName: + type: string + email: + type: string + username: + type: string + enabled: + type: boolean + totp: + type: boolean + emailVerified: + type: boolean + attributes: + type: object + additionalProperties: + type: array + items: + type: string + credentials: + type: array + items: + $ref: '#/components/schemas/Credential' + requiredActions: + type: array + items: + $ref: '#/components/schemas/RequiredActions' + federatedIdentities: + type: array + items: + $ref: '#/components/schemas/FederatedIdentity' + socialLinks: + type: array + items: + $ref: '#/components/schemas/SocialLink' + realmRoles: + type: array + items: + type: string + clientRoles: + type: object + additionalProperties: + type: array + items: + type: string + clientConsents: + type: array + items: + $ref: '#/components/schemas/UserConsent' + notBefore: + type: integer + format: int32 + applicationRoles: + type: object + additionalProperties: + type: array + items: + type: string + federationLink: + type: string + serviceAccountClientId: + type: string + groups: + type: array + items: + type: string + origin: + type: string + disableableCredentialTypes: + type: array + items: + type: string + access: + type: object + additionalProperties: + type: boolean + Credential: + type: object + properties: + id: + type: string + type: + type: string + userLabel: + type: string + secretData: + type: string + credentialData: + type: string + priority: + type: integer + format: int32 + createdDate: + type: integer + format: int64 + value: + type: string + temporary: + type: boolean + device: + type: string + hashedSaltedValue: + type: string + salt: + type: string + hashIterations: + type: integer + format: int32 + counter: + type: integer + format: int32 + algorithm: + type: string + digits: + type: integer + format: int32 + period: + type: integer + format: int32 + config: + type: object + additionalProperties: + type: string + FederatedIdentity: + type: object + properties: + identityProvider: + type: string + userId: + type: string + userName: + type: string + SocialLink: + type: object + properties: + socialProvider: + type: string + socialUserId: + type: string + socialUsername: + type: string + UserConsent: + type: object + properties: + clientId: + type: string + grantedClientScopes: + type: array + items: + type: string + createdDate: + type: integer + format: int64 + lastUpdatedDate: + type: integer + format: int64 + grantedRealmRoles: + type: array + items: + type: string + RequiredActions: + type: string + enum: + - CONFIGURE_TOTP + - TERMS_AND_CONDITIONS + - UPDATE_PASSWORD + - UPDATE_PROFILE + - VERIFY_EMAIL + ErrorResponse: + type: object + properties: + error: + type: string + errorMessage: + type: string + diff --git a/openapi/client-portal-history/LICENSE b/openapi/client-portal-history/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-history/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-history/build.gradle b/openapi/client-portal-history/build.gradle deleted file mode 100644 index a087be9..0000000 --- a/openapi/client-portal-history/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_history_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_history" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_history.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_history.model" - modelNameSuffix = "PortalHistoryDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-history/src/portal_history_openapi.yaml b/openapi/client-portal-history/src/portal_history_openapi.yaml deleted file mode 100644 index 5057592..0000000 --- a/openapi/client-portal-history/src/portal_history_openapi.yaml +++ /dev/null @@ -1,457 +0,0 @@ -openapi: 3.0.2 -info: - title: Config API - version: '1.0' - description: API to provide actions for portal-history - contact: - name: TNAP Team Tesla - url: 'https://www.telekom.de' - email: info@telekom.de -servers: - - url: 'http://localhost:9002' -tags: - - name: actions -paths: - '/v1/actions/{userId}': - parameters: - - $ref: '#/components/parameters/userIdPathParam' - - $ref: '#/components/parameters/xRequestIdHeader' - get: - summary: Retrieve all actions for a specific user - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionsListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - operationId: getActions - parameters: - - $ref: '#/components/parameters/pageQueryParam' - - $ref: '#/components/parameters/pageSizeQueryParam' - - schema: - type: integer - format: int32 - in: query - name: showLastHours - description: Get all actions within the last X hours. - description: Get actions for the given userId - tags: - - actions - post: - summary: Create an action for a given user - operationId: createAction - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateActionRequest' - description: Only one action in each POST request - description: Create a user action - tags: - - actions - delete: - summary: Delete user actions after given time - operationId: deleteActions - parameters: - - schema: - type: integer - format: int32 - in: query - name: deleteAfterHours - description: If parameter is given actions older than value will be deleted for the user - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - tags: - - actions - description: Delete user actions after given time - '/v1/actions': - get: - summary: Retrieve all actions from the portal with an optional timeframe - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionsListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - operationId: listActions - parameters: - - $ref: '#/components/parameters/xRequestIdHeader' - - $ref: '#/components/parameters/pageQueryParam' - - $ref: '#/components/parameters/pageSizeQueryParam' - - schema: - type: integer - format: int32 - in: query - name: showLastHours - description: Get all actions within the last X hours. - description: Get portal actions from all users - tags: - - actions - '/actuator/info': - get: - tags: - - actions - summary: Retrieve actuator information - description: Proxy for actuator info endpoint - operationId: getActuatorInfo - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActuatorInfoResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - -components: - parameters: - xRequestIdHeader: - name: X-Request-Id - in: header - description: The unique identifier of the request - required: true - schema: - type: string - pageQueryParam: - name: page - in: query - description: Page index (1..N) - required: false - schema: - type: integer - format: int32 - minimum: 1 - default: 1 - pageSizeQueryParam: - name: pageSize - in: query - description: The size of the page to be returned - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 5000 - default: 10 - userIdPathParam: - name: userId - in: path - description: User ID - required: true - schema: - $ref: '#/components/schemas/ValidString' - schemas: - ActionResponse: - title: ActionResponse - type: object - properties: - actionCreatedAt: - type: string - format: date-time - action: - type: object - saveInterval: - type: integer - format: int32 - required: - - action - - actionCreatedAt - CreateActionRequest: - title: CreateActionRequest - type: object - properties: - userId: - type: string - actionCreatedAt: - type: string - format: date-time - action: - type: object - required: - - userId - - actionCreatedAt - - action - ActionsListResponse: - title: ActionsListResponse - type: object - properties: - actionsList: - type: array - items: - $ref: '#/components/schemas/ActionResponse' - totalCount: - type: integer - format: int32 - description: Total number of items matching criteria - required: - - actionsList - - totalCount - ActuatorInfoResponse: - title: ActuatorInfoResponse - type: object - properties: - git: - $ref: '#/components/schemas/ActuatorGitInfo' - build: - $ref: '#/components/schemas/ActuatorBuildInfo' - java: - $ref: '#/components/schemas/ActuatorJavaInfo' - ActuatorGitInfo: - title: ActuatorGitInfo - type: object - properties: - branch: - type: string - commit: - $ref: '#/components/schemas/GitCommitInfo' - ActuatorBuildInfo: - title: ActuatorBuildInfo - type: object - properties: - artifact: - type: string - name: - type: string - time: - type: string - version: - type: string - group: - type: string - GitCommitInfo: - title: GitCommitInfo - type: object - properties: - id: - type: string - time: - type: string - ActuatorJavaInfo: - title: ActuatorJavaInfo - type: object - properties: - version: - type: string - vendor: - $ref: '#/components/schemas/JavaVendorInfo' - runtime: - $ref: '#/components/schemas/JavaRuntimeInfo' - jvm: - $ref: '#/components/schemas/JavaJvmInfo' - JavaVendorInfo: - title: JavaVendorInfo - type: object - properties: - name: - type: string - version: - type: string - JavaRuntimeInfo: - title: JavaRuntimeInfo - type: object - properties: - name: - type: string - version: - type: string - JavaJvmInfo: - title: JavaJvmInfo - type: object - properties: - name: - type: string - vendor: - type: string - version: - type: string - Problem: - type: object - properties: - type: - type: string - format: uri-reference - description: | - A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. - default: 'about:blank' - example: /problem/connection-error - title: - type: string - description: | - A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Service Unavailable - status: - type: integer - format: int32 - description: | - The HTTP status code generated by the origin server for this occurrence of the problem. - minimum: 100 - maximum: 600 - exclusiveMaximum: true - example: 503 - detail: - type: string - description: | - A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Connection to database timed out - instance: - type: string - format: uri-reference - description: | - A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. - example: /problem/connection-error#token-info-read-timed-out - ValidString: - type: string - pattern: '[\w,/!=§#@€:µ.*+?'' \-\u00C0-\u017F]*' - responses: - BadRequest: - description: '400: Bad Request' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Unauthorized: - description: '401: Unauthorized' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Forbidden: - description: '403: Forbidden' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotFound: - description: '404: Not Found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotAllowed: - description: '405: Method Not Allowed' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Conflict: - description: '409: Conflict' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - InternalServerError: - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - BadGateway: - description: Bad Gateway - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response diff --git a/openapi/client-portal-keycloak/LICENSE b/openapi/client-portal-keycloak/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-keycloak/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-keycloak/build.gradle b/openapi/client-portal-keycloak/build.gradle deleted file mode 100644 index 22da1f2..0000000 --- a/openapi/client-portal-keycloak/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_keycloak_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.model" - modelNameSuffix = "KeycloakDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml b/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml deleted file mode 100644 index a09f0f4..0000000 --- a/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml +++ /dev/null @@ -1,651 +0,0 @@ -openapi: 3.0.2 -info: - title: Keycloak API - version: '1.0' - description: API to provide Keycloak actions - contact: - name: TNAP Team Tesla - url: 'https://www.telekom.de' - email: info@telekom.de -servers: - - url: 'http://localhost:9003/{base}/{version}' - variables: - base: - default: 'portal-keycloak' - description: Basepath - version: - default: 'v1' - description: Version -paths: - '/roles': - get: - tags: - - keycloak - summary: Get all roles - description: Retrieves all keycloak roles for the realm or client - operationId: getRoles - parameters: - - name: search - in: query - schema: - type: string - - name: first - in: query - schema: - type: integer - format: int32 - - name: max - in: query - schema: - type: integer - format: int32 - - name: briefRepresentation - in: query - schema: - type: boolean - responses: - 2XX: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - post: - tags: - - keycloak - summary: Create a new role - description: Creates a new role for the realm or client - operationId: createRole - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - required: true - responses: - 2XX: - description: OK - '/roles/{roleName}/users': - get: - tags: - - keycloak - summary: Get all users for the role - description: Returns a stream of users that have the specified role name - operationId: getUsersByRole - parameters: - - name: first - in: query - description: 'First result to return. Ignored if negative or {@code null}' - schema: - type: integer - format: int32 - - name: max - in: query - description: 'Maximum number of results to return. Ignored if negative or {@code null}' - schema: - type: integer - format: int32 - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - parameters: - - name: roleName - in: path - description: The role name - required: true - schema: - type: string - '/users': - post: - tags: - - keycloak - summary: Create a new keycloak user - description: Creates a new user in keycloak. Username must be unique - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - 2XX: - description: Success - get: - tags: - - keycloak - summary: Get keycloak users - description: Returns a stream of users, filtered according to query. - operationId: getUsers - parameters: - - name: search - in: query - schema: - type: string - - name: lastName - in: query - schema: - type: string - - name: firstName - in: query - schema: - type: string - - name: email - in: query - schema: - type: string - - name: username - in: query - schema: - type: string - - name: emailVerified - in: query - schema: - type: boolean - - name: idpAlias - in: query - schema: - type: string - - name: idpUserId - in: query - schema: - type: string - - name: first - in: query - schema: - type: integer - format: int32 - - name: max - in: query - schema: - type: integer - format: int32 - - name: enabled - in: query - schema: - type: boolean - - name: briefRepresentation - in: query - schema: - type: boolean - - name: exact - in: query - schema: - type: boolean - - name: q - in: query - schema: - type: string - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '/users/count': - get: - tags: - - keycloak - summary: Get users count - description: Returns the number of users that match the given criteria - operationId: getUsersCount - parameters: - - name: search - in: query - schema: - type: string - - name: lastName - in: query - schema: - type: string - - name: firstName - in: query - schema: - type: string - - name: email - in: query - schema: - type: string - - name: emailVerified - in: query - schema: - type: boolean - - name: username - in: query - schema: - type: string - - name: enabled - in: query - schema: - type: boolean - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: integer - format: int32 - '/users/{id}': - put: - tags: - - keycloak - summary: Update user - description: Updates the user - operationId: updateUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - 2XX: - description: Success - get: - tags: - - keycloak - summary: Get user - description: Returns representation of the user - operationId: getUser - responses: - 2XX: - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/User' - delete: - tags: - - keycloak - summary: Delete the user - description: Deletes the user - operationId: deleteUser - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/reset-password': - put: - tags: - - keycloak - summary: Reset user password - description: Sets up a new password for the user - operationId: resetUserPassword - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Credential' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/role-mappings/realm': - get: - tags: - - keycloak - summary: Get realm role mappings - description: Returns realm-level role mappings - operationId: getRealmRoleMappingsByUserId - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - post: - tags: - - keycloak - summary: Add realm role mappings - description: Adds realm-level role mappings to the user - operationId: addRealmRoleMappingsToUser - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - responses: - 2XX: - description: Success - delete: - tags: - - keycloak - summary: Delete realm role mappings - description: Deletes realm-level role mappings - operationId: deleteRealmRoleMappingsByUserId - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/role-mappings/realm/available': - get: - tags: - - keycloak - summary: Get available realm roles - description: Returns realm-level roles that can be mapped - operationId: getAvailableRealmRoleMappingsByUserId - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/execute-actions-email': - put: - tags: - - keycloak - summary: Execute actions email - description: Send an update account email to the user. An email contains a link the user can click to perform a set of required actions. The redirectUri and clientId parameters are optional. If no redirect is given, then there will be no link back to click after actions have completed. Redirect uri must be a valid uri for the particular clientId - operationId: executeActionsEmail - parameters: - - name: OIDCLoginProtocol.REDIRECT_URI_PARAM - in: query - description: Redirect uri - schema: - type: string - - name: OIDCLoginProtocol.CLIENT_ID_PARAM - in: query - description: Client id - schema: - type: string - - name: lifespan - in: query - description: Number of seconds after which the generated token expires - schema: - type: integer - format: int32 - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RequiredActions' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string -components: - schemas: - Role: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - scopeParamRequired: - type: boolean - composites: - $ref: '#/components/schemas/Composites' - composite: - type: boolean - clientRole: - type: boolean - containerId: - type: string - attributes: - type: object - additionalProperties: - type: array - items: - type: string - Composites: - type: object - properties: - realm: - type: array - items: - type: string - client: - type: object - additionalProperties: - type: array - items: - type: string - application: - type: object - additionalProperties: - type: array - items: - type: string - User: - type: object - properties: - self: - type: string - id: - type: string - createdTimestamp: - type: integer - format: int64 - firstName: - type: string - lastName: - type: string - email: - type: string - username: - type: string - enabled: - type: boolean - totp: - type: boolean - emailVerified: - type: boolean - attributes: - type: object - additionalProperties: - type: array - items: - type: string - credentials: - type: array - items: - $ref: '#/components/schemas/Credential' - requiredActions: - type: array - items: - $ref: '#/components/schemas/RequiredActions' - federatedIdentities: - type: array - items: - $ref: '#/components/schemas/FederatedIdentity' - socialLinks: - type: array - items: - $ref: '#/components/schemas/SocialLink' - realmRoles: - type: array - items: - type: string - clientRoles: - type: object - additionalProperties: - type: array - items: - type: string - clientConsents: - type: array - items: - $ref: '#/components/schemas/UserConsent' - notBefore: - type: integer - format: int32 - applicationRoles: - type: object - additionalProperties: - type: array - items: - type: string - federationLink: - type: string - serviceAccountClientId: - type: string - groups: - type: array - items: - type: string - origin: - type: string - disableableCredentialTypes: - type: array - items: - type: string - access: - type: object - additionalProperties: - type: boolean - Credential: - type: object - properties: - id: - type: string - type: - type: string - userLabel: - type: string - secretData: - type: string - credentialData: - type: string - priority: - type: integer - format: int32 - createdDate: - type: integer - format: int64 - value: - type: string - temporary: - type: boolean - device: - type: string - hashedSaltedValue: - type: string - salt: - type: string - hashIterations: - type: integer - format: int32 - counter: - type: integer - format: int32 - algorithm: - type: string - digits: - type: integer - format: int32 - period: - type: integer - format: int32 - config: - type: object - additionalProperties: - type: string - FederatedIdentity: - type: object - properties: - identityProvider: - type: string - userId: - type: string - userName: - type: string - SocialLink: - type: object - properties: - socialProvider: - type: string - socialUserId: - type: string - socialUsername: - type: string - UserConsent: - type: object - properties: - clientId: - type: string - grantedClientScopes: - type: array - items: - type: string - createdDate: - type: integer - format: int64 - lastUpdatedDate: - type: integer - format: int64 - grantedRealmRoles: - type: array - items: - type: string - RequiredActions: - type: string - enum: - - CONFIGURE_TOTP - - TERMS_AND_CONDITIONS - - UPDATE_PASSWORD - - UPDATE_PROFILE - - VERIFY_EMAIL - ErrorResponse: - type: object - properties: - error: - type: string - errorMessage: - type: string - diff --git a/openapi/client-portal-prefs/LICENSE b/openapi/client-portal-prefs/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-prefs/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-prefs/build.gradle b/openapi/client-portal-prefs/build.gradle deleted file mode 100644 index 9eaa4b0..0000000 --- a/openapi/client-portal-prefs/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_prefs_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_prefs" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.model" - modelNameSuffix = "PortalPrefsDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml b/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml deleted file mode 100644 index 86d9e2b..0000000 --- a/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml +++ /dev/null @@ -1,341 +0,0 @@ -openapi: 3.0.2 -info: - title: Config API - version: '1.0' -servers: - - url: 'http://localhost:9001' -tags: - - name: preferences -paths: - '/v1/preferences': - get: - description: Returns user preferences - summary: Get user preferences - operationId: getPreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - put: - description: Updates user preferences - summary: Update user preferences - operationId: updatePreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - post: - description: Save user preferences - summary: Save user preferences - operationId: savePreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - '/actuator/info': - get: - tags: - - preferences - summary: Retrieve actuator information - description: Proxy for actuator info endpoint - operationId: getActuatorInfo - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActuatorInfoResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' -components: - parameters: - XRequestIdHeader: - name: X-Request-Id - in: header - description: The unique identifier of the request - required: true - schema: - type: string - schemas: - Preferences: - type: object - x-extension-1: null - properties: - properties: - type: object - required: - - properties - ActuatorInfoResponse: - title: ActuatorInfoResponse - type: object - properties: - git: - $ref: '#/components/schemas/ActuatorGitInfo' - build: - $ref: '#/components/schemas/ActuatorBuildInfo' - java: - $ref: '#/components/schemas/ActuatorJavaInfo' - ActuatorGitInfo: - title: ActuatorGitInfo - type: object - properties: - branch: - type: string - commit: - $ref: '#/components/schemas/GitCommitInfo' - ActuatorBuildInfo: - title: ActuatorBuildInfo - type: object - properties: - artifact: - type: string - name: - type: string - time: - type: string - version: - type: string - group: - type: string - GitCommitInfo: - title: GitCommitInfo - type: object - properties: - id: - type: string - time: - type: string - ActuatorJavaInfo: - title: ActuatorJavaInfo - type: object - properties: - version: - type: string - vendor: - $ref: '#/components/schemas/JavaVendorInfo' - runtime: - $ref: '#/components/schemas/JavaRuntimeInfo' - jvm: - $ref: '#/components/schemas/JavaJvmInfo' - JavaVendorInfo: - title: JavaVendorInfo - type: object - properties: - name: - type: string - version: - type: string - JavaRuntimeInfo: - title: JavaRuntimeInfo - type: object - properties: - name: - type: string - version: - type: string - JavaJvmInfo: - title: JavaJvmInfo - type: object - properties: - name: - type: string - vendor: - type: string - version: - type: string - Problem: - type: object - properties: - type: - type: string - format: uri-reference - description: | - A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. - default: 'about:blank' - example: /problem/connection-error - title: - type: string - description: | - A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Service Unavailable - status: - type: integer - format: int32 - description: | - The HTTP status code generated by the origin server for this occurrence of the problem. - minimum: 100 - maximum: 600 - exclusiveMaximum: true - example: 503 - detail: - type: string - description: | - A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Connection to database timed out - instance: - type: string - format: uri-reference - description: | - A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. - example: /problem/connection-error#token-info-read-timed-out - responses: - BadRequest: - description: '400: Bad Request' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Unauthorized: - description: '401: Unauthorized' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Forbidden: - description: '403: Forbidden' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotFound: - description: '404: Not Found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotAllowed: - description: '405: Method Not Allowed' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Conflict: - description: '409: Conflict' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - InternalServerError: - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - BadGateway: - description: Bad Gateway - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response diff --git a/openapi/client-preferences/LICENSE b/openapi/client-preferences/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-preferences/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-preferences/build.gradle b/openapi/client-preferences/build.gradle new file mode 100644 index 0000000..208b20d --- /dev/null +++ b/openapi/client-preferences/build.gradle @@ -0,0 +1,66 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer", + "mapOfObjects": "Map" + ] + importMappings = [ + "Map": "java.util.Map" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_preferences" + apiPackage = "org.onap.portalng.bff.openapi.client_preferences.api" + modelPackage = "org.onap.portalng.bff.openapi.client_preferences.model" + modelNameSuffix = "PreferencesDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-preferences/src/api.yaml b/openapi/client-preferences/src/api.yaml new file mode 100644 index 0000000..86d9e2b --- /dev/null +++ b/openapi/client-preferences/src/api.yaml @@ -0,0 +1,341 @@ +openapi: 3.0.2 +info: + title: Config API + version: '1.0' +servers: + - url: 'http://localhost:9001' +tags: + - name: preferences +paths: + '/v1/preferences': + get: + description: Returns user preferences + summary: Get user preferences + operationId: getPreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + put: + description: Updates user preferences + summary: Update user preferences + operationId: updatePreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + post: + description: Save user preferences + summary: Save user preferences + operationId: savePreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + '/actuator/info': + get: + tags: + - preferences + summary: Retrieve actuator information + description: Proxy for actuator info endpoint + operationId: getActuatorInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActuatorInfoResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' +components: + parameters: + XRequestIdHeader: + name: X-Request-Id + in: header + description: The unique identifier of the request + required: true + schema: + type: string + schemas: + Preferences: + type: object + x-extension-1: null + properties: + properties: + type: object + required: + - properties + ActuatorInfoResponse: + title: ActuatorInfoResponse + type: object + properties: + git: + $ref: '#/components/schemas/ActuatorGitInfo' + build: + $ref: '#/components/schemas/ActuatorBuildInfo' + java: + $ref: '#/components/schemas/ActuatorJavaInfo' + ActuatorGitInfo: + title: ActuatorGitInfo + type: object + properties: + branch: + type: string + commit: + $ref: '#/components/schemas/GitCommitInfo' + ActuatorBuildInfo: + title: ActuatorBuildInfo + type: object + properties: + artifact: + type: string + name: + type: string + time: + type: string + version: + type: string + group: + type: string + GitCommitInfo: + title: GitCommitInfo + type: object + properties: + id: + type: string + time: + type: string + ActuatorJavaInfo: + title: ActuatorJavaInfo + type: object + properties: + version: + type: string + vendor: + $ref: '#/components/schemas/JavaVendorInfo' + runtime: + $ref: '#/components/schemas/JavaRuntimeInfo' + jvm: + $ref: '#/components/schemas/JavaJvmInfo' + JavaVendorInfo: + title: JavaVendorInfo + type: object + properties: + name: + type: string + version: + type: string + JavaRuntimeInfo: + title: JavaRuntimeInfo + type: object + properties: + name: + type: string + version: + type: string + JavaJvmInfo: + title: JavaJvmInfo + type: object + properties: + name: + type: string + vendor: + type: string + version: + type: string + Problem: + type: object + properties: + type: + type: string + format: uri-reference + description: | + A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. + default: 'about:blank' + example: /problem/connection-error + title: + type: string + description: | + A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Service Unavailable + status: + type: integer + format: int32 + description: | + The HTTP status code generated by the origin server for this occurrence of the problem. + minimum: 100 + maximum: 600 + exclusiveMaximum: true + example: 503 + detail: + type: string + description: | + A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Connection to database timed out + instance: + type: string + format: uri-reference + description: | + A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. + example: /problem/connection-error#token-info-read-timed-out + responses: + BadRequest: + description: '400: Bad Request' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Unauthorized: + description: '401: Unauthorized' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Forbidden: + description: '403: Forbidden' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotFound: + description: '404: Not Found' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotAllowed: + description: '405: Method Not Allowed' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Conflict: + description: '409: Conflict' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + BadGateway: + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response diff --git a/openapi/server/build.gradle b/openapi/server/build.gradle index 99e401b..78c5103 100644 --- a/openapi/server/build.gradle +++ b/openapi/server/build.gradle @@ -24,7 +24,7 @@ openApiGenerate { inputSpec = "$projectDir/src/main/resources/static/api.yaml" outputDir = "$buildDir/openapi" configOptions = [ - hideGenerationTimestamps: "true", + hideGenerationTimestamp: "true", openApiNullable: "false", skipDefaultInterface: "true", dateLibrary: "java8", diff --git a/openapi/server/src/main/resources/static/api.yaml b/openapi/server/src/main/resources/static/api.yaml index be5ae0a..f601785 100644 --- a/openapi/server/src/main/resources/static/api.yaml +++ b/openapi/server/src/main/resources/static/api.yaml @@ -734,7 +734,7 @@ components: enum: - KEYCLOAK - PORTAL_SERVICE - - PORTAL_PREFS + - PREFERENCES - PORTAL_HISTORY downstreamStatus: type: integer -- cgit 1.2.3-korg