Documentation
¶
Index ¶
- Constants
- Variables
- type DPoP
- func (t DPoP) GenerateProof(accessToken string) DPoP
- func (t DPoP) HTM() string
- func (t DPoP) HTU() string
- func (t DPoP) MarshalJSON() ([]byte, error)
- func (t DPoP) Match(jkt string, method string, url string) (bool, error)
- func (t *DPoP) Sign(kid string, key crypto.Signer, alg jwa.SignatureAlgorithm) (string, error)
- func (t DPoP) String() string
- func (t *DPoP) UnmarshalJSON(bytes []byte) error
Constants ¶
View Source
const ( // ATHKey is the claim key of the ath JWT claim for a DPoP token ATHKey = "ath" // DPopType is the value of the typ JWT header for a DPoP token DPopType = "dpop+jwt" HTMKey = "htm" HTUKey = "htu" )
Variables ¶
View Source
var ErrInvalidDPoP = errors.New("invalid DPoP token")
ErrInvalidDPoP is returned when a DPoP token is invalid
Functions ¶
This section is empty.
Types ¶
type DPoP ¶
type DPoP struct {
Headers jws.Headers `json:"-"`
Kid string `json:"-"`
Token jwt.Token `json:"-"`
// contains filtered or unexported fields
}
DPoP represents a DPoP token used for internal processing
func Parse ¶
Parse parses a DPoP token from a string. The token is validated for the required claims and headers.
func (DPoP) GenerateProof ¶
GenerateProof generates the proof for the DPoP token It sets the ath claim to the base64 encoded SHA256 hash of the access token
func (DPoP) MarshalJSON ¶
func (DPoP) Match ¶
Match checks if the JWK, http method, domain and path of the DPoP tokens match for the url, the port is stripped. If there is a mismatch, the reason is returned in an error.
func (*DPoP) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.