Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SignatureDecoder ¶
type SignatureDecoder struct {
// contains filtered or unexported fields
}
SignatureDecoder decodes a signed traffic-mesh header.
func NewSignatureDecoder ¶
func NewSignatureDecoder(secret string) *SignatureDecoder
NewSignatureDecoder constructs a new SignatureDecoder. When secret is an empty string, DecodeSignature is a no-op.
func (*SignatureDecoder) DecodeSignature ¶
func (d *SignatureDecoder) DecodeSignature(req *http.Request) (*SignaturePayload, error)
DecodeSignature decodes a traffic-mesh signature. When either the secret or the header is an empty string, this method returns a nil payload and nil error.
type SignaturePayload ¶
type SignaturePayload struct { jwt.StandardClaims SiteID string `json:"sid,omitempty"` DeployID string `json:"did,omitempty"` AccountID string `json:"aid,omitempty"` URL string `json:"url,omitempty"` Remapped bool `json:"remapped,omitempty"` }
SignaturePayload represents the fields in a traffic-mesh signature.
Click to show internal directories.
Click to hide internal directories.