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

Added support for disabling /auth context path. Resolves #126 #143

Merged
merged 7 commits into from Jun 13, 2023

Conversation

kilmajster
Copy link
Contributor

Hi, I've added support for disabling or overriding /auth context path so that mock can be used with Keycloak 18.0.0+

Issue: TNG#126
Signed-off-by: kilmajster <lukasz.createam@gmail.com>
@kilmajster kilmajster changed the title Added support for disabling /auth context path. Resolves #126 Added support for disabling /auth context path. Resolves https://github.com/TNG/keycloak-mock/issues/126 Jun 5, 2023
@kilmajster kilmajster changed the title Added support for disabling /auth context path. Resolves https://github.com/TNG/keycloak-mock/issues/126 Added support for disabling /auth context path. Resolves #126 Jun 5, 2023
Issue: TNG#126
Signed-off-by: kilmajster <lukasz.createam@gmail.com>
…description.

Issue: TNG#126
Signed-off-by: kilmajster <lukasz.createam@gmail.com>
Issue: TNG#126
Signed-off-by: kilmajster <lukasz.createam@gmail.com>
Copy link
Contributor

@ostrya ostrya left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. In general I like the proposal. But please check your commits against the google formatter (e.g. by using the pre-commit hook).

Issue: TNG#126
Signed-off-by: kilmajster <lukasz.createam@gmail.com>
@kilmajster
Copy link
Contributor Author

Thanks for the remarks @ostrya, I pushed my updates, please have a look :)

Copy link
Contributor

@ostrya ostrya left a comment

Choose a reason for hiding this comment

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

Sorry for not noticing it last time, just two tiny remarks. Otherwise looks good now.

@@ -301,6 +301,7 @@ void unexpected_issuer_causes_exception() {
Builder builder = aTokenConfig();
assertThatThrownBy(() -> builder.withSourceToken(TOKEN_WITH_UNEXPECTED_ISSUER_URL))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("did not conform to the expected format");
.hasMessageContaining("did not conform to the expected format")
.hasMessageContaining("'http[s]://$HOSTNAME[:port][:contextPath]/realms/$REALM'");
Copy link
Contributor

Choose a reason for hiding this comment

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

The colon in front of port was not meant as an indicator for parameter replacement but as part of the string, e.g. ":8080". Thus, I'd prefix the context path with a slash instead. To make it more clear, I think we can also use the same variable replacement syntax as for the hostname and the realm:

Suggested change
.hasMessageContaining("'http[s]://$HOSTNAME[:port][:contextPath]/realms/$REALM'");
.hasMessageContaining("'http[s]://$HOSTNAME[:$PORT][/$CONTEXT_PATH]/realms/$REALM'");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the explanation, now this format makes more sense.

Signed-off-by: Kai Helbig <kai.helbig@tngtech.com>
Signed-off-by: Kai Helbig <kai.helbig@tngtech.com>
@kilmajster
Copy link
Contributor Author

I can see you already applied those suggestions, that's great! So I guess it's good to go now? 😄

@ostrya ostrya merged commit b5ddf55 into TNG:main Jun 13, 2023
4 checks passed
@ostrya
Copy link
Contributor

ostrya commented Jun 13, 2023

Yes, just forgot to click merge because I wanted to wait for the checks to get green.

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.

None yet

2 participants