credentials

package
v0.0.0-...-6605a81 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KByte = 1024
	MByte = 1024 * KByte
)
View Source
const (
	LocalInterfaceAddress = "127.0.0.1"
)

Variables

View Source
var DefaultClient = &http.Client{}
View Source
var RandPort = minPort + mrand.IntN(65536-minPort)

Functions

func CodeVerifier

func CodeVerifier() string

func OAuth2Client

func OAuth2Client(ctx context.Context, c *C2S) *http.Client

Types

type C2S

type C2S struct {
	IRI      vocab.IRI
	Conf     oauth2.Config
	Tok      *oauth2.Token
	ProxyURL vocab.IRI
}

func Authorize

func Authorize(ctx context.Context, actorURL string, auth ClientConfig) (*C2S, error)

func (*C2S) Config

func (c *C2S) Config() *oauth2.Config

func (*C2S) ID

func (c *C2S) ID() vocab.IRI

func (*C2S) Refresh

func (c *C2S) Refresh(ctx context.Context) error

func (*C2S) Sign

func (c *C2S) Sign(r *http.Request) error

func (*C2S) Token

func (c *C2S) Token() *oauth2.Token

func (*C2S) Transport

func (c *C2S) Transport(ctx context.Context) http.RoundTripper

type ClientConfig

type ClientConfig struct {
	UserAgent    string
	Interactive  bool
	ClientID     string
	ClientSecret string
	RedirectURL  string
	IssuedAt     time.Time
	Expiration   time.Duration
}

type RequestAuthorizer

type RequestAuthorizer interface {
	SetAuthHeader(*http.Request)
}

Jump to

Keyboard shortcuts

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