auth

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 22 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 added in v1.1.0

func AuthenticateV3(c *webcontext.Context)

func GetUserByBasicAuth

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

func GetUserInfoByTokenOrBasicAuth

func GetUserInfoByTokenOrBasicAuth(c *webcontext.Context, projectID int64) (*ucauth.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