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

fix: zaas client supports v2 compatibility with both gateway endpoint base Url paths #2227

Merged
merged 2 commits into from
Mar 30, 2022

Conversation

AmandaDErrico
Copy link
Contributor

@AmandaDErrico AmandaDErrico commented Mar 25, 2022

Signed-off-by: Amanda D'Errico [email protected]

Description

Users can now have both paths api/v1/gateway/auth and gateway/api/v1/auth be compatible with Zowe v2.x.x. If the old api/v1/gateway/auth is provided for apiml.gatewayAuthEndpoint, update that to gateway/api/v1/auth before initializing the ZaasClientImpl constructor.

Linked to # (2182)

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
  • I have performed a self-review of my own code
  • 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

@AmandaDErrico AmandaDErrico force-pushed the apiml/GH2182/zaas_client_v2_compatibility branch from 33b9a7e to 7e02681 Compare March 25, 2022 20:30
@pull-request-size pull-request-size bot added size/S and removed size/L labels Mar 28, 2022
@AmandaDErrico AmandaDErrico changed the title zaas client supports v2 compatibility with updated path fix: zaas client supports v2 compatibility with updated path Mar 28, 2022
@AmandaDErrico AmandaDErrico changed the title fix: zaas client supports v2 compatibility with updated path fix: zaas client supports v2 compatibility with both gateway endpoint base Url paths Mar 28, 2022
@AmandaDErrico AmandaDErrico force-pushed the apiml/GH2182/zaas_client_v2_compatibility branch from 165a181 to 2467bf0 Compare March 28, 2022 18:35
Copy link

@recaph recaph left a comment

Choose a reason for hiding this comment

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

I believe line 20 expects that REST API service is hosted on the same host as Gateway server.. instead it could default to apiml.service.customMetadata.apiml.gatewayHostname (similar to how gateway port) ..

@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 29, 2022

@ParameterizedTest
@ValueSource(strings = {"/api/v1/gateway/auth", "api/v1/gateway/auth", "/gateway/api/v1/auth", "gateway/api/v1/auth"})
void transformOrDontChangeZoweV2BaseUrl(String baseUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

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

given_when_then format for unit tests :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@AmandaDErrico AmandaDErrico force-pushed the apiml/GH2182/zaas_client_v2_compatibility branch from 07611ac to 0fa4f7b Compare March 30, 2022 13:43
@AmandaDErrico
Copy link
Contributor Author

I believe line 20 expects that REST API service is hosted on the same host as Gateway server.. instead it could default to apiml.service.customMetadata.apiml.gatewayHostname (similar to how gateway port) ..

Hello, please raise this in a new ticket.

@sonarcloud
Copy link

sonarcloud bot commented Mar 30, 2022

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

@AmandaDErrico AmandaDErrico merged commit abdf995 into master Mar 30, 2022
@delete-merged-branch delete-merged-branch bot deleted the apiml/GH2182/zaas_client_v2_compatibility branch March 30, 2022 14:00
AmandaDErrico added a commit that referenced this pull request Mar 30, 2022
… base Url paths (#2227)

* zaas client supports v2 compatibility with updated path

Signed-off-by: Amanda D'Errico <[email protected]>

* addressed code review

Signed-off-by: Amanda D'Errico <[email protected]>
AmandaDErrico added a commit that referenced this pull request Apr 6, 2022
… base Url paths (#2227)

* zaas client supports v2 compatibility with updated path

Signed-off-by: Amanda D'Errico <[email protected]>

* addressed code review

Signed-off-by: Amanda D'Errico <[email protected]>
AmandaDErrico added a commit that referenced this pull request Apr 6, 2022
… base Url paths (#2227)

* zaas client supports v2 compatibility with updated path

Signed-off-by: Amanda D'Errico <[email protected]>

* addressed code review

Signed-off-by: Amanda D'Errico <[email protected]>
AmandaDErrico added a commit that referenced this pull request Apr 6, 2022
…r zaas client (#2241)

* fix: zaas client supports v2 compatibility with both gateway endpoint base Url paths (#2227)

* zaas client supports v2 compatibility with updated path

Signed-off-by: Amanda D'Errico <[email protected]>

* addressed code review

Signed-off-by: Amanda D'Errico <[email protected]>

* chore: improved testing for zaas client compatibility for both v1 and v2 base urls (#2239)

Signed-off-by: Amanda D'Errico <[email protected]>

* old path pattern added back for auth endpoints

Signed-off-by: Amanda D'Errico <[email protected]>

* add previous v1 base url support into integration-tests/.../authentication classes

Signed-off-by: Amanda D'Errico <[email protected]>

* addressed code review

Signed-off-by: Amanda D'Errico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants