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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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