-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Conversation
...er/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactory.java
Outdated
Show resolved
Hide resolved
9787d56
to
7bd8569
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
...er/lite/generator/server/springboot/mvc/security/oauth2/core/domain/OAuth2ModuleFactory.java
Show resolved
Hide resolved
@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 :) |
2776587
to
690a19a
Compare
Assert.notBlank("slug", slug); | ||
|
||
assertFormat(slug); | ||
Assert.field("slug", slug).notBlank().urlSafeSingleWord(() -> new InvalidJHipsterSlugException(slug)); |
There was a problem hiding this comment.
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(.., ..)
.
There was a problem hiding this comment.
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.
Fixes #8654