Documentation
¶
Index ¶
- func DiscoverOrCreateVault(store storage.Provider, namespace string) (string, error)
- func EncodeDeployKey(dk *DeployKeyToken) (string, error)
- func MarshalEnvelopes(envelopes map[string]Envelope) ([]byte, error)
- func Now() string
- func UnmarshalEnvelopes(data []byte) (map[string]Envelope, error)
- func WriteVaultConfig(store storage.Provider, vaultRepo, repoName string, vc *VaultConfig) error
- type ApprovedUser
- type DeployKey
- type DeployKeyToken
- type Envelope
- type PendingRequest
- type RepoMarker
- type VaultConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverOrCreateVault ¶
DiscoverOrCreateVault finds an existing vault repo or creates one. Returns the repo name (not the full owner/name path).
func EncodeDeployKey ¶
func EncodeDeployKey(dk *DeployKeyToken) (string, error)
EncodeDeployKey encodes a deploy key token to an opaque string.
func MarshalEnvelopes ¶
MarshalEnvelopes serializes envelopes to JSON.
func UnmarshalEnvelopes ¶
UnmarshalEnvelopes deserializes envelopes from JSON.
func WriteVaultConfig ¶
func WriteVaultConfig(store storage.Provider, vaultRepo, repoName string, vc *VaultConfig) error
WriteVaultConfig writes vault config to the storage backend.
Types ¶
type ApprovedUser ¶
type ApprovedUser struct {
PublicKey string `json:"public_key"`
ApprovedAt string `json:"approved_at"`
}
ApprovedUser is a user who has been granted access.
type DeployKey ¶
type DeployKey struct {
PublicKey string `json:"public_key"`
Environments []string `json:"environments"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
}
DeployKey is a CI/CD deployment key entry.
type DeployKeyToken ¶
type DeployKeyToken struct {
VaultRepo string `json:"vault_repo"`
SourceRepo string `json:"source_repo"`
KeyName string `json:"key_name"`
PrivateKey [32]byte `json:"-"`
PrivateKeyB64 string `json:"private_key"`
Environments []string `json:"environments"`
}
DeployKeyToken is the decoded form of a deployment key token.
func DecodeDeployKey ¶
func DecodeDeployKey(token string) (*DeployKeyToken, error)
DecodeDeployKey decodes a deploy key token string.
type Envelope ¶
type Envelope struct {
EncryptedKey string `json:"encrypted_key"`
Nonce string `json:"nonce"`
EphemeralPublic string `json:"ephemeral_public"`
}
Envelope holds the encrypted symmetric key for one recipient.
type PendingRequest ¶
type PendingRequest struct {
PublicKey string `json:"public_key"`
RequestedAt string `json:"requested_at"`
}
PendingRequest is an unapproved access request.
type RepoMarker ¶
type RepoMarker struct {
Version int `json:"version"`
Type string `json:"type"`
Namespace string `json:"namespace"`
CreatedAt string `json:"created_at"`
CreatedBy string `json:"created_by"`
}
RepoMarker identifies a repo as a vaultenv vault.
type VaultConfig ¶
type VaultConfig struct {
Version int `json:"version"`
Repo string `json:"repo"`
Owner string `json:"owner"`
ApprovedUsers map[string]ApprovedUser `json:"approved_users"`
PendingRequests map[string]PendingRequest `json:"pending_requests"`
DeployKeys map[string]DeployKey `json:"deploy_keys,omitempty"`
Environments []string `json:"environments"`
}
VaultConfig represents the vault.json for a linked repo.
func LoadVaultConfig ¶
func LoadVaultConfig(store storage.Provider, vaultRepo, repoName string) (*VaultConfig, error)
LoadVaultConfig loads a vault config from the storage backend.
func NewVaultConfig ¶
func NewVaultConfig(repo, owner, ownerPubKey string) *VaultConfig
NewVaultConfig creates a new vault config with the given owner.
func ParseVaultConfig ¶
func ParseVaultConfig(data []byte) (*VaultConfig, error)
ParseVaultConfig parses vault.json bytes.