8000 Make required actions configurable (#28400) by thomasdarimont · Pull Request #28419 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,37 @@
/*
* Copyright 2024 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.keycloak.representations.idm;

import java.util.List;

/**
* Represents the configurable properties of a RequiredAction.
*/
public class RequiredActionConfigInfoRepresentation {

private List<ConfigPropertyRepresentation> properties;

public List<ConfigPropertyRepresentation> getProperties() {
return properties;
}

public void setProperties(List<ConfigPropertyRepresentation> properties) {
this.properties = properties;
}
}

8BD0
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2024 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.keycloak.representations.idm;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
* Represents the configuration of a RequiredAction.
*/
public class RequiredActionConfigRepresentation implements Serializable {

private Map<String, String> config = new HashMap<>();

public Map<String, String> getConfig() {
return config;
}

public void setConfig(Map<String, String> config) {
this.config = config;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.keycloak.representations.idm;

import java.util.HashMap;
import java.util.Map;

/**
Expand All @@ -32,8 +31,7 @@ public class RequiredActionProviderRepresentation {
private boolean enabled;
private boolean defaultAction;
private int priority;
private Map<String, String> config = new HashMap<>();

private Map<String, String> config;

public String getAlias() {
return alias;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ public String getProviderId() {
public void setProviderId(String providerId) {
this.providerId = providerId;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.keycloak.representations.idm.AuthenticatorConfigInfoRepresentation;
import org.keycloak.representations.idm.AuthenticatorConfigRepresentation;
import org.keycloak.representations.idm.ConfigPropertyRepresentation;
import org.keycloak.representations.idm.RequiredActionConfigInfoRepresentation;
import org.keycloak.representations.idm.RequiredActionConfigRepresentation;
import org.keycloak.representations.idm.RequiredActionProviderRepresentation;
import org.keycloak.representations.idm.RequiredActionProviderSimpleRepresentation;

Expand Down Expand Up @@ -177,6 +179,25 @@ public interface AuthenticationManagementResource {
@POST
void lowerRequiredActionPriority(@PathParam("alias") String alias);

@Path("required-actions/{alias}/config-description")
@GET
@Produces(MediaType.APPLICATION_JSON)
RequiredActionConfigInfoRepresentation getRequiredActionConfigDescription(@PathParam("alias") String alias);

@Path("required-actions/{alias}/config")
@GET
@Produces(MediaType.APPLICATION_JSON)
RequiredActionConfigRepresentation getRequiredActionConfig(@PathParam("alias") String alias);

@Path("required-actions/{alias}/config")
@DELETE
void removeRequiredActionConfig(@PathParam("alias") String alias);

@Path("required-actions/{alias}/config")
@PUT
@Consumes(MediaType.APPLICATION_JSON)
void updateRequiredActionConfig(@PathParam("alias") String alias, RequiredActionConfigRepresentation rep);

@Path("config-description/{providerId}")
@GET
@Produces(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ syncModes.inherit=继承
masterSamlProcessingUrlHelp=如果配置,则此 URL 将用于每个绑定到 SP 的断言消费者和单点注销服务。这可以在 Fine Grain SAML 端点配置中为每个绑定和服务单独覆写。
addedGroupMembershipError=添加群组成员身份时出错
authenticatorAttachment.platform=平台
configSaveSuccess=成功保存执行器的配置
configSaveSuccess=成功保存配置
regenerate=重新生成
ignoreMissingGroups=忽略缺失的群组
sslType.external=外部请求
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ syncModes.inherit=Inherit
masterSamlProcessingUrlHelp=If configured, this URL will be used for every binding to both the SP's Assertion Consumer and Single Logout Services. This can be individually overridden for each binding and service in the Fine Grain SAML Endpoint Configuration.
addedGroupMembershipError=Error adding group membership
authenticatorAttachment.platform=Platform
configSaveSuccess=Successfully saved the execution config
configSaveSuccess=Successfully saved the config
regenerate=Regenerate
ignoreMissingGroups=Ignore missing groups
sslType.external=External requests
Expand Down Expand Up @@ -732,6 +732,8 @@ client-updater-source-groups.label=Groups
frontchannelLogoutUrlHelp=URL that will cause the client to log itself out when a logout request is sent to this realm (via end_session_endpoint). If not provided, it defaults to the base url.
authenticationOverridesHelp=Override realm authentication flow bindings.
requiredActions=Required actions
requiredAction=Required action
requiredActionConfig=Configuration for {{name}}
selectLocales=Select locales
policyDecisionStagey=The decision strategy dictates how the policies associated with a given permission are evaluated and how a final decision is obtained. 'Affirmative' means that at least one policy must evaluate to a positive decision in order for the final decision to be also positive. 'Unanimous' means that all policies must evaluate to a positive decision in order for the final decision to be also positive. 'Consensus' means that the number of positive decisions must be greater than the number of negative decisions. If the number of positive and negative is the same, the final decision will be negative.
usermodel.prop.tooltip=Name of the property method in the UserModel interface. For example, a value of 'email' would reference the UserModel.getEmail() method.
Expand Down Expand Up @@ -922,7 +924,7 @@ eventTypes.OAUTH2_DEVICE_AUTH_ERROR.description=Oauth2 device authentication err
unlinkUsers=Unlink users
userLdapFilter=User LDAP filter
emailVerification=Email Verification
configSaveError=Could not save the execution config\: {{error}}
configSaveError=Could not save the config\: {{error}}
clientAuthenticatorTypeHelp=Client Authenticator used for authentication of this client against Keycloak server
cachePolicyHelp=Cache Policy for this storage provider. 'DEFAULT' is whatever the default settings are for the global cache. 'EVICT_DAILY' is a time of day every day that the cache will be invalidated. 'EVICT_WEEKLY' is a day of the week and time the cache will be invalidated. 'MAX_LIFESPAN' is the t 50E4 ime in milliseconds that will be the lifespan of a cache entry.
eventTypes.CUSTOM_REQUIRED_ACTION_ERROR.description=Custom required action error
Expand Down
Loading
0