Class SecretsStoreConnector

All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension

public abstract class SecretsStoreConnector extends ConnectorBase implements org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
SecretsStoreConnector is the interface for a connector that is able to retrieve secrets (passwords, certificates, ...) from a secure location. The secrets store connector is embedded in a connector that needs one or more secrets to perform its tasks. Both connectors are initialised together by the ConnectorBroker. The secrets store connector is called by the surrounding connector to extract the needed secrets. When the ConnectorBroker detects that there is a secrets store connector embedded in another connector, it attempts to retrieve the standard secrets for the corresponding connection object (if they are null):
  • userId
  • clearPassword
  • encryptedPassword
This means that even if the outer connector is written to expect these secrets in its connection object, they do not need to be stored in the connection object (ie in the configuration document or in the metadata store) but will be placed in the right fields by the ConnectorBroker. If the name(s) of the secret(s) needed by the connector must be configured, they can be stored in the secureProperties.
  • Constructor Details

    • SecretsStoreConnector

      public SecretsStoreConnector()
  • Method Details

    • getConnectorComponentDescription

      public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • setAuditLog

      public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
      Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.
      Specified by:
      setAuditLog in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • start

      public void start() throws ConnectorCheckedException
      Indicates that the connector is completely configured and can begin processing.
      Overrides:
      start in class ConnectorBase
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
    • checkSecretsStillValid

      public void checkSecretsStillValid()
      Called by subclass to determine if the secrets should be refreshed
    • getSecret

      public abstract String getSecret(String secretName) throws ConnectorCheckedException
      Retrieve a secret from the secrets store.
      Parameters:
      secretName - name of the secret.
      Returns:
      secret
      Throws:
      ConnectorCheckedException
    • getRefreshTimeInterval

      public abstract long getRefreshTimeInterval() throws ConnectorCheckedException
      Retrieve the refresh time from the secrets store.
      Returns:
      how long the secrets can be cached - 0 means indefinitely
      Throws:
      ConnectorCheckedException - there is a problem with the connector