Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-16805 Client Policy : Support New Admin REST API (Implementa…
…tion) (#7780) * KEYCLOAK-16805 Client Policy : Support New Admin REST API (Implementation) * support tests using auth-server-quarkus * Configuration changes for ClientPolicyExecutorProvider * Change VALUE of table REALM_ATTRIBUTES to NCLOB * add author tag * incorporate all review comments Co-authored-by: mposolda <mposolda@gmail.com>
- Loading branch information
Showing
102 changed files
with
5,354 additions
and
1,857 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
core/src/main/java/org/keycloak/representations/idm/ClientPoliciesRepresentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2021 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; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Client Policies' (the set of all Client Policy) external representation class | ||
* | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ClientPoliciesRepresentation { | ||
protected List<ClientPolicyRepresentation> policies; | ||
|
||
public List<ClientPolicyRepresentation> getPolicies() { | ||
return policies; | ||
} | ||
|
||
public void setPolicies(List<ClientPolicyRepresentation> policies) { | ||
this.policies = policies; | ||
} | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
core/src/main/java/org/keycloak/representations/idm/ClientPolicyRepresentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright 2021 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; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Client Policy's external representation class | ||
* | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ClientPolicyRepresentation { | ||
|
||
protected String name; | ||
protected String description; | ||
protected Boolean builtin; | ||
protected Boolean enable; | ||
protected List<Object> conditions; | ||
protected List<String> profiles; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Boolean isBuiltin() { | ||
return builtin; | ||
} | ||
|
||
public void setBuiltin(Boolean builtin) { | ||
this.builtin = builtin; | ||
} | ||
|
||
public Boolean isEnable() { | ||
return enable; | ||
} | ||
|
||
public void setEnable(Boolean enable) { | ||
this.enable = enable; | ||
} | ||
|
||
public List<Object> getConditions() { | ||
return conditions; | ||
} | ||
|
||
public void setConditions(List<Object> conditions) { | ||
this.conditions = conditions; | ||
} | ||
|
||
public List<String> getProfiles() { | ||
return profiles; | ||
} | ||
|
||
public void setProfiles(List<String> profiles) { | ||
this.profiles = profiles; | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
core/src/main/java/org/keycloak/representations/idm/ClientProfileRepresentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright 2021 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; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Client Profile's external representation class | ||
* | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ClientProfileRepresentation { | ||
|
||
protected String name; | ||
protected String description; | ||
protected Boolean builtin; | ||
protected List<Object> executors; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Boolean isBuiltin() { | ||
return builtin; | ||
} | ||
|
||
public void setBuiltin(Boolean builtin) { | ||
this.builtin = builtin; | ||
} | ||
|
||
public List<Object> getExecutors() { | ||
return executors; | ||
} | ||
|
||
public void setExecutors(List<Object> executors) { | ||
this.executors = executors; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
core/src/main/java/org/keycloak/representations/idm/ClientProfilesRepresentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2021 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; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Client Profiles' (the set of all Client Profile) external representation class | ||
* | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ClientProfilesRepresentation { | ||
protected List<ClientProfileRepresentation> profiles; | ||
|
||
public List<ClientProfileRepresentation> getProfiles() { | ||
return profiles; | ||
} | ||
|
||
public void setProfiles(List<ClientProfileRepresentation> profiles) { | ||
this.profiles = profiles; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ient/src/main/java/org/keycloak/admin/client/resource/ClientPoliciesPoliciesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.keycloak.admin.client.resource; | ||
|
||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.PUT; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
import org.jboss.resteasy.annotations.cache.NoCache; | ||
|
||
/** | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
public interface ClientPoliciesPoliciesResource { | ||
|
||
@GET | ||
@NoCache | ||
@Produces(MediaType.APPLICATION_JSON) | ||
String getPolicies(); | ||
|
||
@PUT | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
Response updatePolicies(final String json); | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...ient/src/main/java/org/keycloak/admin/client/resource/ClientPoliciesProfilesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.keycloak.admin.client.resource; | ||
|
||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.PUT; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
import org.jboss.resteasy.annotations.cache.NoCache; | ||
|
||
/** | ||
* @author <a href="mailto:takashi.norimatsu.ws@hitachi.com">Takashi Norimatsu</a> | ||
*/ | ||
public interface ClientPoliciesProfilesResource { | ||
|
||
@GET | ||
@NoCache | ||
@Produces(MediaType.APPLICATION_JSON) | ||
String getProfiles(); | ||
|
||
@PUT | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
Response updateProfiles(final String json); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.