token

package
v0.0.0-...-af25eba Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Scopes 表示此 app 預設需要的 scopes
	Scopes = []github.Scope{github.ScopeReadOrg, github.ScopeUser, github.ScopeRepo}
	// ErrOauthAccessAlreadyExists 表示 token 已存在
	ErrOauthAccessAlreadyExists = errors.New(`access token already exists
To store a token on https://github.com/settings/tokens, use '--token' flag  
To re-generate a new token, use '--force' flag
Use 'init --help' for more information about the command`)
)

Functions

func Confirm

func Confirm(ctx context.Context, client *github.Client, org string, _ *logrus.Logger) (name string, err error)

Confirm 確保 token 的使用者存在於傳入的 org 中

func EnsureScopes

func EnsureScopes(log *logrus.Logger, scopes []github.Scope) (err error)

EnsureScopes 確保當前的 token 有傳入的所有 scopes

func Grant

func Grant(ctx context.Context, client *github.Client, log *logrus.Logger, force bool) (token string, err error)

Grant 產生傳入的 username/password 的 token

Types

This section is empty.

Jump to

Keyboard shortcuts

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