secret

package
v1.1.68-test Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: 1 module, 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 ParseSecretData

func ParseSecretData(s *Secret) error

func UnmarshalSecretJSON

func UnmarshalSecretJSON(b []byte, s *Secret) error

TODO: Extend the go-converter to generate this method for JOI schemas that use the "alternatives" option.

Types

type AwsKey

type AwsKey struct {
	AccessKey  string `json:"accessKey"`
	SecretKey  string `json:"secretKey"`
	RoleArn    string `json:"roleArn,omitzero"`
	ExternalId string `json:"externalId,omitzero"`
}

func (AwsKey) ValidationRule

func (AwsKey) ValidationRule() *validate.Rule

ValidationRule ports `AwsKey` (secret.ts:20).

type AzureConnector

type AzureConnector struct {
	Url  string `json:"url"`
	Code string `json:"code"`
}

func (AzureConnector) ValidationRule

func (AzureConnector) ValidationRule() *validate.Rule

ValidationRule ports `AzureConnector` (secret.ts:99).

type Dictionary

type Dictionary map[string]string

func (Dictionary) ValidationRule

func (Dictionary) ValidationRule() *validate.Rule

ValidationRule ports `Dictionary` (secret.ts:124).

type DockerSecret

type DockerSecret struct {
	Auths map[string]DockerSecretAuth `json:"auths"`
}

type DockerSecretAuth

type DockerSecretAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Auth     string `json:"auth"`
}

type EcrPull

type EcrPull struct {
	AccessKey  string   `json:"accessKey"`
	SecretKey  string   `json:"secretKey"`
	RoleArn    string   `json:"roleArn,omitzero"`
	ExternalId string   `json:"externalId,omitzero"`
	Repos      []string `json:"repos,omitzero"`
}

func (EcrPull) ValidationRule

func (EcrPull) ValidationRule() *validate.Rule

ValidationRule ports `EcrPull` (secret.ts:49).

type GcrSecret

type GcrSecret struct {
	Type                    string `json:"type"`
	ProjectId               string `json:"project_id"`
	PrivateKeyId            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientId                string `json:"client_id"`
	AuthUri                 string `json:"auth_uri"`
	TokenUri                string `json:"token_uri"`
	AuthProviderX509CertUrl string `json:"auth_provider_x509_cert_url"`
	ClientX509CertUrl       string `json:"client_x509_cert_url"`
}

type KeyPair

type KeyPair struct {
	SecretKey  string `json:"secretKey"`
	PublicKey  string `json:"publicKey,omitzero"`
	Passphrase string `json:"passphrase,omitzero"`
}

func (KeyPair) ValidationRule

func (KeyPair) ValidationRule() *validate.Rule

ValidationRule ports `KeyPair` (secret.ts:117).

type NatsAccount

type NatsAccount struct {
	AccountId  string `json:"accountId"`
	PrivateKey string `json:"privateKey"`
}

func (NatsAccount) ValidationRule

func (NatsAccount) ValidationRule() *validate.Rule

ValidationRule ports `NatsAccount` (secret.ts:127): the regex + nkeys structural checks on the account public key and the account seed.

type Opaque

type Opaque struct {
	// Payload is validated by OpaqueRule as alternatives().conditional('encoding')
	// (secret.ts:6): base64 string when encoding=base64, else any string.
	Payload  any            `json:"payload,omitzero" ts:"string"`
	Encoding OpaqueEncoding `json:"encoding,omitzero"`
}

func (Opaque) ValidationRule

func (Opaque) ValidationRule() *validate.Rule

ValidationRule ports `Opaque` (secret.ts:6).

type OpaqueEncoding

type OpaqueEncoding string
const (
	OpaqueEncodingPlain  OpaqueEncoding = "plain"
	OpaqueEncodingBase64 OpaqueEncoding = "base64"
)

type Secret

type Secret struct {
	Id           string     `json:"id,omitzero" validate:"uuid,readOnly"`
	Name         base.Name  `json:"name,omitzero"`
	Kind         base.Kind  `json:"kind,omitzero"`
	Version      *float64   `json:"version,omitzero" validate:"positive,integer,readOnly"`
	Description  string     `json:"description,omitzero" validate:"trim,max=250,allow="`
	Tags         SecretTags `json:"tags,omitzero" validate:"default={}"`
	Created      string     `json:"created,omitzero" validate:"date,readOnly"`
	LastModified string     `json:"lastModified,omitzero" validate:"date,readOnly"`
	Links        base.Links `json:"links,omitzero" validate:"readOnly"`
	Type         SecretType `json:"type,omitzero"`
	// Data is validated by type via a RegisterRefine on Secret (secret.ts:155
	// alternatives().conditional('type', …)) — see schema_reflect_iam.go.
	Data SecretData `json:"data,omitzero"`
}

func (Secret) ValidationRule

func (Secret) ValidationRule() *validate.Rule

ValidationRule reflects Base.keys + type + data (secret.ts:170) and layers the data-by-type union as an object-level Refine (secret.ts:155). This is the schema the "secret" kind validates against.

type SecretData

type SecretData any //ts:AwsKey | AzureConnector | Dictionary | EcrPull | KeyPair | NatsAccount | Opaque | Tls | UsernamePassword | string

type SecretTags

type SecretTags = base.Tags

SecretTags aliases base.Tags so the reflection base-type registry resolves it to the shared TagsRule.

type SecretType

type SecretType string
const (
	SecretTypeOpaque         SecretType = "opaque"
	SecretTypeTls            SecretType = "tls"
	SecretTypeGcp            SecretType = "gcp"
	SecretTypeAws            SecretType = "aws"
	SecretTypeEcr            SecretType = "ecr"
	SecretTypeUserpass       SecretType = "userpass"
	SecretTypeKeypair        SecretType = "keypair"
	SecretTypeAzureSdk       SecretType = "azure-sdk"
	SecretTypeAzureConnector SecretType = "azure-connector"
	SecretTypeDocker         SecretType = "docker"
	SecretTypeDictionary     SecretType = "dictionary"
	SecretTypeNatsAccount    SecretType = "nats-account"
)

func (SecretType) EnumValues

func (SecretType) EnumValues() []string

EnumValues ports `type: Joi.string().valid(...)` (secret.ts:171).

type Tls

type Tls struct {
	Key   string `json:"key,omitzero"`
	Cert  string `json:"cert"`
	Chain string `json:"chain,omitzero"`
}

func (Tls) ValidationRule

func (Tls) ValidationRule() *validate.Rule

ValidationRule ports `Tls` (secret.ts:110).

type UsernamePassword

type UsernamePassword struct {
	Username string                   `json:"username"`
	Password string                   `json:"password"`
	Encoding UsernamePasswordEncoding `json:"encoding,omitzero"`
}

func (UsernamePassword) ValidationRule

func (UsernamePassword) ValidationRule() *validate.Rule

ValidationRule ports `UsernamePassword` (secret.ts:92).

type UsernamePasswordEncoding

type UsernamePasswordEncoding string
const (
	UsernamePasswordEncodingPlain  UsernamePasswordEncoding = "plain"
	UsernamePasswordEncodingBase64 UsernamePasswordEncoding = "base64"
)

Jump to

Keyboard shortcuts

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