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

Keycloak: Make realmName and clientScopeName customizable #9366

Merged
merged 5 commits into from
May 24, 2024

Conversation

gzsombor
Copy link
Member

@gzsombor gzsombor commented Mar 26, 2024

Fixes #8654

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4b064b4) to head (dd349c9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main     #9366   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity      2952      2945    -7     
===========================================
  Files            734       735    +1     
  Lines          12801     12824   +23     
  Branches         259       261    +2     
===========================================
+ Hits           12801     12824   +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pascalgrimaud
Copy link
Member

@gzsombor : something I wanted to tell you -> I'm really happy to see to here, in this project and doing contributions. Thanks so much for helping this project! ❤️

@gzsombor
Copy link
Member Author

@gzsombor : something I wanted to tell you -> I'm really happy to see to here, in this project and doing contributions. Thanks so much for helping this project! ❤️

That is really nice of you! I'm happy if I could help - and have enough time to do that :)

@gzsombor gzsombor force-pushed the realm-fix branch 2 times, most recently from 2776587 to 690a19a Compare March 26, 2024 21:22
@murdos murdos changed the title Fix #8654 : Make realmName and clientScopeName customizable Keycloak: Make realmName and clientScopeName customizable Mar 31, 2024
Assert.notBlank("slug", slug);

assertFormat(slug);
Assert.field("slug", slug).notBlank().urlSafeSingleWord(() -> new InvalidJHipsterSlugException(slug));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not very fond of this refactoring, I think we loose some expressiveness and ease of understanding.
I'd rather keep each pattern constant hidden in each class even if it looks like duplicated, and don't introduce custom exception generated by Assert.field(.., ..).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think, calling a function urlSafeSingleWord() with proper and javadoc is lightyear ahead more expressive than trying to decipher Pattern.compile("^[a-z0-9-]+$") or to check if two pattern are the same or not.
We could get rid of these custom InvalidJHipsterModuleTagException/ UrlSafeSingleWordException/InvalidJHipsterSlugException and just use a plain old IllegalArgumentException, that would help reducing the unnecessary verbosity.

@pascalgrimaud pascalgrimaud merged commit f923e31 into jhipster:main May 24, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keycloak: allow choosing realm name and client scope
3 participants