provider

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackParams

type CallbackParams struct {
	Err     string `query:"error"`
	ErrDesc string `query:"error_description"`
	Code    string `query:"code"`
	State   string `query:"state"`
}

type Credentials

type Credentials struct {
	ClientID     string
	ClientSecret string
	BaseURL      string
}

type Provider

type Provider interface {
	Login(echo.Context) error
	Callback(echo.Context) error
}

func NewGithubProvider

func NewGithubProvider(db *sqlc.Queries, fs fs.Storage, c Credentials) Provider

func NewGoogleProvider

func NewGoogleProvider(db *sqlc.Queries, fs fs.Storage, c Credentials) (Provider, error)

type ProviderGithub

type ProviderGithub struct {
	*oauth2.Config
	// contains filtered or unexported fields
}

func (ProviderGithub) Callback

func (p ProviderGithub) Callback(c echo.Context) error

func (ProviderGithub) InsertUser

func (p ProviderGithub) InsertUser(ctx context.Context, u *githubUser) (string, error)

func (ProviderGithub) Login

func (p ProviderGithub) Login(c echo.Context) error

type ProviderGoogle

type ProviderGoogle struct {
	oauth2.Config
	*oidc.Provider
	// contains filtered or unexported fields
}

func (ProviderGoogle) Callback

func (p ProviderGoogle) Callback(c echo.Context) error

func (ProviderGoogle) InsertUser

func (p ProviderGoogle) InsertUser(ctx context.Context, u *googleUser) (string, error)

func (ProviderGoogle) Login

func (p ProviderGoogle) Login(c echo.Context) error

type TokenSource

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

func (TokenSource) Token

func (s TokenSource) Token() (*oauth2.Token, error)

Jump to

Keyboard shortcuts

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