clients

package
v0.0.0-...-ed3efbc Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Algorithm string `json:"alg"`
	Typ       string `json:"typ"`
	KeyID     string `json:"kid,omitempty"`
}

type Introspect

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

func NewIntrospectClient

func NewIntrospectClient(endpointURL string) *Introspect

func (*Introspect) IntrospectToken

func (c *Introspect) IntrospectToken(
	ctx context.Context,
	form IntrospectForm,
	header map[string]string,
) (*IntrospectResponse, error)

type IntrospectForm

type IntrospectForm struct {
	Token  string
	Scopes []string
}

type IntrospectResponse

type IntrospectResponse struct {
	Active    bool     `json:"active"`
	ClientID  string   `json:"client_id,omitempty"`
	Scope     string   `json:"scope,omitempty"`
	Audience  []string `json:"aud,omitempty"`
	ExpiresAt int64    `json:"exp,omitempty"`
	IssuedAt  int64    `json:"iat,omitempty"`
	Subject   string   `json:"sub,omitempty"`
	Username  string   `json:"username,omitempty"`
}

type JWTBearer

type JWTBearer struct {
	Signer jose.Signer
	// contains filtered or unexported fields
}

func NewJWTBearer

func NewJWTBearer(tokenURL string) *JWTBearer

func (*JWTBearer) GetToken

func (c *JWTBearer) GetToken(ctx context.Context, payloadData *JWTBearerPayload, scope []string) (*Token, error)

func (*JWTBearer) SetPrivateKey

func (c *JWTBearer) SetPrivateKey(keyID string, privateKey *rsa.PrivateKey) error

type JWTBearerPayload

type JWTBearerPayload struct {
	*jwt.Claims

	PrivateClaims map[string]interface{}
}

type RequestError

type RequestError struct {
	Response *http.Response
	Body     []byte
}

func (*RequestError) Error

func (r *RequestError) Error() string

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	ExpiresIn    int64  `json:"expires_in,omitempty"`
}

Jump to

Keyboard shortcuts

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