vault

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsymmetricAlgorithm

type AsymmetricAlgorithm string
const (
	AAed25519                               AsymmetricAlgorithm = "ED25519"
	AAes256                                 AsymmetricAlgorithm = "ES256"
	AAes384                                 AsymmetricAlgorithm = "ES384"
	AAes512                                 AsymmetricAlgorithm = "ES512"
	AArsa2048_pkcs1v15_sha256               AsymmetricAlgorithm = "RSA-PKCS1V15-2048-SHA256"
	AArsa2048_oaep_sha256                   AsymmetricAlgorithm = "RSA-OAEP-2048-SHA256"
	AAes256K                                AsymmetricAlgorithm = "ES256K"
	AArsa2048_oaep_sha1                     AsymmetricAlgorithm = "RSA-OAEP-2048-SHA1"
	AArsa2048_oaep_sha512                   AsymmetricAlgorithm = "RSA-OAEP-2048-SHA512"
	AArsa3072_oaep_sha1                     AsymmetricAlgorithm = "RSA-OAEP-3072-SHA1"
	AArsa3072_oaep_sha256                   AsymmetricAlgorithm = "RSA-OAEP-3072-SHA256"
	AArsa3072_oaep_sha512                   AsymmetricAlgorithm = "RSA-OAEP-3072-SHA512"
	AArsa4096_oaep_sha1                     AsymmetricAlgorithm = "RSA-OAEP-4096-SHA1"
	AArsa4096_oaep_sha256                   AsymmetricAlgorithm = "RSA-OAEP-4096-SHA256"
	AArsa4096_oaep_sha512                   AsymmetricAlgorithm = "RSA-OAEP-4096-SHA512"
	AArsa2048_pss_sha256                    AsymmetricAlgorithm = "RSA-PSS-2048-SHA256"
	AArsa3072_pss_sha256                    AsymmetricAlgorithm = "RSA-PSS-3072-SHA256"
	AA4096_pss_sha256                       AsymmetricAlgorithm = "RSA-PSS-4096-SHA256" // deprecated by typo. use AArsa4096_pss_sha256 instead
	AArsa4096_pss_sha256                    AsymmetricAlgorithm = "RSA-PSS-4096-SHA256"
	AArsa4096_pss_sha512                    AsymmetricAlgorithm = "RSA-PSS-4096-SHA512"
	AArsa                                   AsymmetricAlgorithm = "RSA-PKCS1V15-2048-SHA256" // deprecated, use AArsa2048_pkcs1v15_sha256 instead
	AAed25519_dilithium2_beta               AsymmetricAlgorithm = "ED25519-DILITHIUM2-BETA"
	AAed488_dilithium3_beta                 AsymmetricAlgorithm = "ED448-DILITHIUM3-BETA"
	AAsphincsplus_128f_shake256_simple_beta AsymmetricAlgorithm = "SPHINCSPLUS-128F-SHAKE256-SIMPLE-BETA"
	AAsphincsplus_128f_shake256_robust_beta AsymmetricAlgorithm = "SPHINCSPLUS-128F-SHAKE256-ROBUST-BETA"
	AAsphincsplus_192f_shake256_simple_beta AsymmetricAlgorithm = "SPHINCSPLUS-192F-SHAKE256-SIMPLE-BETA"
	AAsphincsplus_192f_shake256_robust_beta AsymmetricAlgorithm = "SPHINCSPLUS-192F-SHAKE256-ROBUST-BETA"
	AAsphincsplus_256f_shake256_simple_beta AsymmetricAlgorithm = "SPHINCSPLUS-256F-SHAKE256-SIMPLE-BETA"
	AAsphincsplus_256f_shake256_robust_beta AsymmetricAlgorithm = "SPHINCSPLUS-256F-SHAKE256-ROBUST-BETA"
	AAsphincsplus_128f_sha256_simple_beta   AsymmetricAlgorithm = "SPHINCSPLUS-128F-SHA256-SIMPLE-BETA"
	AAsphincsplus_128f_sha256_robust_beta   AsymmetricAlgorithm = "SPHINCSPLUS-128F-SHA256-ROBUST-BETA"
	AAsphincsplus_192f_sha256_simple_beta   AsymmetricAlgorithm = "SPHINCSPLUS-192F-SHA256-SIMPLE-BETA"
	AAsphincsplus_192f_sha256_robust_beta   AsymmetricAlgorithm = "SPHINCSPLUS-192F-SHA256-ROBUST-BETA"
	AAsphincsplus_256f_sha256_simple_beta   AsymmetricAlgorithm = "SPHINCSPLUS-256F-SHA256-SIMPLE-BETA"
	AAsphincsplus_256f_sha256_robust_beta   AsymmetricAlgorithm = "SPHINCSPLUS-256F-SHA256-ROBUST-BETA"
	AAfalcon1024_beta                       AsymmetricAlgorithm = "FALCON-1024-BETA"
)

type AsymmetricGenerateRequest

type AsymmetricGenerateRequest struct {
	CommonGenerateRequest
	Algorithm  AsymmetricAlgorithm `json:"algorithm,omitempty"`
	Purpose    KeyPurpose          `json:"purpose,omitempty"`
	Exportable *bool               `json:"exportable,omitempty"` // Whether the key is exportable or not.
}

type AsymmetricGenerateResult

type AsymmetricGenerateResult struct {
	CommonGenerateResult
	PublicKey EncodedPublicKey `json:"public_key"`
	Algorithm string           `json:"algorithm"`
	Purpose   string           `json:"purpose"`
}

type AsymmetricStoreRequest

type AsymmetricStoreRequest struct {
	CommonStoreRequest
	Algorithm  AsymmetricAlgorithm `json:"algorithm"`
	PublicKey  EncodedPublicKey    `json:"public_key"`
	PrivateKey EncodedPrivateKey   `json:"private_key"`
	Purpose    KeyPurpose          `json:"purpose,omitempty"`
	Exportable *bool               `json:"exportable,omitempty"` // Whether the key is exportable or not.
}

type AsymmetricStoreResult

type AsymmetricStoreResult struct {
	CommonStoreResult
	PublicKey EncodedPublicKey `json:"public_key"`
	Algorithm string           `json:"algorithm"`
	Purpose   string           `json:"purpose"`
}

type Client

type Client interface {
	StateChange(ctx context.Context, req *StateChangeRequest) (*pangea.PangeaResponse[StateChangeResult], error)
	Delete(ctx context.Context, req *DeleteRequest) (*pangea.PangeaResponse[DeleteResult], error)
	Get(ctx context.Context, req *GetRequest) (*pangea.PangeaResponse[GetResult], error)
	JWKGet(ctx context.Context, req *JWKGetRequest) (*pangea.PangeaResponse[JWKGetResult], error)
	List(ctx context.Context, req *ListRequest) (*pangea.PangeaResponse[ListResult], error)
	Update(ctx context.Context, req *UpdateRequest) (*pangea.PangeaResponse[UpdateResult], error)
	SecretStore(ctx context.Context, req *SecretStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
	PangeaTokenStore(ctx context.Context, req *PangeaTokenStoreRequest) (*pangea.PangeaResponse[SecretStoreResult], error)
	SecretRotate(ctx context.Context, req *SecretRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
	PangeaTokenRotate(ctx context.Context, req *PangeaTokenRotateRequest) (*pangea.PangeaResponse[SecretRotateResult], error)
	SymmetricGenerate(ctx context.Context, req *SymmetricGenerateRequest) (*pangea.PangeaResponse[SymmetricGenerateResult], error)
	AsymmetricGenerate(ctx context.Context, req *AsymmetricGenerateRequest) (*pangea.PangeaResponse[AsymmetricGenerateResult], error)
	SymmetricStore(ctx context.Context, req *SymmetricStoreRequest) (*pangea.PangeaResponse[SymmetricStoreResult], error)
	AsymmetricStore(ctx context.Context, req *AsymmetricStoreRequest) (*pangea.PangeaResponse[AsymmetricStoreResult], error)
	KeyRotate(ctx context.Context, req *KeyRotateRequest) (*pangea.PangeaResponse[KeyRotateResult], error)
	Encrypt(ctx context.Context, req *EncryptRequest) (*pangea.PangeaResponse[EncryptResult], error)
	Decrypt(ctx context.Context, req *DecryptRequest) (*pangea.PangeaResponse[DecryptResult], error)
	Sign(ctx context.Context, req *SignRequest) (*pangea.PangeaResponse[SignResult], error)
	Verify(ctx context.Context, req *VerifyRequest) (*pangea.PangeaResponse[VerifyResult], error)
	JWTSign(ctx context.Context, req *JWTSignRequest) (*pangea.PangeaResponse[JWTSignResult], error)
	JWTVerify(ctx context.Context, req *JWTVerifyRequest) (*pangea.PangeaResponse[JWTVerifyResult], error)
	FolderCreate(ctx context.Context, req *FolderCreateRequest) (*pangea.PangeaResponse[FolderCreateResult], error)

	// Encrypt parts of a JSON object.
	EncryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

	// Decrypt parts of a JSON object.
	DecryptStructured(ctx context.Context, input *EncryptStructuredRequest) (*pangea.PangeaResponse[EncryptStructuredResult], error)

	// Encrypt using a format-preserving algorithm (FPE).
	EncryptTransform(ctx context.Context, input *EncryptTransformRequest) (*pangea.PangeaResponse[EncryptTransformResult], error)

	// Decrypt using a format-preserving algorithm (FPE).
	DecryptTransform(ctx context.Context, input *DecryptTransformRequest) (*pangea.PangeaResponse[DecryptTransformResult], error)

	// Export a symmetric or asymmetric key.
	Export(ctx context.Context, input *ExportRequest) (*pangea.PangeaResponse[ExportResult], error)

	// Base service methods
	pangea.BaseServicer
}

func New

func New(cfg *pangea.Config) Client

type CommonGenerateRequest

type CommonGenerateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Type              ItemType         `json:"type"`
	Name              string           `json:"name,omitempty"`
	Folder            string           `json:"folder,omitempty"`
	Metadata          Metadata         `json:"metadata,omitempty"`
	Tags              Tags             `json:"tags,omitempty"`
	RotationFrequency string           `json:"rotation_frequency,omitempty"`
	RotationState     ItemVersionState `json:"rotation_state,omitempty"`
	Expiration        string           `json:"expiration,omitempty"`
}

type CommonGenerateResult

type CommonGenerateResult struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	Version int    `json:"version"`
}

type CommonRotateRequest

type CommonRotateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID            string           `json:"id"`
	RotationState ItemVersionState `json:"rotation_state,omitempty"`
}

type CommonRotateResult

type CommonRotateResult struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
	Type    string `json:"type"`
}

type CommonStoreRequest

type CommonStoreRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Type              ItemType         `json:"type"`
	Name              string           `json:"name,omitempty"`
	Folder            string           `json:"folder,omitempty"`
	Metadata          Metadata         `json:"metadata,omitempty"`
	Tags              Tags             `json:"tags,omitempty"`
	RotationFrequency string           `json:"rotation_frequency,omitempty"`
	RotationState     ItemVersionState `json:"rotation_state,omitempty"`
	Expiration        string           `json:"expiration,omitempty"`
}

type CommonStoreResult

type CommonStoreResult struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	Version int    `json:"version"`
}

type DecryptRequest

type DecryptRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID             string  `json:"id"`
	CipherText     string  `json:"cipher_text"`
	Version        *int    `json:"version,omitempty"`
	AdditionalData *string `json:"additional_data,omitempty"`
}

type DecryptResult

type DecryptResult struct {
	ID        string `json:"id"`
	Version   int    `json:"version"`
	Algorithm string `json:"algorithm"`
	PlainText string `json:"plain_text"`
}

type DecryptTransformRequest added in v3.9.0

type DecryptTransformRequest struct {
	pangea.BaseRequest

	// The ID of the key to use.
	ID string `json:"id"`

	// A message encrypted by Vault.
	CipherText string `json:"cipher_text"`

	// User provided tweak string. If not provided, a random string will be
	// generated and returned. The user must securely store the tweak source
	// which will be needed to decrypt the data.
	Tweak string `json:"tweak"`

	// Set of characters to use for format-preserving encryption (FPE).
	Alphabet TransformAlphabet `json:"alphabet"`

	// The item version. Defaults to the current version.
	Version *int `json:"version,omitempty"`
}

Parameters for a decrypt transform request.

type DecryptTransformResult added in v3.9.0

type DecryptTransformResult struct {
	// The item ID.
	ID string `json:"id"`

	// Decrypted message.
	PlainText string `json:"plain_text"`

	// The item version.
	Version int `json:"version"`

	// The algorithm of the key.
	Algorithm string `json:"algorithm"`
}

Result of a decrypt transform request.

type DeleteRequest

type DeleteRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID string `json:"id"`
}

type DeleteResult

type DeleteResult struct {
	ID string `json:"id"`
}

type EncodedPrivateKey

type EncodedPrivateKey string

EncodedPrivateKey is a PEM private key, with no further encoding (i.e. no base64). It may be used for example in openssh with no further processing

type EncodedPublicKey

type EncodedPublicKey string

EncodedPublicKey is a PEM public key, with no further encoding (i.e. no base64) It may be used for example in openssh with no further processing

type EncodedSymmetricKey

type EncodedSymmetricKey string

EncodedSymmetricKey is a base64 encoded key

type EncryptRequest

type EncryptRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID             string  `json:"id"`
	PlainText      string  `json:"plain_text"`
	Version        *int    `json:"version,omitempty"`
	AdditionalData *string `json:"additional_data,omitempty"`
}

type EncryptResult

type EncryptResult struct {
	ID         string `json:"id"`
	Version    int    `json:"version"`
	Algorithm  string `json:"algorithm"`
	CipherText string `json:"cipher_text"`
}

type EncryptStructuredRequest added in v3.6.0

type EncryptStructuredRequest struct {
	pangea.BaseRequest

	// The ID of the key to use. It must be an item of type `symmetric_key` or
	// `asymmetric_key` and purpose `encryption`.
	ID string `json:"id"`

	// Structured data for applying bulk operations.
	StructuredData map[string]interface{} `json:"structured_data"`

	// A filter expression. It must point to string elements of the
	// `StructuredData` field.
	Filter string `json:"filter"`

	// The item version. Defaults to the current version.
	Version *int `json:"version,omitempty"`

	// User provided authentication data.
	AdditionalData *string `json:"additional_data,omitempty"`
}

Parameters for an encrypt/decrypt structured request.

type EncryptStructuredResult added in v3.6.0

type EncryptStructuredResult struct {
	// The ID of the item.
	ID string `json:"id"`

	// The item version.
	Version int `json:"version"`

	// The algorithm of the key.
	Algorithm string `json:"algorithm"`

	// Structured data with filtered fields encrypted/decrypted.
	StructuredData map[string]interface{} `json:"structured_data"`
}

Result of an encrypt/decrypt structured request.

type EncryptTransformRequest added in v3.9.0

type EncryptTransformRequest struct {
	pangea.BaseRequest

	// The ID of the key to use.
	ID string `json:"id"`

	// Message to be encrypted.
	PlainText string `json:"plain_text"`

	// Set of characters to use for format-preserving encryption (FPE).
	Alphabet TransformAlphabet `json:"alphabet"`

	// User provided tweak string. If not provided, a random string will be
	// generated and returned. The user must securely store the tweak source
	// which will be needed to decrypt the data.
	Tweak *string `json:"tweak,omitempty"`

	// The item version. Defaults to the current version.
	Version *int `json:"version,omitempty"`
}

Parameters for an encrypt transform request.

type EncryptTransformResult added in v3.9.0

type EncryptTransformResult struct {
	// The item ID.
	ID string `json:"id"`

	// The encrypted message.
	CipherText string `json:"cipher_text"`

	// The item version.
	Version int `json:"version"`

	// The algorithm of the key.
	Algorithm string `json:"algorithm"`

	// User provided tweak string. If not provided, a random string will be
	// generated and returned. The user must securely store the tweak source
	// which will be needed to decrypt the data.
	Tweak string `json:"tweak"`

	// Set of characters to use for format-preserving encryption (FPE).
	Alphabet TransformAlphabet `json:"alphabet"`
}

Result of an encrypt transform request.

type ExportEncryptionAlgorithm added in v3.10.0

type ExportEncryptionAlgorithm string

Algorithm of an exported public key.

const EEArsa4096_oaep_sha512 ExportEncryptionAlgorithm = "RSA-OAEP-4096-SHA512"

RSA 4096-bit key, OAEP padding, SHA512 digest.

type ExportRequest added in v3.10.0

type ExportRequest struct {
	pangea.BaseRequest

	ID                  string                     `json:"id"`                             // The ID of the item.
	Version             *int                       `json:"version,omitempty"`              // The item version.
	EncryptionKey       *string                    `json:"encryption_key,omitempty"`       // Public key in PEM format used to encrypt exported key(s).
	EncryptionAlgorithm *ExportEncryptionAlgorithm `json:"encryption_algorithm,omitempty"` // The algorithm of the public key.
}

type ExportResult added in v3.10.0

type ExportResult struct {
	ID         string  `json:"id"`                    // The ID of the item.
	Version    int     `json:"version"`               // The item version.
	Type       string  `json:"type"`                  // The type of the key.
	ItemState  string  `json:"item_state"`            // The state of the item.
	Algorithm  string  `json:"algorithm"`             // The algorithm of the key.
	PublicKey  *string `json:"public_key,omitempty"`  // The public key (in PEM format).
	PrivateKey *string `json:"private_key,omitempty"` // The private key (in PEM format).
	Key        *string `json:"key,omitempty"`         // The key material.
	Encrypted  bool    `json:"encrypted"`             // Whether exported key(s) are encrypted with encryption_key sent on the request or not. If encrypted, the result is sent in base64, any other case they are in PEM format plain text.
}

type FolderCreateRequest

type FolderCreateRequest struct {
	pangea.BaseRequest

	Name                string           `json:"name"`
	Folder              string           `json:"folder"`
	Metadata            Metadata         `json:"metadata,omitempty"`
	Tags                Tags             `json:"tags,omitempty"`
	RotationFrequency   string           `json:"rotation_frequency,omitempty"`
	RotationState       ItemVersionState `json:"rotation_state,omitempty"`
	RotationGracePeriod string           `json:"rotation_grace_period,omitempty"`
}

type FolderCreateResult

type FolderCreateResult struct {
	ID string `json:"id"`
}

type GetRequest

type GetRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID           string            `json:"id"`
	Version      string            `json:"version,omitempty"`
	Verbose      *bool             `json:"verbose,omitempty"`
	VersionState *ItemVersionState `json:"version_state,omitempty"`
}

type GetResult

type GetResult struct {
	ItemData
	Versions            []ItemVersionData  `json:"versions"`
	RotationGracePeriod string             `json:"rotation_grace_period,omitempty"`
	InheritedSettings   *InheritedSettings `json:"inherited_settings,omitempty"`
}

type InheritedSettings added in v3.1.0

type InheritedSettings struct {
	RotationFrequency   string `json:"rotation_frequency,omitempty"`
	RotationState       string `json:"rotation_state,omitempty"`
	RotationGracePeriod string `json:"rotation_grace_period,omitempty"`
}

type ItemData

type ItemData struct {
	ID                string          `json:"id"`
	Type              string          `json:"type"`
	ItemState         string          `json:"item_state"`
	CurrentVersion    ItemVersionData `json:"current_version"`
	Name              string          `json:"name,omitempty"`
	Folder            string          `json:"folder,omitempty"`
	Metadata          Metadata        `json:"metadata,omitempty"`
	Tags              Tags            `json:"tags,omitempty"`
	RotationFrequency string          `json:"rotation_frequency,omitempty"`
	RotationState     string          `json:"rotation_state,omitempty"`
	LastRotated       string          `json:"last_rotated,omitempty"`
	NextRotation      string          `json:"next_rotation,omitempty"`
	Expiration        string          `json:"expiration,omitempty"`
	CreatedAt         string          `json:"created_at"`
	Algorithm         string          `json:"algorithm,omitempty"`
	Purpose           string          `json:"purpose,omitempty"`
	Exportable        *bool           `json:"exportable,omitempty"` // Whether the key is exportable or not.
}

type ItemOrder

type ItemOrder string
const (
	IOasc ItemOrder = "asc"
	IOdes ItemOrder = "desc"
)

type ItemOrderBy

type ItemOrderBy string
const (
	IOBtype         ItemOrderBy = "type"
	IOBcreateAt     ItemOrderBy = "create_at"
	IOBdestroyedAt  ItemOrderBy = "destroyed_at"
	IOBidentity     ItemOrderBy = "identity"
	IOBmanaged      ItemOrderBy = "managed"
	IOBpurpose      ItemOrderBy = "purpose"
	IOBexpiration   ItemOrderBy = "expiration"
	IOBlastRotated  ItemOrderBy = "last_rotated"
	IOBnextRotation ItemOrderBy = "next_rotation"
	IOBname         ItemOrderBy = "name"
	IOBfolder       ItemOrderBy = "folder"
	IOBversion      ItemOrderBy = "version"
)

type ItemState

type ItemState string
const (
	ISenabled  ItemState = "enabled"
	ISdisabled ItemState = "disabled"
)

type ItemType

type ItemType string
const (
	ITasymmetricKey ItemType = "asymmetric_key"
	ITsymmetricKey  ItemType = "symmetric_key"
	ITsecret        ItemType = "secret"
	ITpangeaToken   ItemType = "pangea_token"
)

type ItemVersionData

type ItemVersionData struct {
	Version   int               `json:"version"`
	State     string            `json:"state"`
	CreatedAt string            `json:"created_at"`
	DestroyAt *string           `json:"destroy_at,omitempty"`
	PublicKey *EncodedPublicKey `json:"public_key,omitempty"`
	Secret    *string           `json:"secret,omitempty"`
}

type ItemVersionState

type ItemVersionState string
const (
	IVSactive      ItemVersionState = "active"
	IVSdeactivated ItemVersionState = "deactivated"
	IVSsuspended   ItemVersionState = "suspended"
	IVScompromised ItemVersionState = "compromised"
	IVSdestroyed   ItemVersionState = "destroyed"
	IVSinherited   ItemVersionState = "inherited"
)

type JWKGetRequest

type JWKGetRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID      string  `json:"id"`
	Version *string `json:"version,omitempty"`
}

type JWKGetResult

type JWKGetResult struct {
	Keys []JWT `json:"keys"`
}

type JWT

type JWT struct {
	Alg string  `json:"alg"`
	Kid *string `json:"kid,omitempty"`
	Kty string  `json:"kty"`
	Use *string `json:"use,omitempty"`
	Crv *string `json:"crv,omitempty"`
	D   *string `json:"d,omitempty"`
	X   *string `json:"x,omitempty"`
	Y   *string `json:"y,omitempty"`
	N   *string `json:"n,omitempty"`
	E   *string `json:"e,omitempty"`
}

type JWTSignRequest

type JWTSignRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID      string `json:"id"`
	Payload string `json:"payload"`
}

type JWTSignResult

type JWTSignResult struct {
	JWS string `json:"jws"`
}

type JWTVerifyRequest

type JWTVerifyRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	JWS string `json:"jws"`
}

type JWTVerifyResult

type JWTVerifyResult struct {
	ValidSignature bool `json:"valid_signature"`
}

type KeyPurpose

type KeyPurpose string
const (
	KPsigning    KeyPurpose = "signing"
	KPencryption KeyPurpose = "encryption"
	KPjwt        KeyPurpose = "jwt"
	KPfpe        KeyPurpose = "fpe" // Format-preserving encryption.
)

type KeyRotateRequest

type KeyRotateRequest struct {
	CommonRotateRequest
	PublicKey  *EncodedPublicKey    `json:"public_key,omitempty"`
	PrivateKey *EncodedPrivateKey   `json:"private_key,omitempty"`
	Key        *EncodedSymmetricKey `json:"key,omitempty"`
}

type KeyRotateResult

type KeyRotateResult struct {
	CommonRotateResult
	PublicKey *EncodedPublicKey `json:"public_key,omitempty"`
	Algorithm string            `json:"algorithm"`
	Purpose   string            `json:"purpose"`
}

type ListItemData

type ListItemData struct {
	ItemData
	CompromisedVersions []ItemVersionData `json:"compromised_versions"`
}

type ListRequest

type ListRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	Filter  map[string]string `json:"filter,omitempty"`
	Last    string            `json:"last,omitempty"`
	Size    int               `json:"size,omitempty"`
	Order   ItemOrder         `json:"order,omitempty"`
	OrderBy ItemOrderBy       `json:"order_by,omitempty"`
}

type ListResult

type ListResult struct {
	Items []ListItemData `json:"items"`
	Count int            `json:"count"`
	Last  string         `json:"last,omitempty"`
}

type Metadata

type Metadata map[string]string

type PangeaTokenRotateRequest

type PangeaTokenRotateRequest struct {
	CommonRotateRequest
	RotationGracePeriod string `json:"rotation_grace_period"`
}

type PangeaTokenStoreRequest

type PangeaTokenStoreRequest struct {
	CommonStoreRequest
	Token string `json:"secret"`
}

type SecretRotateRequest

type SecretRotateRequest struct {
	CommonRotateRequest
	Secret string `json:"secret"`
}

type SecretRotateResult

type SecretRotateResult struct {
	CommonRotateResult
	Secret string `json:"secret"`
}

type SecretStoreRequest

type SecretStoreRequest struct {
	CommonStoreRequest
	Secret string `json:"secret"`
}

type SecretStoreResult

type SecretStoreResult struct {
	CommonStoreResult
	Secret string `json:"secret"`
}

type SignRequest

type SignRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID      string `json:"id"`
	Message string `json:"message"`
	Version *int   `json:"version,omitempty"`
}

type SignResult

type SignResult struct {
	ID        string            `json:"id"`
	Version   int               `json:"version"`
	Signature string            `json:"signature"`
	Algorithm string            `json:"algorithm"`
	PublicKey *EncodedPublicKey `json:"public_key,omitempty"`
}

type StateChangeRequest

type StateChangeRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID            string           `json:"id"`
	State         ItemVersionState `json:"state"`
	Version       *int             `json:"version,omitempty"`
	DestroyPeriod string           `json:"destroy_period,omitempty"`
}

type StateChangeResult

type StateChangeResult struct {
	ID        string  `json:"id"`
	Version   int     `json:"version"`
	State     string  `json:"state"`
	DestroyAt *string `json:"destroy_at,omitempty"`
}

type SymmetricAlgorithm

type SymmetricAlgorithm string
const (
	SYAhs256         SymmetricAlgorithm = "HS256"
	SYAhs384         SymmetricAlgorithm = "HS384"
	SYAhs512         SymmetricAlgorithm = "HS512"
	SYAaes128_cfb    SymmetricAlgorithm = "AES-CFB-128"
	SYAaes256_cfb    SymmetricAlgorithm = "AES-CFB-256"
	SYAaes256_gcm    SymmetricAlgorithm = "AES-GCM-256"
	SYAaes128_cbc    SymmetricAlgorithm = "AES-CBC-128"
	SYAaes256_cbc    SymmetricAlgorithm = "AES-CBC-256"
	SYAaes           SymmetricAlgorithm = "AES-CFB-128"        // deprecated, use SYAaes128_cfb instead
	SYAaes_ff3_1_128 SymmetricAlgorithm = "AES-FF3-1-128-BETA" // 128-bit encryption using the FF3-1 algorithm. Beta feature.
	SYAaes_ff3_1_256 SymmetricAlgorithm = "AES-FF3-1-256-BETA" // 256-bit encryption using the FF3-1 algorithm. Beta feature.
)

type SymmetricGenerateRequest

type SymmetricGenerateRequest struct {
	CommonGenerateRequest
	Algorithm  SymmetricAlgorithm `json:"algorithm"`
	Purpose    KeyPurpose         `json:"purpose"`
	Exportable *bool              `json:"exportable,omitempty"`
}

type SymmetricGenerateResult

type SymmetricGenerateResult struct {
	CommonGenerateResult
	Algorithm string `json:"algorithm"`
	Purpose   string `json:"purpose"`
}

type SymmetricStoreRequest

type SymmetricStoreRequest struct {
	CommonStoreRequest
	Key        EncodedSymmetricKey `json:"key"`
	Algorithm  SymmetricAlgorithm  `json:"algorithm"`
	Purpose    KeyPurpose          `json:"purpose,omitempty"`
	Exportable *bool               `json:"exportable,omitempty"`
}

type SymmetricStoreResult

type SymmetricStoreResult struct {
	CommonStoreResult
	Algorithm string `json:"algorithm"`
	Purpose   string `json:"purpose"`
}

type Tags

type Tags []string

type TransformAlphabet added in v3.9.0

type TransformAlphabet string
const (
	TAalphalower        TransformAlphabet = "alphalower"        // Lowercase alphabet (a-z).
	TAalphanumeric      TransformAlphabet = "alphanumeric"      // Alphanumeric (a-z, A-Z, 0-9).
	TAalphanumericlower TransformAlphabet = "alphanumericlower" // Lowercase alphabet with numbers (a-z, 0-9).
	TAalphanumericupper TransformAlphabet = "alphanumericupper" // Uppercase alphabet with numbers (A-Z, 0-9).
	TAalphaupper        TransformAlphabet = "alphaupper"        // Uppercase alphabet (A-Z).
	TAnumeric           TransformAlphabet = "numeric"           // Numeric (0-9).
)

type UpdateRequest

type UpdateRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID                  string           `json:"id"`
	Name                string           `json:"name,omitempty"`
	Folder              string           `json:"folder,omitempty"`
	Metadata            Metadata         `json:"metadata,omitempty"`
	Tags                Tags             `json:"tags,omitempty"`
	RotationFrequency   string           `json:"rotation_frequency,omitempty"`
	RotationState       ItemVersionState `json:"rotation_state,omitempty"`
	RotationGracePeriod string           `json:"rotation_grace_period,omitempty"`
	Expiration          string           `json:"expiration,omitempty"`
	ItemState           ItemState        `json:"item_state,omitempty"`
}

type UpdateResult

type UpdateResult struct {
	ID string `json:"id"`
}

type VerifyRequest

type VerifyRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest

	ID        string `json:"id"`
	Version   *int   `json:"version,omitempty"`
	Message   string `json:"message"`
	Signature string `json:"signature"`
}

type VerifyResult

type VerifyResult struct {
	ID             string `json:"id"`
	Version        int    `json:"version"`
	Algorithm      string `json:"algorithm"`
	ValidSignature bool   `json:"valid_signature"`
}

Jump to

Keyboard shortcuts

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