device

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceCode

type DeviceCode struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int    `json:"expires_in"`
	Interval                int    `json:"interval"`
}

type DeviceCodeFlow

type DeviceCodeFlow struct {
	DeviceAuthorizationURL string
	TokenURL               string
	ClientID               string
	Audience               string
	GrantType              string
	Scopes                 []string
	// contains filtered or unexported fields
}

func New

func New(opts ...DeviceCodeOption) *DeviceCodeFlow

func (*DeviceCodeFlow) AccessToken

func (f *DeviceCodeFlow) AccessToken() *api.Token

func (*DeviceCodeFlow) ExpiresIn

func (f *DeviceCodeFlow) ExpiresIn() time.Duration

func (*DeviceCodeFlow) GetDeviceCode

func (f *DeviceCodeFlow) GetDeviceCode(ctx context.Context) error

func (*DeviceCodeFlow) GetUserCode

func (f *DeviceCodeFlow) GetUserCode() string

func (*DeviceCodeFlow) GetVerificationURI

func (f *DeviceCodeFlow) GetVerificationURI() string

func (*DeviceCodeFlow) GetVerificationURIComplete

func (f *DeviceCodeFlow) GetVerificationURIComplete() string

func (*DeviceCodeFlow) Interval

func (f *DeviceCodeFlow) Interval() time.Duration

func (*DeviceCodeFlow) Reader

func (f *DeviceCodeFlow) Reader() io.Reader

func (*DeviceCodeFlow) RequestAccessToken

func (f *DeviceCodeFlow) RequestAccessToken(ctx context.Context) (bool, error)

func (*DeviceCodeFlow) TokenReader

func (f *DeviceCodeFlow) TokenReader() io.Reader

type DeviceCodeOption

type DeviceCodeOption func(*DeviceCodeFlow)

func WithAudience

func WithAudience(audience string) DeviceCodeOption

func WithClientID

func WithClientID(id string) DeviceCodeOption

func WithDeviceAuthorizationURL

func WithDeviceAuthorizationURL(url string) DeviceCodeOption

func WithGrantType

func WithGrantType(grantType string) DeviceCodeOption

func WithScope

func WithScope(scopes ...string) DeviceCodeOption

func WithTokenURL

func WithTokenURL(url string) DeviceCodeOption

type TokenRequest

type TokenRequest struct {
	URL        string
	GrantType  string
	DeviceCode string
	ClientID   string
	ExpiresIn  int
	Interval   int
}

type TokenResponse

type TokenResponse struct {
	AccessToken      string `json:"access_token"`
	IDToken          string `json:"id_token"`
	RefreshToken     string `json:"refresh_token"`
	TokenType        string `json:"token_type"`
	ExpiresIn        int    `json:"expires_in"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
	StatusCode       int    `json:"status_code"`
}

Jump to

Keyboard shortcuts

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