Documentation ¶
Index ¶
- Constants
- func DecryptString(in string) ([]byte, error)
- func EncryptString(in []byte) string
- func GetJWKs(ctx context.Context) (jsonutils.JSONObject, error)
- func InitClient() error
- func SetupTest()
- func SignJWT(t jwt.Token) (string, error)
- type SAuthToken
- func (t SAuthToken) Encode() string
- func (t SAuthToken) GetAuthCookie(token mcclient.TokenCredential) string
- func (t SAuthToken) GetToken(ctx context.Context) (mcclient.TokenCredential, error)
- func (t SAuthToken) IsTotpEnabled() bool
- func (t SAuthToken) IsTotpInitialized() bool
- func (t SAuthToken) IsTotpVerified() bool
- func (t *SAuthToken) SetToken(tid string)
- func (t *SAuthToken) SetTotpInitialized()
- func (t *SAuthToken) VerifyTotpPasscode(s *mcclient.ClientSession, uid, passcode string) error
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 EncryptString ¶
func InitClient ¶
func InitClient() 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 (t SAuthToken) GetToken(ctx context.Context) (mcclient.TokenCredential, error)
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
Click to show internal directories.
Click to hide internal directories.