dpop

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package dpop holds the CLI's proof-of-possession key and signs DPoP proofs (RFC 9449). auth binds every token it issues to the CLI to this key: the device code, the refresh tokens and the access tokens all need a proof signed by it.

Index

Constants

View Source
const Header = "DPoP"

Header is the request header carrying a proof.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key is an ES256 key pair.

func Generate

func Generate() (*Key, error)

Generate draws a new P-256 key pair.

func Parse

func Parse(raw string) (*Key, error)

Parse reads a key saved with Marshal.

func (*Key) Marshal

func (k *Key) Marshal() (string, error)

Marshal encodes the private key as a JWK, for the credential store.

func (*Key) Proof

func (k *Key) Proof(method, target, accessToken string, now time.Time) (string, error)

Proof signs a proof for one request. accessToken is the token the request carries, bound into the proof by its hash (ath); empty on token requests. Each call returns a new proof: auth refuses a jti it has already seen.

func (*Key) Thumbprint

func (k *Key) Thumbprint() string

Thumbprint is the RFC 7638 SHA-256 thumbprint of the public key, the dpop_jkt of a device authorization.

Jump to

Keyboard shortcuts

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