Class ClientAdminController
java.lang.Object
com.irurueta.authserver.authorization.api.web.clients.ClientAdminController
- All Implemented Interfaces:
ClientsApi
Administration of the registered clients, as the contract
apis/auth-server/rest-server/auth-server-api-v1.yaml describes it through the generated ClientsApi.
Secrets are never returned, except once when a confidential client is created or its secret is rotated. Failures
are answered as problem details by ClientExceptionHandler.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientDtoMapperMaps between the generated DTOs and the domain.private final CreateClientUseCaseCreates clients.private final DeleteClientUseCaseDeletes clients.private final GetClientUseCaseFinds a client.private final ListClientsUseCaseLists the clients.private final RotateClientSecretUseCaseRotates client secrets.private final UpdateClientUseCaseUpdates clients.Fields inherited from interface com.irurueta.authserver.authorization.api.web.v1.generated.api.ClientsApi
PATH_CREATE_CLIENT, PATH_DELETE_CLIENT, PATH_GET_CLIENT, PATH_LIST_CLIENTS, PATH_ROTATE_CLIENT_SECRET, PATH_UPDATE_CLIENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<CreatedClientResponse> createClient(ClientRequest request) Creates a client.org.springframework.http.ResponseEntity<Void> deleteClient(String clientId) Deletes a client.org.springframework.http.ResponseEntity<ClientResponse> Finds a client.org.springframework.http.ResponseEntity<List<ClientResponse>> Lists the clients.org.springframework.http.ResponseEntity<ClientSecretResponse> rotateClientSecret(String clientId) Generates a new secret for a confidential client.org.springframework.http.ResponseEntity<ClientResponse> updateClient(String clientId, ClientRequest request) Replaces the definition of a client.
-
Field Details
-
listClientsUseCase
Lists the clients. -
getClientUseCase
Finds a client. -
createClientUseCase
Creates clients. -
updateClientUseCase
Updates clients. -
deleteClientUseCase
Deletes clients. -
rotateClientSecretUseCase
Rotates client secrets. -
clientDtoMapper
Maps between the generated DTOs and the domain.
-
-
Constructor Details
-
ClientAdminController
public ClientAdminController()
-
-
Method Details
-
listClients
Lists the clients.- Specified by:
listClientsin interfaceClientsApi- Returns:
- every client, without secrets.
-
getClient
Finds a client.- Specified by:
getClientin interfaceClientsApi- Parameters:
clientId- identifier of the client.- Returns:
- the client, without secret.
- Throws:
ClientNotFoundException- if no such client exists.
-
createClient
public org.springframework.http.ResponseEntity<CreatedClientResponse> createClient(ClientRequest request) Creates a client.- Specified by:
createClientin interfaceClientsApi- Parameters:
request- definition of the client.- Returns:
201 Createdwith the client and, when confidential, its generated secret (shown only once).
-
updateClient
public org.springframework.http.ResponseEntity<ClientResponse> updateClient(String clientId, ClientRequest request) Replaces the definition of a client. Its secret is kept.- Specified by:
updateClientin interfaceClientsApi- Parameters:
clientId- identifier of the client.request- new definition; its identifier must match the path.- Returns:
- the updated client.
- Throws:
IllegalArgumentException- if the identifier in the body differs from the path.
-
deleteClient
Deletes a client.- Specified by:
deleteClientin interfaceClientsApi- Parameters:
clientId- identifier of the client.- Returns:
204 No Content.
-
rotateClientSecret
public org.springframework.http.ResponseEntity<ClientSecretResponse> rotateClientSecret(String clientId) Generates a new secret for a confidential client.- Specified by:
rotateClientSecretin interfaceClientsApi- Parameters:
clientId- identifier of the client.- Returns:
- the new secret (shown only once).
-