auth

package
v0.0.0-...-8011960 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

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

func (*AuthHandler) Callback

func (ah *AuthHandler) Callback(w http.ResponseWriter, r *http.Request)

func (*AuthHandler) Login

func (ah *AuthHandler) Login(w http.ResponseWriter, r *http.Request)

func (*AuthHandler) Logout

func (ah *AuthHandler) Logout(w http.ResponseWriter, r *http.Request)

TODO: ensure same site lax when frontend is scaffolded

type GoogleOAuthService

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

func NewGoogleOAuthService

func NewGoogleOAuthService(cfg *config.Config) *GoogleOAuthService

func (*GoogleOAuthService) AuthCodeURL

func (g *GoogleOAuthService) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string

func (*GoogleOAuthService) Client

func (g *GoogleOAuthService) Client(ctx context.Context, token *oauth2.Token) *http.Client

func (*GoogleOAuthService) Exchange

func (g *GoogleOAuthService) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

func (*GoogleOAuthService) RefreshToken

func (g *GoogleOAuthService) RefreshToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)

func (*GoogleOAuthService) Revoke

func (g *GoogleOAuthService) Revoke(ctx context.Context, token *oauth2.Token) error

type OAuthService

type OAuthService interface {
	AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
	Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
	Client(ctx context.Context, token *oauth2.Token) *http.Client
	Revoke(ctx context.Context, token *oauth2.Token) error
	RefreshToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
}

type UserInfo

type UserInfo struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

Jump to

Keyboard shortcuts

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