auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenResponse

type AccessTokenResponse struct {
	AccessToken string `json:"access_token,omitempty"`
	TokenType   string `json:"token_type,omitempty"`
	Scope       string `json:"scope,omitempty"`
}

func GetToken

func GetToken(clientID string, code *DeviceCode) (*AccessTokenResponse, error)

type DeviceCode

type DeviceCode struct {
	// The device verification code is 40 characters and used to verify the device.
	DeviceCode string `json:"device_code,omitempty"`
	// The user verification code is displayed on the device so the user
	// can enter the code in a browser. This code is 8 characters with a
	// hyphen in the middle.
	UserCode string `json:"user_code,omitempty"`
	// The verification URL where users need to enter the user_code
	VerificationURL string `json:"verification_uri,omitempty"`
	// The number of seconds before the device_code and user_code expire.
	// The default is 900 seconds or 15 minutes.
	ExpiresInSec int `json:"expires_in,omitempty"`
	// The minimum number of seconds that must pass before you can make a new access token request
	// (POST https://github.com/login/oauth/access_token) to complete the device authorization.
	// For example, if the interval is 5, then you cannot make a new request until 5 seconds pass.
	// If you make more than one request over 5 seconds, then you will hit the rate limit and receive a slow_down error.
	Interval int `json:"interval,omitempty"`
}

func GetDeviceCode

func GetDeviceCode(clientID string) (*DeviceCode, error)

Jump to

Keyboard shortcuts

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