-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Initial Client API v2 impl #43395
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
Initial Client API v2 impl #43395
Conversation
b15fc7c to
ade8e04
Compare
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.account.WebAuthnSigningInTest#setUpLinksTestKeycloak CI - WebAuthn IT (firefox) |
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.account.WebAuthnSigningInTest#setUpLinksTestKeycloak CI - WebAuthn IT (firefox) |
|
Keeping as individual commits for the sake of review. Will squash it before merge. |
mabartos
left a comment
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.
@vmuzikar LGTM.
When tests passed, I'm ok to merge it. Some polishing and improvement will be done in follow-up tasks.
Not sure if these commits should be squashed, as there are some contextually different pieces of code - but leaving the final decision up to you.
server-spi/src/main/java/org/keycloak/models/KeycloakSession.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
| <dependency> | ||
| <groupId>org.glassfish.expressly</groupId> | ||
| <artifactId>expressly</artifactId> | ||
| <version>${expressly.version}</version> | ||
| </dependency> |
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.
This dependency needs approval from the CNCF since it's EPL 2.0. We can merge without approval from the CNCF, but would need to get an exception at some point, ideally before the release.
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.
Created follow-up task:
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.
The dependency has been removed for now.
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.
Actually it was not removed as it's a transitive dependency of Hibernate Validator.
| Set the number of users per file. It is used only if 'users' is set to | ||
| 'different_files'. Default: 50. | ||
|
|
||
| OpenAPI configuration (Experimental): |
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.
Shouldn't these just be features rather than CLI config options?
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.
Not really IMHO. It's similar to metrics or health endpoints, we do too have config options for those.
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.
Don't get why - we have features that can be enabled/disabled, why is there a need for a separate CLI option to do the same?
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.
This also means these won't be listed on https://www.keycloak.org/server/features; and not consistent with other features/capabilities. What about if we have different versions of this in the future, etc, etc. There are reasons why we have features and want to make this stuff consistent.
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.
Resolved, OpenAPI is a feature but I kept the options (which are not marked as experimental any more).
| @QueryParam("fieldValidation") FieldValidation fieldValidation); | ||
|
|
||
| @PATCH | ||
| @Consumes({MediaType.APPLICATION_JSON_PATCH_JSON, CONTENT_TYPE_MERGE_PATCH}) |
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.
So we support only application/json-patch+json, but not a basic patch? Seems the wrong way around when it comes to priorities
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.
but not a basic patch
That's the application/merge-patch+json. We'll need to remove application/json-patch+json as that's the "smart" PATCH that is out of scope of the MVP. I'll create a separate commit to remove it.
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.
cc: @shawkins
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'll create a separate commit to remove it.
Actually, decided to do it rather as a follow-up. Let's keep this PR as close as possible to the prototype.
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.
rest/admin-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2Test.java
Show resolved
Hide resolved
| } | ||
|
|
||
| @Path("v2") | ||
| public AdminApi adminApi() { |
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.
We explicitly don't want versioning on the Admin API as whole; but rather on each distinct API.
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.
Created follow-up issue:
But we need to discuss it within our SIG.
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.
This is really not open to discussion; we need to break the massive Admin API into distinct separate and smaller APIs.
mabartos
left a comment
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.
LGTM as the initial implementation - the main concerns/issues were addressed and for other minor issues, follow-up tasks were created.
…ation (keycloak#41110) Signed-off-by: Martin Bartoš <[email protected]> Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Robin Meese <[email protected]> Signed-off-by: Václav Muzikář <[email protected]> # Conflicts: # quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMappers.java # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelpAll.approved.txt # quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelpAll.approved.txt
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
Signed-off-by: Václav Muzikář <[email protected]>
8b05860 to
be03072
Compare
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.actions.RequiredActionUpdateProfileTest#updateProfileWithoutRemoveCustomAttributesKeycloak CI - Forms IT (firefox) |
Signed-off-by: Václav Muzikář <[email protected]>
|
|
||
| find . -path '**/src/test/java' -type d \ | ||
| | grep -v -E '\./(docs|distribution|misc|operator|tests|testsuite|test-framework|quarkus)/' \ | ||
| | grep -v -E '\./(docs|distribution|misc|operator|((.+/)?tests)|testsuite|test-framework|quarkus)/' \ |
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.
This is to exclude the Admin v2 IT from running as UT. Decided to do it in more generic way – I assume if a module is called tests it's somewhere executed as IT.
The output before:
adapters/saml/core,adapters/saml/wildfly/wildfly-subsystem,authz/client,common,core,crypto/default,crypto/elytron,crypto/fips1402,federation/kerberos,federation/ldap,integration/client-cli/admin-cli,model/infinispan,model/jpa,model/storage-private,saml-core,server-spi,server-spi-private,services%
After:
adapters/saml/core,adapters/saml/wildfly/wildfly-subsystem,authz/client,common,core,crypto/default,crypto/elytron,crypto/fips1402,federation/kerberos,federation/ldap,integration/client-cli/admin-cli,model/infinispan,model/jpa,model/storage-private,rest/admin-v2/tests,saml-core,server-spi,server-spi-private,services%
All blocking comments were resolved.
Closes #43224