componentized/directory

componentized:services

interface

interface credential-admin componentized:services/credential-admin

Credential Admins manage the credentials for a binding. The platform typically implements this interface keeping the implementation details of credential storage hidden from the service lifecycle and users.

Some clients are not able to support rotating credentials. For those clients, creating a new binding is recommended. Once the previous credentials are no longer in use, the old binding can be unbound.

Types

use type service-binding-id

from componentized:services/types

  • string

use record credential

from componentized:services/types

  • key: string
  • value: string

use type error

from componentized:services/types

  • string

Functions

functionpublish: func( binding-id: service-binding-id, credentials: list<credential>, ) -> result<_, error>

Publish new or refreshed credentials to the store for use by the service binding. When rotating credentials, the previously valid credentials should be revoked after calling publish with the new credentials.

functiondestroy: func(binding-id: service-binding-id) -> result<_, error>

Destroy credentials previously published for a binding. Valid credentials should be revoked before calling destroy.

WIT

/// Credential Admins manage the credentials for a binding. The platform typically implements this
/// interface keeping the implementation details of credential storage hidden from the service
/// lifecycle and users.
///
/// Some clients are not able to support rotating credentials. For those clients, creating a new
/// binding is recommended. Once the previous credentials are no longer in use, the old binding can
/// be unbound.
interface credential-admin {
  use types.{service-binding-id, credential, error};

  /// Publish new or refreshed credentials to the store for use by the service binding. When
  /// rotating credentials, the previously valid credentials should be revoked after calling
  /// publish with the new credentials.
  publish: func(binding-id: service-binding-id, credentials: list<credential>) -> result<_, error>;

  /// Destroy credentials previously published for a binding. Valid credentials should be revoked
  /// before calling destroy.
  destroy: func(binding-id: service-binding-id) -> result<_, error>;
}