auth

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NO_AUTH_ERROR = errors.New("no auth info")
)

Functions

func Authenticate

func Authenticate(c *webcontext.Context)

func AuthenticateByApp

func AuthenticateByApp(c *webcontext.Context)

func AuthenticateV2

func AuthenticateV2(c *webcontext.Context)

func AuthenticateV3

func AuthenticateV3(c *webcontext.Context)

func GetUserByBasicAuth

func GetUserByBasicAuth(c *webcontext.Context, username string, passwd string) (*identity.UserInfo, error)

func GetUserInfoByTokenOrBasicAuth

func GetUserInfoByTokenOrBasicAuth(c *webcontext.Context, repoName string) (*identity.UserInfo, error)

Types

type AuthResp

type AuthResp struct {
	Permission *apistructs.ScopeRole
	Repo       *models.Repo
}

func ValidaUserRepo

func ValidaUserRepo(c *webcontext.Context, userId string, repo *models.Repo) (*AuthResp, error)

func ValidaUserRepoWithCache

func ValidaUserRepoWithCache(c *webcontext.Context, userId string, repo *models.Repo) (*AuthResp, error)

type ErrorData

type ErrorData struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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