Documentation
¶
Index ¶
- func ParseSecretData(s *Secret) error
- func UnmarshalSecretJSON(b []byte, s *Secret) error
- type AwsKey
- type AzureConnector
- type Dictionary
- type DockerSecret
- type DockerSecretAuth
- type EcrPull
- type GcrSecret
- type KeyPair
- type NatsAccount
- type Opaque
- type OpaqueEncoding
- type Secret
- type SecretData
- type SecretTags
- type SecretType
- type Tls
- type UsernamePassword
- type UsernamePasswordEncoding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSecretData ¶
func UnmarshalSecretJSON ¶
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 ¶
ValidationRule ports `AwsKey` (secret.ts:20).
type AzureConnector ¶
func (AzureConnector) ValidationRule ¶
func (AzureConnector) ValidationRule() *validate.Rule
ValidationRule ports `AzureConnector` (secret.ts:99).
type Dictionary ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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" )