secrets

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsP2pId

func ContainsP2pId(p2pId [32]byte, p2pIds [][32]byte) bool

func DecryptSecretsForNode

func DecryptSecretsForNode(
	result EncryptedSecretsResult,
	key X25519Key,
	workflowOwner string,
) (map[string]string, error)

func EncryptSecretsForNodes

func EncryptSecretsForNodes(
	workflowOwner string,
	secrets map[string][]string,
	encryptionPublicKeys map[string][32]byte,
	config SecretsConfig,
) (map[string]string, map[string][]AssignedSecrets, error)

func ValidateEncryptedSecrets

func ValidateEncryptedSecrets(secretsData []byte, encryptionPublicKeys map[string][32]byte, workflowOwner string) error

Types

type AssignedSecrets

type AssignedSecrets struct {
	WorkflowSecretName string `json:"workflowSecretName"`
	LocalEnvVarName    string `json:"localEnvVarName"`
}

this holds the mapping of secret name (e.g. API_KEY) to the local environment variable name which points to the raw secret

type EncryptedSecretsResult

type EncryptedSecretsResult struct {
	EncryptedSecrets map[string]string `json:"encryptedSecrets"`
	Metadata         Metadata          `json:"metadata"`
}

this is the result of the encryption, will be used by the DON

type Metadata

type Metadata struct {
	WorkflowOwner            string                       `json:"workflowOwner"`
	CapabilitiesRegistry     string                       `json:"capabilitiesRegistry"`
	DonId                    string                       `json:"donId"`
	DateEncrypted            string                       `json:"dateEncrypted"`
	NodePublicEncryptionKeys map[string]string            `json:"nodePublicEncryptionKeys"`
	EnvVarsAssignedToNodes   map[string][]AssignedSecrets `json:"envVarsAssignedToNodes"`
}

this is the metadata that will be stored in the encrypted secrets file

type SecretPayloadToEncrypt

type SecretPayloadToEncrypt struct {
	WorkflowOwner string            `json:"workflowOwner"`
	Secrets       map[string]string `json:"secrets"`
}

this is the payload that will be encrypted

type SecretsConfig

type SecretsConfig struct {
	SecretsNames map[string][]string `yaml:"secretsNames"`
}

this matches the secrets config file by the users, see the secretsConfig.yaml file

type X25519Key

type X25519Key interface {
	Decrypt(box []byte) ([]byte, error)
	PublicKey() [32]byte
	PublicKeyString() string
}

Jump to

Keyboard shortcuts

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