Class ClientIdCredentials
java.lang.Object
org.gcube.documentstore.security.credentials.ClientIdCredentials
- All Implemented Interfaces:
org.gcube.common.security.credentials.Credentials,DocumentStoreCredential
The ClientIdCredentials class implements the DocumentStoreCredential interface
and provides methods to handle client ID and secret credentials for accessing
a document store.
This class includes methods for setting and getting the client ID and secret, as well as methods for obtaining contexts and secrets for specific contexts from a Keycloak client.
Annotations:
- @NotNull: Ensures that the annotated field is not null.
- @NotEmpty: Ensures that the annotated field is not empty.
Fields:
- clientID: The client ID used for authentication.
- secret: The secret associated with the client ID.
Methods:
- getClientID(): Returns the client ID.
- setClientID(String clientID): Sets the client ID.
- getSecret(): Returns the secret.
- setSecret(String secret): Sets the secret.
- hashCode(): Generates a hash code for the object.
- equals(Object obj): Compares this object with the specified object for equality.
- toString(): Returns a string representation of the object.
- getContexts(KeycloakClient client, String endpoint): Retrieves the contexts associated with the client ID and secret from the Keycloak client.
- getSecretForContext(KeycloakClient client, String endpoint, String context): Retrieves the secret for a specific context from the Keycloak client.
Logging:
- logger: Logs debug and error messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetContexts(org.gcube.common.keycloak.KeycloakClient client, String endpoint) org.gcube.common.security.secrets.SecretgetSecretForContext(org.gcube.common.keycloak.KeycloakClient client, String endpoint, String context) inthashCode()voidsetClientID(String clientID) voidtoString()
-
Constructor Details
-
ClientIdCredentials
public ClientIdCredentials()
-
-
Method Details
-
getClientID
-
setClientID
-
getSecret
-
setSecret
-
hashCode
public int hashCode() -
equals
-
toString
-
getContexts
- Specified by:
getContextsin interfaceDocumentStoreCredential
-
getSecretForContext
public org.gcube.common.security.secrets.Secret getSecretForContext(org.gcube.common.keycloak.KeycloakClient client, String endpoint, String context) - Specified by:
getSecretForContextin interfaceDocumentStoreCredential
-