Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketSSEConfig ¶
type BucketSSEConfig struct { XMLNS string `xml:"xmlns,attr,omitempty"` XMLName xml.Name `xml:"ServerSideEncryptionConfiguration"` Rules []SSERule `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) Algorithm ¶
func (b *BucketSSEConfig) Algorithm() SSEAlgorithm
Algorithm returns the SSE algorithm specified by the SSE configuration.
func (*BucketSSEConfig) Apply ¶
func (b *BucketSSEConfig) Apply(headers http.Header, autoEncrypt bool)
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 SSEAlgorithm `xml:"SSEAlgorithm,omitempty"` MasterKeyID string `xml:"KMSMasterKeyID,omitempty"` }
EncryptionAction - for ApplyServerSideEncryptionByDefault XML tag
type SSEAlgorithm ¶
type SSEAlgorithm string
SSEAlgorithm - represents valid SSE algorithms supported; currently only AES256 is supported
const ( // AES256 is used with SSE-S3 AES256 SSEAlgorithm = "AES256" // AWSKms is used with SSE-KMS AWSKms SSEAlgorithm = "aws:kms" )
func (*SSEAlgorithm) MarshalXML ¶
func (alg *SSEAlgorithm) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML - Marshals given SSE algorithm to valid XML
func (*SSEAlgorithm) UnmarshalXML ¶
func (alg *SSEAlgorithm) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML - Unmarshals XML tag to valid SSE algorithm
type SSERule ¶
type SSERule struct {
DefaultEncryptionAction EncryptionAction `xml:"ApplyServerSideEncryptionByDefault"`
}
SSERule - for ServerSideEncryptionConfiguration XML tag