auth

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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