8000 Add organization admin crud events by mzvankovich · Pull Request #32358 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Add organization admin crud events - #32358

Closed
mzvankovich wants to merge 1 commit into
keycloak:mainfrom
mzvankovich:organization-admin-events
Closed

mzvankovich wants to merge 1 commit into
keycloak:mainfrom
mzvankovich:organization-admin-events

Conversation

@mzvankovich
@mzvankovich mzvankovich commented Aug 22, 2024 •
Copy link
Copy Markdown

Add organization admin crud events

Related #31421, #30180

@mzvankovich
mzvankovich requested review from a team as code owners August 22, 2024 18:38
@ahus1
ahus1 commented Aug 26, 2024
Copy link
Copy Markdown
Member

@pedroigor - this might be of interest for your team.

@mzvankovich
mzvankovich force-pushed the organization-admin-events branch 7 times, most recently from 18d5984 to ff9a185 Compare September 2, 2024 10:20
@ssilvert ssilvert left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

UI part approved.

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.forms.ResetPasswordTest#resetPasswordDisabledUser

Keycloak CI - Forms IT (chrome)

java.lang.AssertionError: Expected LoginPasswordResetPage but was Sign in to test (https://localhost:8543/auth/realms/test/protocol/openid-connect/auth?response_type=code&client_id=test-app&redirect_uri=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Fmaster%2Fapp%2Fauth&state=f450805e-93f3-4500-b363-ce91429ba7ea&scope=openid)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.pages.AbstractPage.assertCurrent(AbstractPage.java:47)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordExpiredCodeAndAuthSession

Keycloak CI - Forms IT (chrome)

java.lang.AssertionError: Expected LoginPasswordResetPage but was Sign in to test (https://localhost:8543/auth/realms/test/protocol/openid-connect/auth?response_type=code&client_id=test-app&redirect_uri=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Fmaster%2Fapp%2Fauth&state=dc32398e-7e0a-49c1-bad4-1ead48d11963&scope=openid)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.pages.AbstractPage.assertCurrent(AbstractPage.java:47)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

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

@mzvankovich
mzvankovich force-pushed the organization-admin-events branch 2 times, most recently from 8c637f8 to a6271a7 Compare September 4, 2024 15:33
Resolve keycloak#31421, resolve keycloak#30180

Signed-off-by: Maksim Zvankovich <m.zvankovich@rheagroup.com>
@mzvankovich
mzvankovich force-pushed the organization-admin-events branch from a6271a7 to 5b500dc Compare September 7, 2024 15:09
@ahus1
ahus1 commented Sep 9, 2024
Copy link
Copy Markdown
Member

@mzvankovich - While this is in review by a maintainer, there is no need to rebase your PR unless you see conflicts in your PR. A maintainer will automatically rebase it when it is merged to main. This avoid using CI resources unnecessarily. Thanks!

@sguilhen
sguilhen self-requested a review September 20, 2024 15:08
@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

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

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.WebAuthnPropertyTest#requiredActionRegistration

Keycloak CI - WebAuthn IT (chrome)

java.lang.AssertionError: Expected RegisterPage but was Sign in to test (https://localhost:8543/auth/realms/test/protocol/openid-connect/auth?response_type=code&client_id=test-app&redirect_uri=https%3A%2F%2Flocalhost%3A8543%2Fauth%2Frealms%2Fmaster%2Fapp%2Fauth&state=9869f279-b1fc-471d-a666-dd362eb1abce&scope=openid)
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at org.keycloak.testsuite.pages.AbstractPage.assertCurrent(AbstractPage.java:47)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

rep.setDomains(ofNullable(organization.getDomains()).orElse(Stream.of()).collect(Collectors.mapping(ModelToRepresentation::toRepresentation, Collectors.toUnmodifiableSet())));
rep.setIdentityProviders(ofNullable(organization.getIdentityProviders()).orElse(Stream.of()).collect(Collectors.mapping(provider -> toRepresentation(realm, provider), Collectors.toUnmodifiableList())));
return rep;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should leverage the methods in Organizations.java instead of having another set of toRepresentation methods.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@sguilhen thank you for the review. Ok. I'll move that mapping into Organizations.java.

@sguilhen
Copy link
Copy Markdown
Contributor

@mzvankovich Actually, put this on hold for a moment - I'm refactoring a few things to properly export/import the orgs (the whole thing about preserving the ids), and I'm moving some things around because the Organizations class is not reachable from the export utils atm. So I'll prob move the code the ModelToRepresentation like you did here.

8000

@sguilhen
Copy link
Copy Markdown
Contributor

@mzvankovich I've crafted this PR: #33244 - once it gets merged you should be able to rebase this PR (and also the other one that adds the id to the token).

The only change compared to your code is that the org rep doesn't include the idps by default, nor members. I don't think that should be a problem for the events as I personally would not include that info in the event - it makes the event more verbose and there's hardly any benefit in displaying the idps as the logged events have nothing to do with idps.

We could add events from when idps are linked/unlinked to an org, similarly to what you did for members, linking the event to the idp tab of the org, but it could be worked on in a follow up PR.

@sguilhen
Copy link
Copy Markdown
Contributor

@mzvankovich I am not able to push changes to your PR, so I've cherry-picked your changes and opened another PR to replace this one: #33281

@sguilhen
Copy link
Copy Markdown
Contributor

Closing in favor of #33281

@sguilhen sguilhen closed this Sep 25, 2024
@mzvankovich
mzvankovich deleted the organization-admin-events branch September 26, 2024 10:15
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.

6 participants

0