Class ClientDtoMapper
java.lang.Object
com.irurueta.authserver.authorization.api.web.clients.ClientDtoMapper
Maps between the DTOs generated from the contract and the client registrations of the domain, so a domain model is
never returned from
ClientAdminController.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientJwksParserValidates the JWK sets of the clients. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoCreatedResponse(CreatedClient created) Maps a created client: its public view and, for a confidential one, its secret (shown only once).toRegistration(ClientRequest request) Maps a create or update request to a client registration.toResponse(ClientRegistration registration) Maps a registration to its public view, which never contains a secret.toResponses(List<ClientRegistration> registrations) Maps several registrations, keeping their order.toSecretResponse(String clientSecret) Maps a rotated secret (shown only once).
-
Field Details
-
jwksParser
Validates the JWK sets of the clients.
-
-
Constructor Details
-
ClientDtoMapper
public ClientDtoMapper()
-
-
Method Details
-
toRegistration
Maps a create or update request to a client registration. An absent flag isfalse, absent audiences are empty (the client identifier is then used), absent post-logout redirect URIs are empty and an absent or blank format is "self-contained".- Parameters:
request- the validated request.- Returns:
- the registration.
- Throws:
IllegalArgumentException- if the registration is not valid.InvalidClientJwksException- if the JWK set is invalid or holds a private key.
-
toResponse
Maps a registration to its public view, which never contains a secret.- Parameters:
registration- the registration.- Returns:
- its public view.
-
toResponses
Maps several registrations, keeping their order.- Parameters:
registrations- the registrations.- Returns:
- their public views.
-
toCreatedResponse
Maps a created client: its public view and, for a confidential one, its secret (shown only once).- Parameters:
created- the created client.- Returns:
- the answer to the creation.
-
toSecretResponse
Maps a rotated secret (shown only once).- Parameters:
clientSecret- the new secret in clear text.- Returns:
- the answer to the rotation.
-