Skip to content

v1.0.0

Latest

Choose a tag to compare

@lsariol lsariol released this 05 Oct 16:56
· 1 commit to main since this release

v1.0.0

Upgrading from v0.2.0 needs small code changes: New takes two arguments, and Bootstrap() is gone (see Removed). It also needs Cove v1.0.0 and a project token. What behaves differently is listed first.

Behaviour changes

  • Requests time out after 15 seconds (WithTimeout to change it) instead of waiting forever.
  • The client uses its own http.Client: settings made on http.DefaultClient no longer apply (use WithHTTPClient). Redirects aren't followed.
  • Error text keeps Unexpected Status N and adds Cove's explanation after it: ... Unexpected Status 404: not_found: secret not found.
  • Keys are checked before anything is sent; ?, # or ../ in a key can no longer reach a different URL.

Added

  • APIError and sentinel errors for errors.Is: ErrNotFound, ErrUnauthorized, ErrForbidden, ErrAlreadyExists, ErrInvalidKey, ErrBootstrapClosed.
  • ...Context versions of every method.
  • GetSecrets(keys...): several secrets in one request (Cove's POST /v0/batch), naming every missing key.
  • LoadOrBootstrap(path): onboarding in one call (reads a saved token, or fetches and saves it safely).
  • WaitForReady(ctx): waits until Cove and its database are up.
  • ValidateKey, WithTimeout, WithHTTPClient, doc comments, examples, and CI on Go 1.21 and the latest Go.

Removed

  • Bootstrap() and the SecretValue type. Use LoadOrBootstrap(path), which also saves the token and sets it on the client.
  • The platform name: New(baseURL, token) replaces New(baseURL, clientSecret, platformName), and Client.Platform is gone. Cove 1.0 records a request under its token's name, so X-Cove-Source is no longer sent.
  • Client.ClientSecret is now Client.Token.

Works with

Cove v1.0.0 and later. It doesn't support Cove v0.2.0: upgrade Cove first, then the client.