8000 Add missing null-checks to IdentityProviderResource by thomasdarimont · Pull Request #38939 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add missing null-checks to IdentityProviderResource #38939

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ public ManagementPermissionReference getManagementPermissions() {
ProfileHelper.requireFeature(Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ);
this.auth.realm().requireViewIdentityProviders();

if (identityProviderModel == null) {
throw new jakarta.ws.rs.NotFoundException();
}

AdminPermissionManagement permissions = AdminPermissions.management(session, realm);
if (!permissions.idps().isPermissionsEnabled(identityProviderModel)) {
return new ManagementPermissionReference();
Expand Down Expand Up @@ -477,6 +481,11 @@ public ManagementPermissionReference setManagementPermissionsEnabled(ManagementP
ProfileHelper.requireFeature(Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ);
this.auth.realm().requireManageIdentityProviders();
AdminPermissionManagement permissions = AdminPermissions.management(session, realm);

if (identityProviderModel == null) {
throw new jakarta.ws.rs.NotFoundException();
}

permissions.idps().setPermissionsEnabled(identityProviderModel, ref.isEnabled());
if (ref.isEnabled()) {
return toMgmtRef(identityProviderModel, permissions);
Expand All @@ -493,6 +502,11 @@ public ManagementPermissionReference setManagementPermissionsEnabled(ManagementP
@Operation(summary = "Reaload keys for the identity provider if the provider supports it, \"true\" is returned if reload was performed, \"false\" if not.")
public boolean reloadKeys() {
this.auth.realm().requireManageIdentityProviders();

if (identityProviderModel == null) {
throw new jakarta.ws.rs.NotFoundException();
}

IdentityProvider<?> provider = IdentityBrokerService.getIdentityProvider(session, identityProviderModel.getAlias());
return provider.reloadKeys();
}
Expand Down
Loading
0