diff --git a/.github/workflows/chart-release.yaml b/.github/workflows/chart-release.yaml index 28f9de5..a90a0ad 100644 --- a/.github/workflows/chart-release.yaml +++ b/.github/workflows/chart-release.yaml @@ -57,14 +57,30 @@ jobs: helm dependency update - name: Run chart-releaser - id: chart-release uses: helm/chart-releaser-action@v1.4.1 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_SKIP_EXISTING: "true" + - name: Get current helm chart version + id: chart-version + run: | + current=$(cat ./charts/policy-hub/Chart.yaml | grep "version:" | head -1 | cut -d ":" -d " " -f2) + echo "current=$current" >> $GITHUB_OUTPUT + echo "Exported $current helm chart version" + + - name: Check for previous version + id: version-check + run: | + exists=$(git tag -l "v${{ steps.chart-version.outputs.current }}") + if [[ -n "$exists" ]]; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + - name: Push git tag for release workflow to be triggered uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2 with: - tag: v${{ steps.chart-release.outputs.chart_version }} - if: ${{ steps.chart-release.outputs.changed_charts }} + tag: v${{ steps.chart-version.outputs.current }} + if: steps.version-check.outputs.exists == 'false' diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index eeee8ea..a2b1515 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -57,7 +57,7 @@ jobs: run: dotnet list src package --include-transitive --interactive | grep ">" | grep -Pv "\s(Org.Eclipse.TractusX|Microsoft|NuGet|System|runtime|docker|Docker|NETStandard)" | sed -E -e "s/\s+> ([a-zA-Z\.\-]+).+\s([0-9]+\.[0-9]+\.[0-9]+)\s*/nuget\/nuget\/\-\/\1\/\2/g" | awk '!seen[$0]++' > PACKAGES - name: Generate Dependencies file - run: java -jar ./scripts/download/org.eclipse.dash.licenses-1.0.2.jar PACKAGES -project automotive.tractusx -summary DEPENDENCIES || true + run: java -jar ./scripts/download/org.eclipse.dash.licenses-1.1.1-20240213.065029-71.jar PACKAGES -project automotive.tractusx -summary DEPENDENCIES || true - name: Check if dependencies were changed id: dependencies-changed diff --git a/.github/workflows/kics.yml b/.github/workflows/kics.yml index e02e801..36caacb 100644 --- a/.github/workflows/kics.yml +++ b/.github/workflows/kics.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/owasp-zap.yml b/.github/workflows/owasp-zap.yml index 9dbfac9..a5e41e2 100644 --- a/.github/workflows/owasp-zap.yml +++ b/.github/workflows/owasp-zap.yml @@ -124,15 +124,10 @@ jobs: echo "... done." - - name: Add Summary - if: success() || failure() - run: | - echo "Publishing Job summary... " - cat report_md.md >> $GITHUB_STEP_SUMMARY - - name: Upload HTML report if: success() || failure() uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: ZAP scan report path: ./report_html.html + retention-days: 1 diff --git a/.github/workflows/policy-hub-chart-test.yml b/.github/workflows/policy-hub-chart-test.yml index d1b97a9..845aa33 100644 --- a/.github/workflows/policy-hub-chart-test.yml +++ b/.github/workflows/policy-hub-chart-test.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/policy-hub-migrations.yml b/.github/workflows/policy-hub-migrations.yml index e7fc618..d7a2d58 100644 --- a/.github/workflows/policy-hub-migrations.yml +++ b/.github/workflows/policy-hub-migrations.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/policy-hub-service.yml b/.github/workflows/policy-hub-service.yml index e2bf484..c9f8add 100644 --- a/.github/workflows/policy-hub-service.yml +++ b/.github/workflows/policy-hub-service.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 406b4ad..049e3c0 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -22,7 +22,7 @@ name: Release Please on: push: branches: - - 'v*.*.*' + - 'changelog/v*.*.*' workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78ead14..d6f11fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/release_candidate.yml b/.github/workflows/release_candidate.yml index e8ed839..19541fa 100644 --- a/.github/workflows/release_candidate.yml +++ b/.github/workflows/release_candidate.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index fd09881..d3149d5 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/test-automation.yml b/.github/workflows/test-automation.yml index 46d1ac9..7f53550 100644 --- a/.github/workflows/test-automation.yml +++ b/.github/workflows/test-automation.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/trivy-dev.yml b/.github/workflows/trivy-dev.yml index e6be35d..0d67c16 100644 --- a/.github/workflows/trivy-dev.yml +++ b/.github/workflows/trivy-dev.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 0219a5f..9145989 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.github/workflows/unit.tests-formatting.yml b/.github/workflows/unit.tests-formatting.yml index 45247b5..ad33db0 100644 --- a/.github/workflows/unit.tests-formatting.yml +++ b/.github/workflows/unit.tests-formatting.yml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/.tractusx b/.tractusx index cb64071..d1deea0 100644 --- a/.tractusx +++ b/.tractusx @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e8195..82041e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.1.0](https://github.com/eclipse-tractusx/policy-hub/compare/v0.1.0-rc.3...v0.1.0) (2024-03-06) + + +### Features + +* **helm-chart:** define templates for db hostname uniquely ([#41](https://github.com/eclipse-tractusx/policy-hub/issues/41)) ([b4d0d79](https://github.com/eclipse-tractusx/policy-hub/commit/b4d0d79feca3ff0238d22f1f8ba9b8addb461023)) +* **helm-chart:** improve ingress, labels and namespace setting ([#45](https://github.com/eclipse-tractusx/policy-hub/issues/45)) ([1789336](https://github.com/eclipse-tractusx/policy-hub/commit/178933624765f7849b2253d24076e58dbac49224)) + +### Miscellaneous Chores + +* release 0.1.0 ([c00c513](https://github.com/eclipse-tractusx/policy-hub/commit/c00c513e7a614245805ca55b63bc76d4eb35b055)) + ## [0.1.0-rc.3](https://github.com/eclipse-tractusx/policy-hub/compare/v0.1.0-rc.2...v0.1.0-rc.3) (2024-02-15) diff --git a/FILEHEADER.md b/FILEHEADER.md index 79d8879..99a2df5 100644 --- a/FILEHEADER.md +++ b/FILEHEADER.md @@ -12,4 +12,12 @@ Every time you create a new file or edit a file that you created and doesn't yet Currently the following templates are available: * cx_header_default -* cx_header_with_# \ No newline at end of file +* cx_header_with_# + +## NOTICE + +This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). + +- SPDX-License-Identifier: Apache-2.0 +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/policy-hub \ No newline at end of file diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt deleted file mode 100644 index 4ea99c2..0000000 --- a/LICENSES/CC-BY-4.0.txt +++ /dev/null @@ -1,395 +0,0 @@ -Attribution 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution 4.0 International Public License ("Public License"). To the -extent this Public License may be interpreted as a contract, You are -granted the Licensed Rights in consideration of Your acceptance of -these terms and conditions, and the Licensor grants You such rights in -consideration of benefits the Licensor receives from making the -Licensed Material available under these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - d. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - e. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - f. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - g. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - h. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - i. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - j. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - k. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - 4. If You Share Adapted Material You produce, the Adapter's - License You apply must not prevent recipients of the Adapted - Material from complying with this Public License. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material; and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md index e63733c..aa51790 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,11 @@ This repository contains the backend code for the Policy-Hub written in C#. +For **installation** details, please refer to the [README.md](./charts/policy-hub/README.md) of the provided helm chart. + ## How to build and run -Install [the .NET 7.0 SDK](https://www.microsoft.com/net/download). +Install the [.NET 7.0 SDK](https://www.microsoft.com/net/download). Run the following command from the CLI: @@ -23,24 +25,10 @@ dotnet run This application provides container images for demonstration purposes. -### DockerHub - -* [https://hub.docker.com/r/tractusx/policy-hub-service](https://hub.docker.com/r/tractusx/policy-hub-service) -* [https://hub.docker.com/r/tractusx/policy-hub-migrations](https://hub.docker.com/r/tractusx/policy-hub-migrations) - -### Base images - -mcr.microsoft.com/dotnet/aspnet:7.0-alpine: - -* Dockerfile: [mcr.microsoft.com/dotnet/aspnet:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/aspnet/7.0/alpine3.17/amd64/Dockerfile) -* GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) -* DockerHub: [https://hub.docker.com/_/microsoft-dotnet-aspnet](https://hub.docker.com/_/microsoft-dotnet-aspnet) - -mcr.microsoft.com/dotnet/runtime:7.0-alpine: +See Docker notice files for more information: -* Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.17/amd64/Dockerfile) -* GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) -* DockerHub: [https://hub.docker.com/_/microsoft-dotnet-runtime](https://hub.docker.com/_/microsoft-dotnet-runtime) +* [policy-hub-service](./docker/notice-policy-hub-service.md) +* [policy-hub-migrations](./docker/notice-policy-hub-migrations.md) ## License diff --git a/charts/chart-testing-config.yaml b/charts/chart-testing-config.yaml index fc9a54d..8349acb 100644 --- a/charts/chart-testing-config.yaml +++ b/charts/chart-testing-config.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/charts/policy-hub/Chart.yaml b/charts/policy-hub/Chart.yaml index 65a92c5..1b4c3bc 100644 --- a/charts/policy-hub/Chart.yaml +++ b/charts/policy-hub/Chart.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -20,9 +20,9 @@ apiVersion: v2 name: policy-hub type: application -version: 0.1.0-rc.3 -appVersion: 0.1.0-rc.3 -description: Helm chart for Catena-X Policy Hub +version: 0.1.0 +appVersion: 0.1.0 +description: Helm chart for Policy Hub home: https://github.com/eclipse-tractusx/policy-hub dependencies: - condition: postgresql.enabled diff --git a/charts/policy-hub/README.md b/charts/policy-hub/README.md index 08ebcec..6093b26 100644 --- a/charts/policy-hub/README.md +++ b/charts/policy-hub/README.md @@ -1,8 +1,8 @@ -# Helm chart for Catena-X Policy Hub +# Helm chart for Policy Hub This helm chart installs the Catena-X Policy Hub application. -For further information please refer to [Technical Documentation](./docs/technical-documentation). +For further information please refer to [Technical Documentation](../../docs/technical-documentation/). The referenced container images are for demonstration purposes only. @@ -27,7 +27,7 @@ To use the helm chart as a dependency: dependencies: - name: policy-hub repository: https://eclipse-tractusx.github.io/charts/dev - version: 0.1.0-rc.3 + version: 0.1.0 ``` ## Requirements @@ -42,7 +42,6 @@ dependencies: |-----|------|---------|-------------| | centralidpAddress | string | `"https://centralidp.example.org"` | Provide centralidp base address (CX IAM), without trailing '/auth'. | | ingress.enabled | bool | `false` | Policy Hub ingress parameters, enable ingress record generation for policy-hub. | -| ingress.name | string | `"policy-hub"` | | | ingress.className | string | `"nginx"` | | | ingress.annotations."nginx.ingress.kubernetes.io/use-regex" | string | `"true"` | | | ingress.annotations."nginx.ingress.kubernetes.io/enable-cors" | string | `"true"` | | @@ -50,7 +49,7 @@ dependencies: | ingress.annotations."nginx.ingress.kubernetes.io/cors-allow-origin" | string | `"https://*.example.org"` | Provide CORS allowed origin. | | ingress.tls[0] | object | `{"hosts":["policy-hub.example.org"],"secretName":""}` | Provide tls secret. | | ingress.tls[0].hosts | list | `["policy-hub.example.org"]` | Provide host for tls secret. | -| ingress.hosts[0] | object | `{"host":"policy-hub.example.org","paths":[{"backend":{"port":8080},"path":"/api/policy-hub","pathType":"Prefix"}]}` | Provide default path for the ingress record. | +| ingress.hosts[0] | object | `{"host":"policy-hub.example.org","paths":[{"path":"/api/policy-hub","pathType":"Prefix"}]}` | Provide default path for the ingress record. | | dotnetEnvironment | string | `"Production"` | | | dbConnection.schema | string | `"hub"` | | | dbConnection.sslMode | string | `"Disable"` | | @@ -65,7 +64,7 @@ dependencies: | healthChecks.startup.path | string | `"/health/startup"` | | | healthChecks.liveness.path | string | `"/healthz"` | | | healthChecks.readyness.path | string | `"/ready"` | | -| policyhub.image | string | `"docker.io/tractusx/policy-hub-service:0.1.0-rc.3"` | | +| policyhub.image | string | `"docker.io/tractusx/policy-hub-service:0.1.0"` | | | policyhub.imagePullPolicy | string | `"IfNotPresent"` | | | policyhub.resources | object | `{"requests":{"cpu":"15m","memory":"300M"}}` | We recommend not to specify default resource limits and to leave this as a conscious choice for the user. If you do want to specify resource limits, uncomment the following lines and adjust them as necessary. | | policyhub.logging.businessLogic | string | `"Information"` | | @@ -73,7 +72,7 @@ dependencies: | policyhub.healthChecks.startup.tags[0].name | string | `"HEALTHCHECKS__0__TAGS__1"` | | | policyhub.healthChecks.startup.tags[0].value | string | `"policyhubdb"` | | | policyhub.swaggerEnabled | bool | `false` | | -| policyhubmigrations.image | string | `"docker.io/tractusx/policy-hub-migrations:0.1.0-rc.3"` | | +| policyhubmigrations.image | string | `"docker.io/tractusx/policy-hub-migrations:0.1.0"` | | | policyhubmigrations.imagePullPolicy | string | `"IfNotPresent"` | | | policyhubmigrations.resources | object | `{"requests":{"cpu":"15m","memory":"105M"}}` | We recommend not to specify default resource limits and to leave this as a conscious choice for the user. If you do want to specify resource limits, uncomment the following lines and adjust them as necessary. | | policyhubmigrations.seeding.testDataEnvironments | string | `""` | | diff --git a/charts/policy-hub/README.md.gotmpl b/charts/policy-hub/README.md.gotmpl index 499eb7a..42a9589 100644 --- a/charts/policy-hub/README.md.gotmpl +++ b/charts/policy-hub/README.md.gotmpl @@ -2,7 +2,7 @@ This helm chart installs the Catena-X Policy Hub application. -For further information please refer to [Technical Documentation](./docs/technical-documentation). +For further information please refer to [Technical Documentation](../../docs/technical-documentation/). The referenced container images are for demonstration purposes only. diff --git a/charts/policy-hub/templates/_helpers.tpl b/charts/policy-hub/templates/_helpers.tpl index c3a0e51..7d7c033 100644 --- a/charts/policy-hub/templates/_helpers.tpl +++ b/charts/policy-hub/templates/_helpers.tpl @@ -72,19 +72,19 @@ Create the name of the service account to use Determine database hostname for subchart */}} -{{- define "postgresql.primary.fullname" -}} +{{- define "phub.postgresql.primary.fullname" -}} {{- if eq .Values.postgresql.architecture "replication" }} -{{- printf "%s-primary" (include "chart-name-postgresql-dependency" .) | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-primary" (include "phub.chart.name.postgresql.dependency" .) | trunc 63 | trimSuffix "-" -}} {{- else -}} - {{- include "chart-name-postgresql-dependency" . -}} + {{- include "phub.chart.name.postgresql.dependency" . -}} {{- end -}} {{- end -}} -{{- define "postgresql.readReplica.fullname" -}} -{{- printf "%s-read" (include "chart-name-postgresql-dependency" .) | trunc 63 | trimSuffix "-" -}} +{{- define "phub.postgresql.readReplica.fullname" -}} +{{- printf "%s-read" (include "phub.chart.name.postgresql.dependency" .) | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "chart-name-postgresql-dependency" -}} +{{- define "phub.chart.name.postgresql.dependency" -}} {{- if .Values.postgresql.fullnameOverride -}} {{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} diff --git a/charts/policy-hub/templates/configmap-postgres-init.yaml b/charts/policy-hub/templates/configmap-postgres-init.yaml index 6ac456b..783afe3 100644 --- a/charts/policy-hub/templates/configmap-postgres-init.yaml +++ b/charts/policy-hub/templates/configmap-postgres-init.yaml @@ -1,5 +1,5 @@ {{- /* -* Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +* Copyright (c) 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -23,6 +23,8 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-phub-cm-postgres namespace: {{ .Release.Namespace }} + labels: + {{- include "phub.labels" . | nindent 4 }} data: 02-init-db.sql: | CREATE SCHEMA hub; diff --git a/charts/policy-hub/templates/deployment-hub.yaml b/charts/policy-hub/templates/deployment-hub.yaml index 6b4c9d7..dddacb5 100644 --- a/charts/policy-hub/templates/deployment-hub.yaml +++ b/charts/policy-hub/templates/deployment-hub.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -21,7 +21,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "phub.fullname" . }} - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "phub.labels" . | nindent 4 }} spec: @@ -37,7 +37,7 @@ spec: {{- include "phub.selectorLabels" . | nindent 8 }} spec: containers: - - name: {{ .Chart.Name }} + - name: {{ include "phub.fullname" . }} securityContext: allowPrivilegeEscalation: false capabilities: @@ -57,7 +57,7 @@ spec: name: "{{ template "phub.postgresSecretName" . }}" key: "password" - name: "CONNECTIONSTRINGS__POLICYHUBDB" - value: "Server={{ template "postgresql.primary.fullname" . }};Database={{ .Values.postgresql.auth.database }};Port={{ .Values.postgresql.auth.port }};User Id={{ .Values.postgresql.auth.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};" + value: "Server={{ template "phub.postgresql.primary.fullname" . }};Database={{ .Values.postgresql.auth.database }};Port={{ .Values.postgresql.auth.port }};User Id={{ .Values.postgresql.auth.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};" {{- end }} {{- if not .Values.postgresql.enabled }} - name: "POLICY_HUB_PASSWORD" diff --git a/charts/policy-hub/templates/ingress.yaml b/charts/policy-hub/templates/ingress.yaml index 225956e..3f0df2c 100644 --- a/charts/policy-hub/templates/ingress.yaml +++ b/charts/policy-hub/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- /* -* Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +* Copyright (c) 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -35,6 +35,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ .Release.Namespace }} labels: {{- include "phub.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} @@ -73,7 +74,7 @@ spec: number: {{ $svcPort }} {{- else }} serviceName: {{ $fullName }} - servicePort: {{ .backend.port }} + servicePort: {{ $svcPort }} {{- end }} {{- end }} {{- end }} diff --git a/charts/policy-hub/templates/job-policy-hub-migrations.yaml b/charts/policy-hub/templates/job-policy-hub-migrations.yaml index 75dea02..518b570 100644 --- a/charts/policy-hub/templates/job-policy-hub-migrations.yaml +++ b/charts/policy-hub/templates/job-policy-hub-migrations.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -21,6 +21,9 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "phub.fullname" . }}-migrations + namespace: {{ .Release.Namespace }} + labels: + {{- include "phub.labels" . | nindent 4 }} annotations: "batch.kubernetes.io/job-tracking": "true" "helm.sh/hook": post-install,post-upgrade @@ -28,8 +31,7 @@ metadata: spec: template: metadata: - labels: - {{- include "phub.selectorLabels" . | nindent 8 }} + name: {{ .Values.policyhubmigrations.name }}-migrations spec: restartPolicy: Never containers: @@ -53,7 +55,7 @@ spec: name: "{{ template "phub.postgresSecretName" . }}" key: "password" - name: "CONNECTIONSTRINGS__POLICYHUBDB" - value: "Server={{ template "postgresql.primary.fullname" . }};Database={{ .Values.postgresql.auth.database }};Port={{ .Values.postgresql.auth.port }};User Id={{ .Values.postgresql.auth.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};" + value: "Server={{ template "phub.postgresql.primary.fullname" . }};Database={{ .Values.postgresql.auth.database }};Port={{ .Values.postgresql.auth.port }};User Id={{ .Values.postgresql.auth.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};" {{- end }} {{- if not .Values.postgresql.enabled }} - name: "POLICY_HUB_PASSWORD" diff --git a/charts/policy-hub/templates/secret-external-db.yaml b/charts/policy-hub/templates/secret-external-db.yaml index 78c60e5..550d37a 100644 --- a/charts/policy-hub/templates/secret-external-db.yaml +++ b/charts/policy-hub/templates/secret-external-db.yaml @@ -1,5 +1,5 @@ {{- /* -* Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +* Copyright (c) 2023 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -23,6 +23,8 @@ kind: Secret metadata: name: {{ .Values.externalDatabase.existingSecret }} namespace: {{ .Release.Namespace }} + labels: + {{- include "portal.labels" . | nindent 4 }} type: Opaque # use lookup function to check if secret exists {{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.externalDatabase.existingSecret) }} diff --git a/charts/policy-hub/templates/secret-postgres.yaml b/charts/policy-hub/templates/secret-postgres.yaml index 59c49fb..4606147 100644 --- a/charts/policy-hub/templates/secret-postgres.yaml +++ b/charts/policy-hub/templates/secret-postgres.yaml @@ -24,6 +24,8 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace }} + labels: + {{- include "phub.labels" . | nindent 4 }} type: Opaque # use lookup function to check if secret exists {{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName) }} diff --git a/charts/policy-hub/templates/service-hub.yaml b/charts/policy-hub/templates/service-hub.yaml index 678cfad..70393c6 100644 --- a/charts/policy-hub/templates/service-hub.yaml +++ b/charts/policy-hub/templates/service-hub.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -21,7 +21,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "phub.fullname" . }} - namespace: {{ .Values.namespace }} + namespace: {{ .Release.Namespace }} labels: {{- include "phub.labels" . | nindent 4 }} spec: diff --git a/charts/policy-hub/values.yaml b/charts/policy-hub/values.yaml index ed6f6ed..c4c51c8 100644 --- a/charts/policy-hub/values.yaml +++ b/charts/policy-hub/values.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -24,7 +24,6 @@ ingress: # -- Policy Hub ingress parameters, # enable ingress record generation for policy-hub. enabled: false - name: "policy-hub" className: "nginx" annotations: nginx.ingress.kubernetes.io/use-regex: "true" @@ -44,9 +43,9 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 + dotnetEnvironment: "Production" + dbConnection: schema: "hub" sslMode: "Disable" @@ -73,7 +72,7 @@ healthChecks: path: "/ready" policyhub: - image: "docker.io/tractusx/policy-hub-service:0.1.0-rc.3" + image: "docker.io/tractusx/policy-hub-service:0.1.0" imagePullPolicy: "IfNotPresent" # -- We recommend not to specify default resource limits and to leave this as a conscious choice for the user. # If you do want to specify resource limits, uncomment the following lines and adjust them as necessary. @@ -95,7 +94,7 @@ policyhub: swaggerEnabled: false policyhubmigrations: - image: "docker.io/tractusx/policy-hub-migrations:0.1.0-rc.3" + image: "docker.io/tractusx/policy-hub-migrations:0.1.0" imagePullPolicy: "IfNotPresent" # -- We recommend not to specify default resource limits and to leave this as a conscious choice for the user. # If you do want to specify resource limits, uncomment the following lines and adjust them as necessary. diff --git a/consortia/argocd-app-templates/appsetup-beta.yaml b/consortia/argocd-app-templates/appsetup-beta.yaml index dcdc965..3f56806 100644 --- a/consortia/argocd-app-templates/appsetup-beta.yaml +++ b/consortia/argocd-app-templates/appsetup-beta.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/consortia/argocd-app-templates/appsetup-dev.yaml b/consortia/argocd-app-templates/appsetup-dev.yaml index 841b621..208043e 100644 --- a/consortia/argocd-app-templates/appsetup-dev.yaml +++ b/consortia/argocd-app-templates/appsetup-dev.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/consortia/argocd-app-templates/appsetup-int.yaml b/consortia/argocd-app-templates/appsetup-int.yaml index b6f23bf..b097ad9 100644 --- a/consortia/argocd-app-templates/appsetup-int.yaml +++ b/consortia/argocd-app-templates/appsetup-int.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -28,7 +28,7 @@ spec: source: path: charts/policy-hub repoURL: 'https://github.com/eclipse-tractusx/policy-hub.git' - targetRevision: policy-hub-0.1.0-rc.3 + targetRevision: policy-hub-0.1.0 plugin: env: - name: AVP_SECRET diff --git a/consortia/argocd-app-templates/appsetup-pen.yaml b/consortia/argocd-app-templates/appsetup-pen.yaml index 71b4d27..7807743 100644 --- a/consortia/argocd-app-templates/appsetup-pen.yaml +++ b/consortia/argocd-app-templates/appsetup-pen.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -28,7 +28,7 @@ spec: source: path: charts/policy-hub repoURL: 'https://github.com/eclipse-tractusx/policy-hub.git' - targetRevision: policy-hub-0.1.0-rc.3 + targetRevision: policy-hub-0.1.0 plugin: env: - name: AVP_SECRET diff --git a/consortia/argocd-app-templates/appsetup-rc.yaml b/consortia/argocd-app-templates/appsetup-rc.yaml index 3297d1a..e316d00 100644 --- a/consortia/argocd-app-templates/appsetup-rc.yaml +++ b/consortia/argocd-app-templates/appsetup-rc.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/consortia/argocd-app-templates/appsetup-stable.yaml b/consortia/argocd-app-templates/appsetup-stable.yaml index 1ac0f6a..3d908c0 100644 --- a/consortia/argocd-app-templates/appsetup-stable.yaml +++ b/consortia/argocd-app-templates/appsetup-stable.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -29,7 +29,7 @@ spec: source: path: '' repoURL: 'https://eclipse-tractusx.github.io/charts/dev' - targetRevision: policy-hub-0.1.0-rc.3 + targetRevision: policy-hub-0.1.0 plugin: env: - name: HELM_VALUES diff --git a/consortia/argocd-app-templates/appsetup-upgrade.yaml b/consortia/argocd-app-templates/appsetup-upgrade.yaml index d207e26..2bd595a 100644 --- a/consortia/argocd-app-templates/appsetup-upgrade.yaml +++ b/consortia/argocd-app-templates/appsetup-upgrade.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/consortia/environments/values-beta.yaml b/consortia/environments/values-beta.yaml index f674c43..01ddbef 100644 --- a/consortia/environments/values-beta.yaml +++ b/consortia/environments/values-beta.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -37,8 +37,6 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 policyhub: swaggerEnabled: true diff --git a/consortia/environments/values-dev.yaml b/consortia/environments/values-dev.yaml index 8981a74..9ac129b 100644 --- a/consortia/environments/values-dev.yaml +++ b/consortia/environments/values-dev.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -37,8 +37,6 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 keycloak: central: diff --git a/consortia/environments/values-int.yaml b/consortia/environments/values-int.yaml index 7303746..2c8ce65 100644 --- a/consortia/environments/values-int.yaml +++ b/consortia/environments/values-int.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -37,8 +37,6 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 keycloak: central: diff --git a/consortia/environments/values-pen.yaml b/consortia/environments/values-pen.yaml index 6fdbc5d..b80707e 100644 --- a/consortia/environments/values-pen.yaml +++ b/consortia/environments/values-pen.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -37,8 +37,6 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 policyhub: swaggerEnabled: true diff --git a/consortia/environments/values-rc.yaml b/consortia/environments/values-rc.yaml index e167976..5f909cf 100644 --- a/consortia/environments/values-rc.yaml +++ b/consortia/environments/values-rc.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -37,8 +37,6 @@ ingress: paths: - path: "/api/policy-hub" pathType: "Prefix" - backend: - port: 8080 policyhub: image: "docker.io/tractusx/policy-hub-service:rc" diff --git a/consortia/environments/values-upgrade.yaml b/consortia/environments/values-upgrade.yaml index aa58620..f613d45 100644 --- a/consortia/environments/values-upgrade.yaml +++ b/consortia/environments/values-upgrade.yaml @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/docker/Dockerfile-policy-hub-migrations b/docker/Dockerfile-policy-hub-migrations index 17514e3..edcb02e 100644 --- a/docker/Dockerfile-policy-hub-migrations +++ b/docker/Dockerfile-policy-hub-migrations @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/docker/Dockerfile-policy-hub-service b/docker/Dockerfile-policy-hub-service index 3e31033..1652752 100644 --- a/docker/Dockerfile-policy-hub-service +++ b/docker/Dockerfile-policy-hub-service @@ -1,5 +1,5 @@ ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/docker/notice-policy-hub-migrations.md b/docker/notice-policy-hub-migrations.md index eff4b02..e549341 100644 --- a/docker/notice-policy-hub-migrations.md +++ b/docker/notice-policy-hub-migrations.md @@ -13,7 +13,7 @@ __Policy Hub Migrations__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.17/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.19/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-runtime](https://hub.docker.com/_/microsoft-dotnet-runtime) diff --git a/docker/notice-policy-hub-service.md b/docker/notice-policy-hub-service.md index 6faaca6..6d10d9e 100644 --- a/docker/notice-policy-hub-service.md +++ b/docker/notice-policy-hub-service.md @@ -13,7 +13,7 @@ __Policy Hub Service__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/aspnet:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/aspnet/7.0/alpine3.17/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/aspnet:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/aspnet/7.0/alpine3.19/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-aspnet](https://hub.docker.com/_/microsoft-dotnet-aspnet) diff --git a/docs/technical-documentation/Security_Assessment.md b/docs/technical-documentation/Security_Assessment.md new file mode 100644 index 0000000..e686657 --- /dev/null +++ b/docs/technical-documentation/Security_Assessment.md @@ -0,0 +1,89 @@ +# Security Assessment Policy-Hub + +| | | +| ------------------------- | ---------------------------------------------------------------------------------------------- | +| Contact for product | [@evegufy](https://github.com/evegufy)
[@jjeroch](https://github.com/jjeroch) | +| Security responsible | [Szymon Kowalczyk](szymon.kowalczyk@zf.com) | +| Version number of product | 0.1.0 | +| Dates of assessment | 2024-02-16: Assessment | +| Status of assessment | Assessment Report | + +## Product Description + +Policy-Hub project is an readonly REST API project, without implementation of an UI. (Pure Backend Component) + +Main purpose of the product is to provide interested and authenticated C-X Users with read access to policy data, use cases, credential types, policy rules, that are created during an application seeding. + +The Policy-Hub comprise the technical foundation for interaction, monitoring, auditing and further functionalities. +They are state of the art in terms of technology portfolio, consist of open-source components whenever possible and are open-sourced themselves 100%. + +Policy-Hub can be run anywhere: it can be deployed as a docker image, e. g. on Kubernetes (platform-independent, cloud, on prem or local). + +The policy hub is using following key frameworks: + +- .Net +- Entity Framework +[architecture & development concept](https://github.com/eclipse-tractusx/policy-hub/blob/main/docs/technical-documentation/architecture/Development%20Concept.md) + +## Data Flow Diagram + +```mermaid +flowchart LR + + CU(Company user) + K("Keycloak (REST API)") + PH(Policy Hub API) + PHD[("Postgres Database \n \n (Data created with \n application seeding)")] + + subgraph centralidp[centralidp Keycloak] + K + end + + subgraph companyrealm[SharedIdP Keycloak or ownIdP] + CU + end + + subgraph Policy-Hub Product + PH + PHD + end + + K-->|"Authentication & Authorization Data \n (Using JWT)"|PH + CU-->|"Consumption of central, read-only REST API \n [HTTPS]"|PH + PH-->|"Read policies, use cases, \n credential types, policy rules"|PHD + CU-->|"IAM with OIDC \n [HTTPS]"|K +``` + +### Changes compared to last Security Assessment + +N/A + +### Features for Upcoming Versions + +N/A + +## Threats & Risks + +All potential threats discussed during the assessment were already mitigated. + +### Mitigated Threats + +N/A + +### Performed Security Checks + +- Static Application Security Testing (SAST) - CodeQL +- Dynamic Application Security Testing (DAST) - OWASP ZAP +- Secret Scanning - GitGuardian +- Software Composition Analysis (SCA) - SNYK +- Container Scan conducted - Trivy +- Infrastructure as Code - KICS +- Securing code, dependencies, containers, IaC and Cloud Deployments - SNYK + +## NOTICE + +This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). + +- SPDX-License-Identifier: Apache-2.0 +- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Architecture Constraints.md b/docs/technical-documentation/architecture/Architecture Constraints.md index 3d19338..ef15105 100644 --- a/docs/technical-documentation/architecture/Architecture Constraints.md +++ b/docs/technical-documentation/architecture/Architecture Constraints.md @@ -2,7 +2,7 @@ ## General -- This project is an readonly API project, there is no plan to implement an UI yet. +- This project provides an readonly API, there is no plan to implement an UI at the current stage. - Run anywhere: can be deployed as a docker image, e. g. on Kubernetes (platform-independent, cloud, on prem or local). @@ -18,13 +18,21 @@ ## Code analysis, linting and code coverage ---comming soon--- -(Veracode; Eslinter, Sonarcloud, etc.) +As part of the standard reviews, following code analysis and security checks have been executed: + +- SonarCloud Code Analysis +- Thread Modelling Analysis +- Static Application Security Testing (SAST) +- Dynamic Application Security Testing (DAST) +- Secret Scans +- Software Composition Analysis (SCA) +- Container Scans +- Infrastructure as Code (IaC) ## NOTICE This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Context and scope.md b/docs/technical-documentation/architecture/Context and scope.md index 28b675c..414c379 100644 --- a/docs/technical-documentation/architecture/Context and scope.md +++ b/docs/technical-documentation/architecture/Context and scope.md @@ -2,7 +2,8 @@ ## Business Context -TODO (PS): add description +The policy hub is created to enable data provider, consumer as well as app provider to get via a single-point-of-truth a statement of the current CX existing policies, their attributes as well as the policy key and structure. +Additionally the user can receive a complete policy template (based on Catena-X dataspace rules) to use the same for stored company rules; making offers inside the dataspace, etc. ## Technical Context @@ -13,5 +14,5 @@ The policy hub comprise the technical foundation for interaction, monitoring, au This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Development Concept.md b/docs/technical-documentation/architecture/Development Concept.md index d15bfb4..e99e60f 100644 --- a/docs/technical-documentation/architecture/Development Concept.md +++ b/docs/technical-documentation/architecture/Development Concept.md @@ -139,5 +139,5 @@ Policy Hub configuration is mainly possible via the appsettings files as well as This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Requirements.md b/docs/technical-documentation/architecture/Requirements.md index 2918aa0..95a7fc5 100644 --- a/docs/technical-documentation/architecture/Requirements.md +++ b/docs/technical-documentation/architecture/Requirements.md @@ -10,13 +10,13 @@ For Catena-X Member Companies |ID|Title|Requirement| |--------|--------|--------| |REQ-C-004|Identity Integration|Authentication is done vis IdP Federation to minimize administration overhead and to simplify logins. Authorization not included, this must be done Catena-X specific by the Central-IdP| - -TODO (PS): tbd with julia +|REQ|Single-Point-Of-Thruth of the current supported, allowed and defined policy rules.|| +|REQ|Share joint efforts by supporting stakeholders with one solution which can run anywhere. Maintenance efforts can get reduced.|| ## NOTICE This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Solution strategy.md b/docs/technical-documentation/architecture/Solution strategy.md index 6893ebd..267c920 100644 --- a/docs/technical-documentation/architecture/Solution strategy.md +++ b/docs/technical-documentation/architecture/Solution strategy.md @@ -10,5 +10,5 @@ This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/Whitebox Overall System.md b/docs/technical-documentation/architecture/Whitebox Overall System.md index 43c2054..a672578 100644 --- a/docs/technical-documentation/architecture/Whitebox Overall System.md +++ b/docs/technical-documentation/architecture/Whitebox Overall System.md @@ -4,12 +4,30 @@ In the following image you see the overall system overview of the Policy Hub -TODO (PS): add image for system view +```mermaid +flowchart LR + + C(Customer) + ING(Ingress) + PH(Policy Hub API) + PHD[("Postgres Database \n \n (Data created with \n application seeding)")] + + subgraph Policy-Hub Product + ING + PH + PHD + end + + C-->|"Authentication & Authorization Data \n (Using JWT)"|ING + ING-->|"Forward Request"|PH + PH-->|"Read policies, use cases, \n credential types, policy rules"|PHD + +``` ## NOTICE This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/architecture/operational-concept.md b/docs/technical-documentation/architecture/operational-concept.md index 485faae..0a8726b 100644 --- a/docs/technical-documentation/architecture/operational-concept.md +++ b/docs/technical-documentation/architecture/operational-concept.md @@ -43,5 +43,5 @@ Currently all backend services write log entries as structural data in json form This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/authentication/authentication.md b/docs/technical-documentation/authentication/authentication.md index 9ed3a9d..07c8542 100644 --- a/docs/technical-documentation/authentication/authentication.md +++ b/docs/technical-documentation/authentication/authentication.md @@ -2,12 +2,12 @@ The authentication process for the Policy Hub involves interaction with the central IAM (Identity and Access Management). The configuration for IAM can be customized either locally during development through secrets or within the chart for the Docker image. -Currently, the Policy Hub performs a basic validation by checking for a valid token in the request. However, it's important to note that no permission checks are conducted at this stage. +Currently, the Policy Hub performs a basic validation by checking for a valid token with a configurable Audience in the request. However, it's important to note that no permission checks are conducted at this stage. ## NOTICE This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/database/db-view.md b/docs/technical-documentation/database/db-view.md index b96c247..2289042 100644 --- a/docs/technical-documentation/database/db-view.md +++ b/docs/technical-documentation/database/db-view.md @@ -101,5 +101,5 @@ The `policies` table serves as the repository for comprehensive information abou This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/database/seeding.md b/docs/technical-documentation/database/seeding.md index ab92302..85eed33 100644 --- a/docs/technical-documentation/database/seeding.md +++ b/docs/technical-documentation/database/seeding.md @@ -40,5 +40,5 @@ The seeder includes a check to ensure that only data not yet existing in the dat This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/dev-process/Dev-flow_deploy-dev-env.md b/docs/technical-documentation/dev-process/Dev-flow_deploy-dev-env.md index 4db0726..bd2fcda 100644 --- a/docs/technical-documentation/dev-process/Dev-flow_deploy-dev-env.md +++ b/docs/technical-documentation/dev-process/Dev-flow_deploy-dev-env.md @@ -27,5 +27,5 @@ Note\*\* Trivy and KICS scans are scheduled to daily This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/dev-process/Dev-flow_git-diagram.md b/docs/technical-documentation/dev-process/Dev-flow_git-diagram.md index 92be5c1..dd80de8 100644 --- a/docs/technical-documentation/dev-process/Dev-flow_git-diagram.md +++ b/docs/technical-documentation/dev-process/Dev-flow_git-diagram.md @@ -129,5 +129,5 @@ gitGraph This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/dev-process/Enumeration Handling.md b/docs/technical-documentation/dev-process/Enumeration Handling.md index e77f773..a3de3e7 100644 --- a/docs/technical-documentation/dev-process/Enumeration Handling.md +++ b/docs/technical-documentation/dev-process/Enumeration Handling.md @@ -12,7 +12,6 @@ List of used enums in the policy hub application that are stored in the database ### Add Enums New enums can get added easily be enhancing the enumeration table (via the seeding data). With the next deployment; the new enum is getting auto deployed to the respective env. -Since enums have an enhanced impact on the system functionality; it is mandatorily needed to test (FE wise) the impacted screens / flows before releasing new enums. It is likely that the enum has an enhanced impact on the user journey / flow and break the system if not well tested. ### Change Enums @@ -36,5 +35,5 @@ It is not recommended to delete enums; instead .......... to be updated; we need This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/dev-process/How to contribute.md b/docs/technical-documentation/dev-process/How to contribute.md index ed4f051..9da0a85 100644 --- a/docs/technical-documentation/dev-process/How to contribute.md +++ b/docs/technical-documentation/dev-process/How to contribute.md @@ -107,5 +107,5 @@ What was changed, why was it changed (e.g. which issue was fixed or which requir This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). - SPDX-License-Identifier: Apache-2.0 -- SPDX-FileCopyrightText: 2021-2023 Contributors to the Eclipse Foundation +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation - Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/release-process/Release Process.md b/docs/technical-documentation/release-process/Release Process.md index a2256d4..3911d56 100644 --- a/docs/technical-documentation/release-process/Release Process.md +++ b/docs/technical-documentation/release-process/Release Process.md @@ -4,10 +4,8 @@ The release process for a new version can roughly be divided into the following - [Preparations on the release branch](#preparations-on-the-release-branch) - [Update CHANGELOG.md](#update-changelogmd) -- [Tag and build of versioned images](#tag-and-build-of-versioned-images) -- [Create releases from tags](#create-releases-from-tags) - [Merge release branch](#merge-release-branch) -- [RC: provide successive RC branch and change base of open PRs](#rc-provide-successive-rc-branch-and-change-base-of-open-prs) +- [RC: provide successive rc branch and change base of open PRs](#rc-provide-successive-rc-branch-and-change-base-of-open-prs) The process builds on the development flow which, usually, takes place within forks and leads to merged pull requests in the repositories of the eclipse-tractusx organization. @@ -15,25 +13,27 @@ For assigning and incrementing **version** numbers [Semantic Versioning](https:/ ## Preparations on the release branch -Checking out from the dev branch a release branch (release/{to be released version} e.g. release/v1.2.0, or respectively release/v1.2.0-RC1 for a release candidate). +Checking out from the dev branch a release branch (release/{to be released version} e.g. release/v1.2.0, or respectively release/v1.2.0-rc.1 for a release candidate). On the release branch the following steps are executed: ### 1. Aggregate migrations Migrations should be **aggregated in the case of releasing a new version**, in order to not release the entire history of migrations which accumulate during the development process. -Once a version has been released, migrations **mustn't be aggregated** in order to ensure upgradeability this also applies to **release candidates > RC1 and hotfixes**. +Once a version has been released, migrations **mustn't be aggregated** in order to ensure upgradeability this also applies to **release candidates > rc.1 and hotfixes**. Be aware that migrations coming release branches for release candidates or from hotfix branches, will **need to be incorporated into dev and main**. ### 2. Version bump The version needs to be updated in the `src` directory within the 'Directory.Build.props' file. -Bump helm chart and image version (also for argocd-app-templates, needed for consortia-environments). +Also, bump the chart and app version in the [Chart.yaml](../../../charts/policy-hub/Chart.yaml) and the version of the images in the [values.yaml](../../../charts/policy-hub/values.yaml). + +_Consortia relevant: Update the version of the targetRevision tag in the [argocd-app-templates](../../../consortia/argocd-app-templates/), used for consortia-environments._ Example for commit message: -_release: bump version for vx.x.x_ +_build: bump version for vx.x.x_ ### 3. Update README (on chart level) @@ -45,12 +45,12 @@ helm-docs --chart-search-root [charts-dir] --sort-values-order file Example for commit message: -_release: update readme for vx.x.x_ +_build: update readme for vx.x.x_ ## Update CHANGELOG.md The changelog file tracks all notable changes since the last released version. -Once a new version is ready to be released, the changelog gets automatically created by triggering the [release-please workflow](../../../.github/workflows/release-please.yml). +Once a new version is ready to be released, the changelog can get updated via an automatically created pull request using the [release-please workflow](../../../.github/workflows/release-please.yml) which can be triggered manually or by pushing a _changelog/v*.*.*_ branch. Please see: @@ -58,28 +58,6 @@ Please see: - [How do I change the version number?](https://github.com/googleapis/release-please/tree/v16.7.0?tab=readme-ov-file#how-do-i-change-the-version-number) - [How can I fix release notes?](https://github.com/googleapis/release-please/tree/v16.7.0?tab=readme-ov-file#how-can-i-fix-release-notes) -## Tag and build of versioned images - -It's important to pull the latest state of the release branch locally. -Then create and push a tag for the released version. -The push of the tag triggers the [release workflow](../../../.github/workflows/release.yml) which creates the versioned image/s. - -Example for tag: - -_v0.1.0_ - -Examples for tag messages: - -_Version 0.1.0: Policy-Hub for Catena-X_ - -## Create releases from tags - -Create the release from the tag available in repository. - -Examples for release messages: - -_Version 0.1.0: Policy-Hub for Catena-X_ - ## Merge release branch The release branch must be merged into main. @@ -88,26 +66,30 @@ Those merges need to happen via PRs. Example for PR titles: -_release(1.2.0): merge release into main_ +_build(1.2.0): merge release into main_ + +_build(1.2.0): merge main to dev_ -_release(1.2.0): merge main to dev_ +> Be aware that the merge into main triggers the workflow with the [helm-chart releaser action](../../../.github/workflows/chart-release.yaml). +> +> The workflow creates a 'policy-hub-x.x.x' tag and release. The release contains the new chart. +> +> This workflow also pushes the version tag that triggers the [release workflow](../../../.github/workflows/release.yml) which creates the versioned docker image/s. -Be aware that merge into main trigger the workflow with the [helm-chart releaser](../../../.github/workflows/chart-release.yaml). -Besides the official chart itself, there is also created a 'policy-hub-x.x.x' tag. -This tag is used to install (with the convenience of the argocd-app-templates) or upgrade the version via AgroCD on the consortia K8s clusters. +_Consortia relevant: The 'policy-hub-x.x.x' tag is used to install (with the convenience of the argocd-app-templates) or upgrade the version via AgroCD on the consortia K8s clusters._ -## RC: provide successive RC branch and change base of open PRs +## RC: provide successive rc branch and change base of open PRs -During a release candidate phase, checkout the successive 'RC' branch and push it to the server, so that it can be used for further bugfixes. +During a release candidate phase, checkout the successive 'rc' branch and push it to the server, so that it can be used for further bugfixes. Example: ```bash -git checkout tags/v0.1.0-RC2 -b release/v0.1.0-RC3 +git checkout tags/v0.1.0-rc.2 -b release/v0.1.0-rc.3 ``` -Also make sure to change the base of all open pull requests still pointing to the previous 'RC' branch to the newly pushed 'RC' branch. +Also make sure to change the base of all open pull requests still pointing to the previous 'rc' branch to the newly pushed 'rc' branch. ## NOTICE diff --git a/docs/technical-documentation/requests/example-requests.md b/docs/technical-documentation/requests/example-requests.md new file mode 100644 index 0000000..b40485a --- /dev/null +++ b/docs/technical-documentation/requests/example-requests.md @@ -0,0 +1,228 @@ +# Example Requests + +The policy hub provides 4 endpoints. All endpoints are readonly endpoints although one of them is a post endpoint. + +## GET: Policy Attributes + +The endpoint is accessible under `/api/policy-hub/policy-attributes` and can be used to receive all possible attribute types. + +## GET: Policy Types + +The endpoint is accessible under `/api/policy-hub/policy-types`. It can be used to receive all available policies with all their attributes. + +It's possible to filter the results by one of the following or both attributes: + +- Type + - Access + - Usage + - Purpose +- UseCase + - Traceability + - Quality + - PCF + - Behavioraltwin + - Sustainability + +As an result you'll receive a list of policies: + +```json +[ + { + "technicalKey": "BusinessPartnerNumber", + "type": [ + "Access", + "Usage" + ], + "description": "The business partner number restriction can get used to define which exact business partners (based on BPNL) are allowed to view or negotiate the respective data offer. Please ensure that you add minimum one 16-digit BPNL Number in the rightOperand; wildcards are not supported.", + "useCase": [ + "Traceability", + "Quality", + "PCF", + "Behavioraltwin", + "Sustainability" + ], + "attribute": [ + { + "key": "Regex", + "value": "^BPNL[\\w|\\d]{12}$" + } + ], + "technicalEnforced": true + }, + { + "technicalKey": "Membership", + "type": [ + "Access", + "Usage" + ], + "description": "The membership credential can get used to ensure that only CX members are allowed to view or negotiate the respective data offer.", + "useCase": [ + "Traceability", + "Quality", + "PCF", + "Behavioraltwin", + "Sustainability" + ], + "attribute": [ + { + "key": "Static", + "value": "active" + } + ], + "technicalEnforced": true + }, + { + "technicalKey": "FrameworkAgreement.traceability", + "type": [ + "Usage" + ], + "description": "With the Framework Credential, only those participants which have signed the respective framework agreement (general or via a specific version) are allowed to view or negotiate the respective data offer. Generic: \"rightOperand\": \"active\"; specific \"rightOperand\": \"active:{version}\"", + "useCase": [ + "Traceability" + ], + "attribute": [ + { + "key": "Version", + "value": "1.0" + }, + { + "key": "Version", + "value": "1.1" + }, + { + "key": "Version", + "value": "1.2" + } + ], + "technicalEnforced": true + } +] +``` + +## GET PolicyContent + +The endpoint is accessible under `/api/policy-hub/policy-content?useCase={useCase}&type={type}&credential={technicalKey}&operatorId={operator}&value={value}` and can be used to receive a concrete json file for a policy. + +The parameter you need to set for this endpoint can be received from the [policy-types](#get-policy-types) endpoint. The useCase as well as value are optional parameters. If you try to receive the content for a policy which has the Regex Attribute a value needs to be passed which is matching the regex pattern. + +A possible response can look like this: + +```json +{ + "content": { + "@context": [ + "https://www.w3.org/ns/odrl.jsonld", + { + "cx": "https://w3id.org/catenax/v0.0.1/ns/" + } + ], + "@type": "Offer", + "@id": "....", + "permission": { + "action": "use", + "constraint": { + "leftOperand": "FrameworkAgreement.traceability", + "operator": "eq", + "rightOperand": "@FrameworkAgreement.traceability-Version" + } + } + }, + "attributes": [ + { + "key": "@FrameworkAgreement.traceability-Version", + "possibleValues": [ + "active:1.0", + "active:1.1", + "active:1.2" + ] + } + ] +} +``` + +As you can see the policy content was requested with operatorId = Equals, since the FrameworkAgreement.traceability has multiple values the values of the rightOperand will be displayed in an attributes array with the respective key used to link the values. + +## POST: Policy Content + +The endpoint is accessible under `/api/policy-hub/policy-content` and can be used to receive a concrete json file for a policy with and / or linked constraints. + +The body of the request needs to contain the policyType and constraintOperand, valid values for the contraintOperand are `And` or `Or`. + +The constrains can be passed as an array, the content of the array is a combination of the technicalKey of a policy type and the operator either `Equals` or `In`. + +Limitations: the technicalKey of a constraint must only be included once. + +And example: + +```json +{ + "policyType": "Usage", + "constraintOperand": "And", + "constraints": [ + { + "key": "FrameworkAgreement.traceability", + "operator": "Equals" + }, + { + "key": "companyRole.dismantler", + "operator": "In" + } + ] +} + +``` + +Or example: + +```json +{ + "PolicyType": "Usage", + "ConstraintOperand": "Or", + "Constraints": [ + { + "Key": "FrameworkAgreement.traceability", + "Operator": "Equals" + }, + { + "Key": "companyRole.dismantler", + "Operator": "In" + } + ] +} + +``` + +Multiple constrains example: + +```json +{ + "PolicyType": "Usage", + "ConstraintOperand": "And", + "Constraints": [ + { + "Key": "FrameworkAgreement.traceability", + "Operator": "Equals" + }, + { + "Key": "companyRole.dismantler", + "Operator": "In" + }, + { + "Key": "BusinessPartnerNumber", + "Operator": "Equals", + "Value": "BPNL00000003CRHK" + } + ] +} + +``` + +If you want to try it out, check the [postman collection](/docs/developer/Technical-Documentation/requests/policy-hub.postman_collection.json) + +## NOTICE + +This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). + +- SPDX-License-Identifier: Apache-2.0 +- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/docs/technical-documentation/requests/policy-hub.postman_collection.json b/docs/technical-documentation/requests/policy-hub.postman_collection.json new file mode 100644 index 0000000..eceb5e2 --- /dev/null +++ b/docs/technical-documentation/requests/policy-hub.postman_collection.json @@ -0,0 +1,646 @@ +{ + "info": { + "_postman_id": "664c9cb3-c8fc-433f-bbdc-912bd2122052", + "name": "Policy Hub", + "description": "Hey there 👋\n\nthis collection gives you an overview of the policy hub api and some example requests.\n\nTo use the collection please set a environment variable called `baseUrl` with the url you want to test, e.g. [https://localhost:5001](https://localhost:5001) to test locally or https://policy-hub.dev.demo.catena-x.net\n\nto test the policy hub on dev.\n\nTo be able to test the api you need a valid token from the respective keycloak instance. Set the keyloak token within a variable called `hubToken`", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "2223943" + }, + "item": [ + { + "name": "Get PolicyTypes", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-types", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-types" + ] + } + }, + "response": [ + { + "name": "Get PolicyTypes With Type Filter", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-types?type=Access", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-types" + ], + "query": [ + { + "key": "type", + "value": "Access" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get PolicyTypes With UseCase Filter", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-types?useCase=Traceability", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-types" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + }, + { + "name": "Get PolicyContent", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=FrameworkAgreement.traceability&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability", + "disabled": true + }, + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "FrameworkAgreement.traceability" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "response": [ + { + "name": "Get Membership Content", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=Membership&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "Membership" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get BPN Content", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=BusinessPartnerNumber&operatorId=Equals&value=BPNL00000003CRHK", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "BusinessPartnerNumber" + }, + { + "key": "operatorId", + "value": "Equals" + }, + { + "key": "value", + "value": "BPNL00000003CRHK" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Framework Content", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=FrameworkAgreement.traceability&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability", + "disabled": true + }, + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "FrameworkAgreement.traceability" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Dismantler Content", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=companyRole.dismantler&operatorId=In", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "companyRole.dismantler" + }, + { + "key": "operatorId", + "value": "In" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Purpose TraceBattery", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?useCase=Traceability&type=Usage&credential=purpose.trace.v1.TraceBattery&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability" + }, + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "purpose.trace.v1.TraceBattery" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Purpose Trace Aspects", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?useCase=Traceability&type=Usage&credential=purpose.trace.v1.aspects&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability" + }, + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "purpose.trace.v1.aspects" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Purpose QualityAnalysis", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?useCase=Traceability&type=Usage&credential=purpose.trace.v1.qualityanalysis&operatorId=Equals", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "useCase", + "value": "Traceability" + }, + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "purpose.trace.v1.qualityanalysis" + }, + { + "key": "operatorId", + "value": "Equals" + } + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get PolicyContent", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content?type=Usage&credential=companyRole.dismantler&operatorId=In", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ], + "query": [ + { + "key": "type", + "value": "Usage" + }, + { + "key": "credential", + "value": "companyRole.dismantler" + }, + { + "key": "operatorId", + "value": "In" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Date", + "value": "Tue, 14 Nov 2023 21:53:59 GMT" + }, + { + "key": "Server", + "value": "Kestrel" + }, + { + "key": "Transfer-Encoding", + "value": "chunked" + } + ], + "cookie": [], + "body": "{\n \"content\": {\n \"@context\": [\n \"https://www.w3.org/ns/odrl.jsonld\",\n {\n \"cx\": \"https://w3id.org/catenax/v0.0.1/ns/\"\n }\n ],\n \"@type\": \"Offer\",\n \"@id\": \"....\",\n \"permission\": {\n \"action\": \"use\",\n \"constraint\": {\n \"leftOperand\": \"Dismantler.activityType\",\n \"operator\": \"in\",\n \"rightOperand\": [\n \"Audi\",\n \"BMW\",\n \"VW\"\n ]\n }\n }\n }\n}" + } + ] + }, + { + "name": "Get PolicyContent", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"PolicyType\": \"Usage\",\r\n \"ConstraintOperand\": \"And\",\r\n \"Constraints\": [\r\n {\r\n \"Key\": \"FrameworkAgreement.traceability\",\r\n \"Operator\": \"Equals\"\r\n },\r\n {\r\n \"Key\": \"companyRole.dismantler\",\r\n \"Operator\": \"In\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ] + } + }, + "response": [ + { + "name": "Get Content with AND", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"PolicyType\": \"Usage\",\r\n \"ConstraintOperand\": \"And\",\r\n \"Constraints\": [\r\n {\r\n \"Key\": \"FrameworkAgreement.traceability\",\r\n \"Operator\": \"Equals\"\r\n },\r\n {\r\n \"Key\": \"companyRole.dismantler\",\r\n \"Operator\": \"In\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get with multiple constraints", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"PolicyType\": \"Usage\",\r\n \"ConstraintOperand\": \"And\",\r\n \"Constraints\": [\r\n {\r\n \"Key\": \"FrameworkAgreement.traceability\",\r\n \"Operator\": \"Equals\"\r\n },\r\n {\r\n \"Key\": \"companyRole.dismantler\",\r\n \"Operator\": \"In\"\r\n },\r\n {\r\n \"Key\": \"BusinessPartnerNumber\",\r\n \"Operator\": \"Equals\",\r\n \"Value\": \"BPNL00000003CRHK\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + }, + { + "name": "Get Content with OR", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"PolicyType\": \"Usage\",\r\n \"ConstraintOperand\": \"Or\",\r\n \"Constraints\": [\r\n {\r\n \"Key\": \"FrameworkAgreement.traceability\",\r\n \"Operator\": \"Equals\"\r\n },\r\n {\r\n \"Key\": \"companyRole.dismantler\",\r\n \"Operator\": \"In\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-content", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-content" + ] + } + }, + "_postman_previewlanguage": null, + "header": null, + "cookie": [], + "body": null + } + ] + }, + { + "name": "Get Attributes", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/api/policy-hub/policy-attributes", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "api", + "policy-hub", + "policy-attributes" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{hubToken}}", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file diff --git a/scripts/add_notice_footer.sh b/scripts/add_notice_footer.sh index 083c2f4..a440aeb 100644 --- a/scripts/add_notice_footer.sh +++ b/scripts/add_notice_footer.sh @@ -1,7 +1,7 @@ #!/bin/bash ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/scripts/check-dependencies.md b/scripts/check-dependencies.md index 4391390..e8bda8d 100644 --- a/scripts/check-dependencies.md +++ b/scripts/check-dependencies.md @@ -6,4 +6,12 @@ This workflow uses the executable jar in the download directory. In order to update the executable jar run the following command from the root directory: - curl -L --output ./scripts/download/org.eclipse.dash.licenses-1.0.2.jar 'https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=1.0.2' + curl -L --output ./scripts/download/org.eclipse.dash.licenses-1.1.1.jar 'https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=1.1.1' + +## NOTICE + +This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). + +- SPDX-License-Identifier: Apache-2.0 +- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/policy-hub diff --git a/scripts/license.sh b/scripts/license.sh index 31d5e88..81a0d82 100644 --- a/scripts/license.sh +++ b/scripts/license.sh @@ -1,7 +1,7 @@ #!/bin/bash ############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +# Copyright (c) 2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9c39635..ad4631c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,5 +1,5 @@