Documentation ¶
Overview ¶
Package signer implements signing and signature validation for opensds multi-cloud signer.
Provides request signing for request that need to be signed with the Signature. Provides signature validation for request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFactory ¶
func FilterFactory() restful.FilterFunction
Types ¶
type Signature ¶
type Signature struct { Service string Region string Request *http.Request Body string Query url.Values SignedHeaderValues http.Header // contains filtered or unexported fields }
func (*Signature) Filter ¶
func (sign *Signature) Filter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
Signature Authorization Filter to validate the Request Signature Authorization: algorithm Credential=accesskeyID/credential scope, SignedHeaders=SignedHeaders, Signature=signature credential scope <requestDate>/<region>/<service>/sign_request
type SignatureBase ¶
type SignatureBase interface {
Filter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
}
func NewSignature ¶
func NewSignature() SignatureBase
type Signer ¶
type Signer struct { // The authentication credentials the request will be signed against. Credentials *credentials.Credentials }
Signer provides sign requests that need to be signed with the Signature.
func NewSigner ¶
func NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer
NewSigner returns a Signer pointer configured with the credentials and optional option values provided.
func (Signer) Sign ¶
func (signer Signer) Sign(req *http.Request, body string, service, region string, requestDateTime string, requestDate string, credentialStr string) (string, error)
Sign signs OpenSDS multi-cloud requests with the service, name, region, date time the request is signed at.
Returns the signature or an error if signing the request failed.