Interface AuthorizationProvider


public interface AuthorizationProvider
Provides a contract for retrieving authorization secrets and credentials. This interface is designed to support different authorization contexts.
  • Method Details

    • getContexts

      Set<String> getContexts()
      Retrieves the set of all available authorization contexts. Each context typically corresponds to a specific service or environment for which a secret is available.
      Returns:
      a Set<String> containing all known contexts. Returns an empty set if no contexts are available.
    • getSecretForContext

      Secret getSecretForContext(String context)
      Retrieves the secret for a given authorization context. The secret is provided as a Secret object, which encapsulates the sensitive data in a secure way.
      Parameters:
      context - the specific authorization context for which the secret is required.
      Returns:
      a Secret object for the specified context. Returns null if the context does not exist or no secret is associated with it.
    • getCredentials

      @Deprecated Credentials getCredentials()
      Deprecated.
      Use getSecretForContext(String) instead. This method will be removed in a future version.
      Retrieves generic credentials for authorization. This method is **deprecated** and should be avoided in new code. The preferred approach is to use getSecretForContext(String) to retrieve secrets on a per-context basis for better security and specificity.
      Returns:
      a Credentials object.