clientman

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TotpEnable  = '1'
	TotpDisable = '0'
)
View Source
const MAX_OTP_RETRY = 5 // totp验证最大重试次数

Variables

This section is empty.

Functions

func DecryptString

func DecryptString(in string) ([]byte, error)

func EncryptString

func EncryptString(in []byte) string

func GetJWKs

func GetJWKs(ctx context.Context) (jsonutils.JSONObject, error)

func InitClient

func InitClient() error

func SetupTest

func SetupTest()

func SignJWT

func SignJWT(t jwt.Token) (string, error)

Types

type SAuthToken

type SAuthToken struct {
	// contains filtered or unexported fields
}

func Decode

func Decode(t string) (*SAuthToken, error)

func NewAuthToken

func NewAuthToken(tid string, enableTotp bool, isTotpInit bool, isSsoLogin bool) *SAuthToken

func (SAuthToken) Encode

func (t SAuthToken) Encode() string

func (SAuthToken) GetAuthCookie

func (t SAuthToken) GetAuthCookie(token mcclient.TokenCredential) string

func (SAuthToken) GetToken

func (SAuthToken) IsTotpEnabled

func (t SAuthToken) IsTotpEnabled() bool

func (SAuthToken) IsTotpInitialized

func (t SAuthToken) IsTotpInitialized() bool

func (SAuthToken) IsTotpVerified

func (t SAuthToken) IsTotpVerified() bool

func (*SAuthToken) SetToken

func (t *SAuthToken) SetToken(tid string)

func (*SAuthToken) SetTotpInitialized

func (t *SAuthToken) SetTotpInitialized()

func (*SAuthToken) VerifyTotpPasscode

func (t *SAuthToken) VerifyTotpPasscode(s *mcclient.ClientSession, uid, passcode string) error

Jump to

Keyboard shortcuts

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