credentials

package
v0.0.0-...-d69ff1e Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KByte = 1024
	MByte = 1024 * KByte
)

Variables

View Source
var DefaultClient = &http.Client{}

Functions

func Client

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

Types

type C2S

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

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 {
	ClientID     string
	ClientSecret string
	RedirectURL  string
}

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