oauth

package
v0.0.0-...-7ba98d9 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Oauth

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

Oauth info

func New

func New(
	config config.Config,
) *Oauth

New oauth

func (*Oauth) AuthCodeURL

func (o *Oauth) AuthCodeURL() string

AuthCodeURL URL to OAuth 2.0 provider's consent page

func (*Oauth) Client

func (o *Oauth) Client(ctx context.Context, token *oauth2.Token) *github.Client

Client for a given token

func (*Oauth) ClientFrom

func (o *Oauth) ClientFrom(ctx context.Context, tokenStr string) (*github.Client, error)

ClientFrom for a given string token

func (*Oauth) Exchange

func (o *Oauth) Exchange(ctx context.Context, code string) (*oauth2.Token, error)

Exchange oauth code

func (*Oauth) IsStateValid

func (o *Oauth) IsStateValid(state string) bool

IsStateValid true if state is valid

Jump to

Keyboard shortcuts

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