sse

package
v0.0.0-...-fb0f190 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm string

Algorithm - represents valid SSE algorithms supported; currently only AES256 is supported

const (
	// AES256 is used with SSE-S3
	AES256 Algorithm = "AES256"
	// AWSKms is used with SSE-KMS
	AWSKms Algorithm = "aws:kms"
)

func (*Algorithm) MarshalXML

func (alg *Algorithm) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML - Marshals given SSE algorithm to valid XML

func (*Algorithm) UnmarshalXML

func (alg *Algorithm) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML - Unmarshals XML tag to valid SSE algorithm

type ApplyOptions

type ApplyOptions struct {
	AutoEncrypt bool
}

ApplyOptions ask for specific features to be enabled, when bucketSSEConfig is empty.

type BucketSSEConfig

type BucketSSEConfig struct {
	XMLNS   string   `xml:"xmlns,attr,omitempty"`
	XMLName xml.Name `xml:"ServerSideEncryptionConfiguration"`
	Rules   []Rule   `xml:"Rule"`
}

BucketSSEConfig - represents default bucket encryption configuration

func ParseBucketSSEConfig

func ParseBucketSSEConfig(r io.Reader) (*BucketSSEConfig, error)

ParseBucketSSEConfig - Decodes given XML to a valid default bucket encryption config

func (*BucketSSEConfig) Algo

func (b *BucketSSEConfig) Algo() Algorithm

Algo returns the SSE algorithm specified by the SSE configuration.

func (*BucketSSEConfig) Apply

func (b *BucketSSEConfig) Apply(headers http.Header, opts ApplyOptions)

Apply applies the SSE bucket configuration on the given HTTP headers and sets the specified SSE headers.

Apply does not overwrite any existing SSE headers. Further, it will set minimal SSE-KMS headers if autoEncrypt is true and the BucketSSEConfig is nil.

func (*BucketSSEConfig) KeyID

func (b *BucketSSEConfig) KeyID() string

KeyID returns the KMS key ID specified by the SSE configuration. If the SSE configuration does not specify SSE-KMS it returns an empty key ID.

type EncryptionAction

type EncryptionAction struct {
	Algorithm   Algorithm `xml:"SSEAlgorithm,omitempty"`
	MasterKeyID string    `xml:"KMSMasterKeyID,omitempty"`
}

EncryptionAction - for ApplyServerSideEncryptionByDefault XML tag

type Rule

type Rule struct {
	DefaultEncryptionAction EncryptionAction `xml:"ApplyServerSideEncryptionByDefault"`
}

Rule - for ServerSideEncryptionConfiguration XML tag

Jump to

Keyboard shortcuts

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