Documentation ¶
Index ¶
- Constants
- Variables
- func IsStandardContentSHA256(key string) bool
- func MultipartFormValue(r *http.Request, key string) string
- func PresignRequest(creds *credentials.Credentials, reqData RequestData, presignData PresignData) (*http.Request, error)
- func SignStr(secret, service, region string, t time.Time, strToSign string) string
- type AuthHeader
- type Center
- type CenterSettings
- type PresignData
- type RegexpSubmatcher
- type RequestData
Constants ¶
View Source
const ( AmzAlgorithm = "X-Amz-Algorithm" AmzCredential = "X-Amz-Credential" AmzSignature = "X-Amz-Signature" AmzSignedHeaders = "X-Amz-SignedHeaders" AmzExpires = "X-Amz-Expires" AmzDate = "X-Amz-Date" AmzContentSHA256 = "X-Amz-Content-Sha256" AuthorizationHdr = "Authorization" ContentTypeHdr = "Content-Type" UnsignedPayload = "UNSIGNED-PAYLOAD" StreamingUnsignedPayloadTrailer = "STREAMING-UNSIGNED-PAYLOAD-TRAILER" StreamingContentSHA256 = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD" StreamingContentSHA256Trailer = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER" StreamingContentECDSASHA256 = "STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD" StreamingContentECDSASHA256Trailer = "STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER" )
Variables ¶
View Source
var AuthorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P<access_key_id>[^/]+)/(?P<date>[^/]+)/(?P<region>[^/]*)/(?P<service>[^/]+)/aws4_request,\s*SignedHeaders=(?P<signed_header_fields>.+),\s*Signature=(?P<v4_signature>.+)`)
AuthorizationFieldRegexp -- is regexp for credentials with Base58 encoded cid and oid and '0' (zero) as delimiter.
View Source
var ContentSHA256HeaderStandardValue = map[string]struct{}{ UnsignedPayload: {}, StreamingUnsignedPayloadTrailer: {}, StreamingContentSHA256: {}, StreamingContentSHA256Trailer: {}, StreamingContentECDSASHA256: {}, StreamingContentECDSASHA256Trailer: {}, }
Functions ¶
func IsStandardContentSHA256 ¶ added in v0.29.0
func MultipartFormValue ¶
MultipartFormValue gets value by key from multipart form.
func PresignRequest ¶ added in v0.28.0
func PresignRequest(creds *credentials.Credentials, reqData RequestData, presignData PresignData) (*http.Request, error)
PresignRequest forms pre-signed request to access objects without aws credentials.
Types ¶
type AuthHeader ¶ added in v0.28.0
type Center ¶
type Center struct {
// contains filtered or unexported fields
}
func New ¶
func New(creds tokens.Credentials, prefixes []string, settings CenterSettings) *Center
New creates an instance of AuthCenter.
func (*Center) Authenticate ¶
type CenterSettings ¶ added in v0.31.0
type PresignData ¶ added in v0.28.0
type RegexpSubmatcher ¶
type RegexpSubmatcher struct {
// contains filtered or unexported fields
}
func NewRegexpMatcher ¶
func NewRegexpMatcher(re *regexp.Regexp) *RegexpSubmatcher
NewRegexpMatcher creates a new regexp sub matcher.
func (*RegexpSubmatcher) GetSubmatches ¶
func (r *RegexpSubmatcher) GetSubmatches(target string) map[string]string
GetSubmatches returns matches from provided string. Zero length indicates no match.
Click to show internal directories.
Click to hide internal directories.