Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mhajas
Copy link
Contributor

@mhajas mhajas commented May 4, 2022

…authz entities

Closes #11817

@mhajas mhajas added area/authorization-services Indicates an issue on Authorization area area/storage Indicates an issue that touches storage (change in data layout or data manipulation) team/storage-sig labels May 4, 2022
@mhajas mhajas requested review from pedroigor and vramik May 4, 2022 13:39
Copy link
Contributor

@vramik vramik 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 @mhajas, great job! I have just two minor comments.

Comment on lines 36 to 43
Copy link
Contributor

@vramik vramik May 5, 2022

Choose a reason for hiding this comment

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

I can see the parameter is used across all objects (legacy jpa adn infinispan adapters) within authz, not only for PermissionTickets. Shouldn't it rather be placed in e.g. AuthorizationProvider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. This should not be here, it is quite confusing. Maybe we should not have it in the server-spi* modules at all. A good place would be the module that will be introduced here: #10279, however this is not there yet. I think it would make sense to have it inside model/[jpa|infinispan] to make sure we do not use it anywhere else. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

It makes sense to me, I'd add a note to #10279 (as part of it) to move it into the new module. For now I believe it's ok to have it in infinispan module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking about this again. Maybe it makes even more sense to have it in infinispan/jpa modules rather than in the legacy. Let's leave it as is.

Please let me know once you see and agree with the commit I added so I can squash them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please let me know once you see and agree with the commit I added so I can squash them.

Please, go ahead, The PR LGTM!

Copy link
Contributor

@vramik vramik May 5, 2022

Choose a reason for hiding this comment

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

just nitpick:

Suggested change
policyStore.delete(realm, policy.getId());
policyStore.delete(removedClient.getRealm(), policy.getId());

it could be then avoided a creation of RealmModel object in some cases (e.g. when clients.isEmpty() == true) in this particular case.

If you decide to apply the suggestion, there is one more occurrence like this in RolePolicyProviderFactory.

@mhajas mhajas force-pushed the 11817-Make-sure-there-is-always-Realm-or-ResourceServer-when-searching-for-authz-entities branch from 3cdb755 to 6cff353 Compare May 5, 2022 11:04
@pedroigor pedroigor merged commit d3b43a9 into keycloak:main May 11, 2022
@mhajas mhajas deleted the 11817-Make-sure-there-is-always-Realm-or-ResourceServer-when-searching-for-authz-entities branch July 7, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/authorization-services Indicates an issue on Authorization area area/storage Indicates an issue that touches storage (change in data layout or data manipulation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure there is always Realm or ResourceServer when searching for authz entities

4 participants