Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ZAAS /safIdt endpoint to generate SAF ID token for authenticated user #3220

Merged
merged 24 commits into from
Dec 8, 2023

Conversation

weinfurt
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Linked to #3003
Part of the #2029

Type of change

Please delete options that are not relevant.

  • fix: Bug fix (non-breaking change which fixes an issue)
  • feat: New feature (non-breaking change which adds functionality)
  • docs: Change in a documentation
  • refactor: Refactor the code
  • chore: Chore, repository cleanup, updates the dependencies.
  • BREAKING CHANGE or !: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • PR title conforms to commit message guideline ## Commit Message Structure Guideline
  • I have commented my code, particularly in hard-to-understand areas. In JS I did provide JSDoc
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations
  • Any dependent changes have been merged and published in downstream modules

For more details about how should the code look like read the Contributing guideline

@weinfurt weinfurt marked this pull request as ready for review November 28, 2023 10:00
@github-actions github-actions bot added the Sensitive Sensitive change that requires peer review label Nov 30, 2023
Signed-off-by: Petr Weinfurt <[email protected]>
@JirkaAichler
Copy link
Contributor

givenClientAndHeaderCertificates_thenReturnTokenFromClientCert test needs some adjustment. It is missing centent type and body. You can add to all tests but if they start failing you might need to split it and place the this test directly to SafIdTokensTest.java

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Dec 1, 2023
@weinfurt
Copy link
Contributor Author

weinfurt commented Dec 5, 2023

Added more negative tests for all ZAAS endpoints where the valid OAuth access token is provided but no mapping exists for the distributed ID.

…t find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>
…ind ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>
Signed-off-by: Petr Weinfurt <[email protected]>
Copy link

sonarqubecloud bot commented Dec 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Contributor

@JirkaAichler JirkaAichler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@weinfurt weinfurt merged commit c72adbc into v2.x.x Dec 8, 2023
32 checks passed
@delete-merged-branch delete-merged-branch bot deleted the reboot/zaas/safIdt-endpoint branch December 8, 2023 09:21
pj892031 pushed a commit that referenced this pull request Dec 18, 2023
…d user (#3220)

* New ZAAS safIdt endpoint to generate SAF ID tokens for authenticated user.

Signed-off-by: Petr Weinfurt <[email protected]>

* IT tests for safIdt endpoint.

Signed-off-by: Petr Weinfurt <[email protected]>

* Address code review comments.

Signed-off-by: Petr Weinfurt <[email protected]>

* Remove unused class

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix IT tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix unit tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Add Controller Advice to handle exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle more exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add negative tests with valid Okta token and no mapping.

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix Rest assured RequestSpec preparation.

Signed-off-by: Petr Weinfurt <[email protected]>

* Checkout the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Replace deprecated sonar.login property

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch depth 0

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle TokenNotValid and TokenExpired exception with 401 response.

Signed-off-by: Petr Weinfurt <[email protected]>

---------

Signed-off-by: Petr Weinfurt <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>
balhar-jakub added a commit that referenced this pull request Dec 18, 2023
* Update changelog

Signed-off-by: Zowe Robot <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* fix content of the new changelog

Signed-off-by: Pavel Jares <[email protected]>

* change logs enhancements

Signed-off-by: Pavel Jares <[email protected]>

* [skip ci] Update version

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] [skip ci] Before tag commit 'v2.13.1'.

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] Create new version: 'v2.13.2-SNAPSHOT'.

Signed-off-by: Pavel Jares <[email protected]>

* feat: ZAAS /safIdt endpoint to generate SAF ID token for authenticated user (#3220)

* New ZAAS safIdt endpoint to generate SAF ID tokens for authenticated user.

Signed-off-by: Petr Weinfurt <[email protected]>

* IT tests for safIdt endpoint.

Signed-off-by: Petr Weinfurt <[email protected]>

* Address code review comments.

Signed-off-by: Petr Weinfurt <[email protected]>

* Remove unused class

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix IT tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix unit tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Add Controller Advice to handle exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle more exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add negative tests with valid Okta token and no mapping.

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix Rest assured RequestSpec preparation.

Signed-off-by: Petr Weinfurt <[email protected]>

* Checkout the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Replace deprecated sonar.login property

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch depth 0

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle TokenNotValid and TokenExpired exception with 401 response.

Signed-off-by: Petr Weinfurt <[email protected]>

---------

Signed-off-by: Petr Weinfurt <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* Update CONTRIBUTING.md (#3206)

Add step-by-step instructions for contributing
Remove irelevant parts of the Retrospective

Signed-off-by: Jakub Balhar <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* fix: Fix of resource leak in loading of images in API Catalog (#3233)

Signed-off-by: Pavel Jares <[email protected]>

* chore: Upgrade of LogBack and Spring Boot (#3232)

Signed-off-by: Pavel Jares <[email protected]>

* update changelog

Signed-off-by: Pavel Jares <[email protected]>

* feat: Cloud Gateway SAF IDT auth scheme (#3234)

* chore: move babel to dev, modify webpack config, spring security

Signed-off-by: achmelo <[email protected]>

* read keys from common httpsconfig

Signed-off-by: achmelo <[email protected]>

* New ZAAS safIdt endpoint to generate SAF ID tokens for authenticated user.

Signed-off-by: Petr Weinfurt <[email protected]>

* IT tests for safIdt endpoint.

Signed-off-by: Petr Weinfurt <[email protected]>

* initial safidt filter impl

Signed-off-by: achmelo <[email protected]>

* Address code review comments.

Signed-off-by: Petr Weinfurt <[email protected]>

* Remove unused class

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix IT tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix unit tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Add Controller Advice to handle exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* refactor, unit tests

Signed-off-by: achmelo <[email protected]>

* Handle more exceptions.

Signed-off-by: Petr Weinfurt <[email protected]>

* safidt service in test

Signed-off-by: achmelo <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add content type and body to negative test.

Signed-off-by: Petr Weinfurt <[email protected]>

* Add negative tests with valid Okta token and no mapping.

Signed-off-by: Petr Weinfurt <[email protected]>

* Fix Rest assured RequestSpec preparation.

Signed-off-by: Petr Weinfurt <[email protected]>

* Checkout the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch the main branch before Sonar scan to resolve issue 'Could not find ref 'v2.x.x' in refs/heads, refs/remotes/upstream or refs/remotes/origin.'

Signed-off-by: Petr Weinfurt <[email protected]>

* Replace deprecated sonar.login property

Signed-off-by: Petr Weinfurt <[email protected]>

* Replace deprecated sonar.login property

Signed-off-by: Petr Weinfurt <[email protected]>

* remove git fetch

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch depth 0

Signed-off-by: Petr Weinfurt <[email protected]>

* Fetch depth 0

Signed-off-by: Petr Weinfurt <[email protected]>

* Add SAF IDT request to negative IT tests

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle TokenNotValid and TokenExpired exception with 401 response.

Signed-off-by: Petr Weinfurt <[email protected]>

* Handle TokenNotValid and TokenExpired exception with 401 response.

Signed-off-by: Petr Weinfurt <[email protected]>

* remove duplicated code

Signed-off-by: achmelo <[email protected]>

* delete unused imports

Signed-off-by: achmelo <[email protected]>

---------

Signed-off-by: achmelo <[email protected]>
Signed-off-by: Petr Weinfurt <[email protected]>
Co-authored-by: Petr Weinfurt <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* [skip ci] Update version

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] [skip ci] Before tag commit 'v2.13.2'.

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] Create new version: 'v2.13.3-SNAPSHOT'.

Signed-off-by: Pavel Jares <[email protected]>

* chore: support additional contents - catalog (#3215)

* add content mapping - wip

Signed-off-by: at670475 <[email protected]>

* fix slint

Signed-off-by: at670475 <[email protected]>

* embed medium blogs

Signed-off-by: at670475 <[email protected]>

* remove config

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* add expandable icons

Signed-off-by: at670475 <[email protected]>

* wip - use cases work

Signed-off-by: at670475 <[email protected]>

* format cases

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* open new tab for links

Signed-off-by: at670475 <[email protected]>

* embed internal doc

Signed-off-by: at670475 <[email protected]>

* adjusting based on the design decision

Signed-off-by: at670475 <[email protected]>

* fix css

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* fix window size

Signed-off-by: at670475 <[email protected]>

* fix css

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* fix margin between videos

Signed-off-by: at670475 <[email protected]>

* revert back

Signed-off-by: at670475 <[email protected]>

* fix label name

Signed-off-by: at670475 <[email protected]>

* add check for title and description

Signed-off-by: at670475 <[email protected]>

* disable link

Signed-off-by: at670475 <[email protected]>

* add tests

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* clean up of codea nd tests

Signed-off-by: at670475 <[email protected]>

* clean up

Signed-off-by: at670475 <[email protected]>

* increase default counter

Signed-off-by: at670475 <[email protected]>

* revert back tests

Signed-off-by: at670475 <[email protected]>

* add margin to blogs

Signed-off-by: at670475 <[email protected]>

* fix button

Signed-off-by: at670475 <[email protected]>

* support zowe doc tutorials

Signed-off-by: at670475 <[email protected]>

* fix testa

Signed-off-by: at670475 <[email protected]>

* fix test

Signed-off-by: at670475 <[email protected]>

* increase coverage

Signed-off-by: at670475 <[email protected]>

* reduce complexity

Signed-off-by: at670475 <[email protected]>

* fix code smells

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* fix code smells

Signed-off-by: at670475 <[email protected]>

* fix code smell

Signed-off-by: at670475 <[email protected]>

* fix bug

Signed-off-by: at670475 <[email protected]>

* add tests

Signed-off-by: at670475 <[email protected]>

* fix bug

Signed-off-by: at670475 <[email protected]>

* add test

Signed-off-by: at670475 <[email protected]>

* fix test

Signed-off-by: at670475 <[email protected]>

* refactoring

Signed-off-by: at670475 <[email protected]>

* fix test

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* optymize

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* add tests

Signed-off-by: at670475 <[email protected]>

* fix test

Signed-off-by: at670475 <[email protected]>

* add test

Signed-off-by: at670475 <[email protected]>

* add tests

Signed-off-by: at670475 <[email protected]>

* fix

Signed-off-by: at670475 <[email protected]>

* fix issue with description

Signed-off-by: at670475 <[email protected]>

* add test

Signed-off-by: at670475 <[email protected]>

* add test

Signed-off-by: at670475 <[email protected]>

---------

Signed-off-by: at670475 <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* chore: AT-TLS context configuration tests (#3236)

---------

Signed-off-by: Pablo Hernán Carle <[email protected]>
Co-authored-by: Pablo Hernán Carle <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>

* [skip ci] Update version

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] [skip ci] Before tag commit 'v2.13.3'.

Signed-off-by: Pavel Jares <[email protected]>

* [Gradle Release plugin] Create new version: 'v2.13.4-SNAPSHOT'.

Signed-off-by: Pavel Jares <[email protected]>

* DCO commit

Signed-off-by: Pavel Jares <[email protected]>

---------

Signed-off-by: Zowe Robot <[email protected]>
Signed-off-by: Pavel Jares <[email protected]>
Signed-off-by: Petr Weinfurt <[email protected]>
Signed-off-by: Jakub Balhar <[email protected]>
Signed-off-by: achmelo <[email protected]>
Signed-off-by: at670475 <[email protected]>
Signed-off-by: Pablo Hernán Carle <[email protected]>
Co-authored-by: Zowe Robot <[email protected]>
Co-authored-by: Pavel Jareš <[email protected]>
Co-authored-by: Petr Weinfurt <[email protected]>
Co-authored-by: Jakub Balhar <[email protected]>
Co-authored-by: Pavel Jareš <[email protected]>
Co-authored-by: achmelo <[email protected]>
Co-authored-by: Andrea Tabone <[email protected]>
Co-authored-by: Pablo Carle <[email protected]>
Co-authored-by: Pablo Hernán Carle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sensitive Sensitive change that requires peer review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants