KEYCLOAK-2880 Permissions tests for admin endpoints
This commit is contained in:
1 parent
7796bf3510
commit
2355db57da
32 files changed
+1228
-52
No files matched your search
+2
-4
@@ -60,7 +60,6 @@ public interface ClientAttributeCertificateResource {
|
||||
/**
|
||||
* Upload certificate and eventually private key
|
||||
*
|
||||
* @param uriInfo
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -68,12 +67,11 @@ public interface ClientAttributeCertificateResource {
|
||||
@Path("upload")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public CertificateRepresentation uploadJks(@Context final UriInfo uriInfo, MultipartFormDataInput input);
|
||||
public CertificateRepresentation uploadJks(MultipartFormDataInput input);
|
||||
|
||||
/**
|
||||
* Upload only certificate, not private key
|
||||
*
|
||||
* @param uriInfo
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
@@ -81,7 +79,7 @@ public interface ClientAttributeCertificateResource {
|
||||
@Path("upload-certificate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public CertificateRepresentation uploadJksCertificate(@Context final UriInfo uriInfo, MultipartFormDataInput input);
|
||||
public CertificateRepresentation uploadJksCertificate(MultipartFormDataInput input);
|
||||
|
||||
/**
|
||||
* Get a keystore file for the client, containing private key and public certificate
|
||||
|
||||
+31
@@ -18,8 +18,10 @@
|
||||
package org.keycloak.admin.client.resource;
|
||||
|
||||
import org.jboss.resteasy.annotations.cache.NoCache;
|
||||
import org.keycloak.representations.adapters.action.GlobalRequestResult;
|
||||
import org.keycloak.representations.idm.ClientRepresentation;
|
||||
import org.keycloak.representations.idm.CredentialRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.UserSessionRepresentation;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
@@ -99,6 +101,16 @@ public interface ClientResource {
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public List<UserSessionRepresentation> getUserSessions(@QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults);
|
||||
|
||||
@Path("offline-session-count")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Map<String, Long> getOfflineSessionCount();
|
||||
|
||||
@Path("offline-sessions")
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<UserSessionRepresentation> getOfflineUserSessions(@QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults);
|
||||
|
||||
@POST
|
||||
@Path("push-revocation")
|
||||
public void pushRevocation();
|
||||
@@ -109,4 +121,23 @@ public interface ClientResource {
|
||||
@Path("/roles")
|
||||
public RolesResource roles();
|
||||
|
||||
@Path("/service-account-user")
|
||||
@GET
|
||||
@NoCache
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
UserRepresentation getServiceAccountUser();
|
||||
|
||||
@Path("nodes")
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
void registerNode(Map<String, String> formParams);
|
||||
|
||||
@Path("nodes/{node}")
|
||||
@DELETE
|
||||
void unregisterNode(final @PathParam("node") String node);
|
||||
|
||||
@Path("test-nodes-available")
|
||||
@GET
|
||||
GlobalRequestResult testNodesAvailable();
|
||||
|
||||
}
|
||||
+2
-1
@@ -26,6 +26,7 @@ import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,5 +45,5 @@ public interface IdentityProvidersResource {
|
||||
@POST
|
||||
@Path("instances")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
void create(IdentityProviderRepresentation identityProvider);
|
||||
Response create(IdentityProviderRepresentation identityProvider);
|
||||
}
|
||||
+4
@@ -118,6 +118,10 @@ public interface UserResource {
|
||||
@Path("sessions")
|
||||
public List<UserSessionRepresentation> getUserSessions();
|
||||
|
||||
@GET
|
||||
@Path("offline-sessions/{clientId}")
|
||||
List<UserSessionRepresentation> getOfflineSessions(@PathParam("clientId") String clientId);
|
||||
|
||||
@GET
|
||||
@Path("federated-identity")
|
||||
public List<FederatedIdentityRepresentation> getFederatedIdentity();
|
||||
|
||||
Reference in new issue
Block a user