Documentation
¶
Index ¶
Constants ¶
View Source
const ISO8601BasicFormat = "20060102T150405Z"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestPresigner ¶
type RequestPresigner interface {
// SignUploadURL creates and signs a URL that allows a PUT request to upload
// data for the given digest/size to the service.
//
// The ttl parameter determines the number of seconds the signed URL will be
// valid for.
//
// It returns a signed URL that will accept a PUT request, and a set of HTTP
// headers that should also be sent with the request.
SignUploadURL(ctx context.Context, digest multihash.Multihash, size uint64, ttl uint64) (url.URL, http.Header, error)
// VerifyUploadURL ensures the upload URL was signed by this service. It
// returns the _signed_ URL and headers or error if the signature is invalid.
VerifyUploadURL(ctx context.Context, url url.URL, headers http.Header) (url.URL, http.Header, error)
}
type S3RequestPresigner ¶
type S3RequestPresigner struct {
// contains filtered or unexported fields
}
func NewS3RequestPresigner ¶
func NewS3RequestPresigner(accessKeyID string, secretAcessKey string, endpoint url.URL, bucketName string) (*S3RequestPresigner, error)
NewS3RequestPresigner creates a signer that the S3 SDK to sign and verify requests. The bucketName parameter is optional and defaults to "blob".
Signed upload URLs take the form {endpoint}/{bucketName}/{b58digest}
func (*S3RequestPresigner) SignUploadURL ¶
Click to show internal directories.
Click to hide internal directories.