auth

package
v0.0.0-...-cb886e6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const AuthTokenCookieName = "auth_token"

Variables

This section is empty.

Functions

func ExtractAuthDataMiddleware

func ExtractAuthDataMiddleware(jwtSecret string) gin.HandlerFunc

func IsAuthorized

func IsAuthorized(ctx context.Context, owner string, authData *AuthData) (bool, error)

TODO: move this to ghoauth.GHOAuthClient

func NewAuthRouter

func NewAuthRouter(
	clientID string,
	clientSecret string,
	redirectURL string,
	jwtSecret string,
	secure bool,
	usersService users.Service,
	frontendURL string,
	ghapp ghapp.GHAppClient,
) *authRouter

Types

type AuthData

type AuthData struct {
	jwt.StandardClaims
	GithubToken *oauth2.Token `json:"githubToken"`
}

func GetAuthData

func GetAuthData(c *gin.Context) (*AuthData, bool)

Jump to

Keyboard shortcuts

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