trafficmesh

package
v0.64.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL