summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/post-policy.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/post-policy.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/post-policy.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/post-policy.go b/vendor/github.com/minio/minio-go/v7/post-policy.go
index 31b340dcf..0191909bd 100644
--- a/vendor/github.com/minio/minio-go/v7/post-policy.go
+++ b/vendor/github.com/minio/minio-go/v7/post-policy.go
@@ -1,6 +1,6 @@
/*
* MinIO Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2015-2017 MinIO, Inc.
+ * Copyright 2015-2023 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,11 @@ package minio
import (
"encoding/base64"
"fmt"
+ "net/http"
"strings"
"time"
+
+ "github.com/minio/minio-go/v7/pkg/encrypt"
)
// expirationDateFormat date format for expiration key in json policy.
@@ -258,6 +261,26 @@ func (p *PostPolicy) SetUserMetadata(key string, value string) error {
return nil
}
+// SetChecksum sets the checksum of the request.
+func (p *PostPolicy) SetChecksum(c Checksum) {
+ if c.IsSet() {
+ p.formData[amzChecksumAlgo] = c.Type.String()
+ p.formData[c.Type.Key()] = c.Encoded()
+ }
+}
+
+// SetEncryption - sets encryption headers for POST API
+func (p *PostPolicy) SetEncryption(sse encrypt.ServerSide) {
+ if sse == nil {
+ return
+ }
+ h := http.Header{}
+ sse.Marshal(h)
+ for k, v := range h {
+ p.formData[k] = v[0]
+ }
+}
+
// SetUserData - Set user data as a key/value couple.
// Can be retrieved through a HEAD request or an event.
func (p *PostPolicy) SetUserData(key string, value string) error {