secrets

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package secrets encrypts the credentials GoHead keeps for other services (the tokens of connected apps), with a key derived from the instance's jwt_secret.

Without a key (jwt_secret not set, so each process would pick a different one), values are stored as they are: encrypting them with a key no other process knows, and that the next start forgets, would lose them.

Index

Constants

This section is empty.

Variables

View Source
var ErrUndecryptable = errors.New("cannot decrypt a stored secret: jwt_secret changed since it was saved; enter it again")

ErrUndecryptable is returned for a value encrypted with another key: the jwt_secret changed since it was stored.

Functions

func Enabled

func Enabled() bool

Enabled reports whether values are encrypted.

func Open

func Open(stored string) (string, error)

Open returns the plain value of a stored one.

func Seal

func Seal(plain string) (string, error)

Seal returns the value to store for plain: encrypted when a key is set.

func SetKey

func SetKey(material string) error

SetKey derives the encryption key from material (the jwt_secret). An empty material removes the key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL