Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Defaults = defaults{
AllowCIDR: "10.0.0.0/24",
BitsizeRSA: 2048,
}
var OnePasswordVar = "LOCKET_OP_SERVICE_ACCOUNT_TOKEN"
1password service account token environment variable name
Functions ¶
func NewPairEd25519 ¶
NewPairEd25519 generates a new Ed25519 key pair used to authenticate clients requests to the server. Returns: publicKeyPEM, privateKeyPEM, error.
func Register ¶ added in v0.8.0
Register reads the existing registry file, upserts service key, and rewrites. If the registry file does not exist, it will be created. If no registry for the named service exists, a new entry will be created. An existing entry for the named service will be updated with new public key. Each new call of Register will generate new key pair, returning: public key, private key, or any error.
func WriteRegistry ¶
WriteRegistry creates a yaml file with a registry of allowed clients.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes requests to a locket server, and must know the server address. serverPubkey is the server's encryption public key, and will be fetched on creation of NewClient(). Rsa and Ed25519 key pairs are also generated on creation of NewClient().
func NewClient ¶
NewClient creates a new client, fetches the server's encryption public key, and generates RSA key pairs for encrypting k/v secret requests.
Pre-computed ed25519 signing keys (via NewPairEd25519() or any other means) must be passed to a new client, with the expectation that the public key be made available to the server to facilitate authentication. see: WriteRegistry() for details
type Dotenv ¶ added in v0.0.2
type Dotenv struct {
Path string // path to .env file to read
ServiceSecrets map[string][]string // service names and a list of their secrets
}
Dotenv satisfies the source interface, loading secrets from a specified path to .env file.
type Env ¶ added in v0.2.1
type Env struct {
ServiceSecrets map[string][]string // service name mapped to list of service secret names
}
Env satisfies the source interface, loading secrets from the local environment.
type KeysPrivateSigning ¶ added in v0.2.0
map[serviceName]keyPrivateSigning
type Onepass ¶ added in v0.0.2
type Onepass struct {
Vault string // name of the vault containig service secrets
}
Onepass satisfies the source interface, loading secrets from a 1password vault over the net with 1password API. Service account token must be set environment as locket.OnePasswordVar.
type RegEntry ¶
RegEntry is a single registry item, representing a single client which the server should recognize and authorize
func ReadRegistryFile ¶ added in v0.3.0
ReadRegistryFile turns a yaml file into a list of RegEntry for use in server authenticating client requests.
func UnmarshalRegistry ¶ added in v0.8.0
UnmarshalRegistry turns a byte slice into a list of RegEntry for use in server authenticating client requests. Bytes format easier for embed.FS