Documentation ¶
Overview ¶
Package auth is a generated GoMock package.
Index ¶
Constants ¶
View Source
const Expired = 8 * time.Hour
Variables ¶
View Source
var WireAuth = wire.NewSet(NewAuthn)
Functions ¶
Types ¶
type Auth ¶
type Auth interface { Authenticator Sign(*UserInfo) (*SignData, error) }
func NewJwtAuth ¶
func NewJwtAuth(priKey *rsa.PrivateKey, pubKey *rsa.PublicKey) Auth
type Authenticator ¶
func NewAccessTokenAuth ¶
func NewAccessTokenAuth(data data.Data) Authenticator
type Authn ¶
type Authn struct { Authns []Authenticator // contains filtered or unexported fields }
type JwtClaims ¶
type JwtClaims struct { *jwt.StandardClaims UserInfo *UserInfo `json:"user_info"` }
type MockAuth ¶
type MockAuth struct {
// contains filtered or unexported fields
}
MockAuth is a mock of Auth interface.
func NewMockAuth ¶
func NewMockAuth(ctrl *gomock.Controller) *MockAuth
NewMockAuth creates a new mock instance.
func (*MockAuth) EXPECT ¶
func (m *MockAuth) EXPECT() *MockAuthMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockAuthMockRecorder ¶
type MockAuthMockRecorder struct {
// contains filtered or unexported fields
}
MockAuthMockRecorder is the mock recorder for MockAuth.
func (*MockAuthMockRecorder) Sign ¶
func (mr *MockAuthMockRecorder) Sign(arg0 any) *gomock.Call
Sign indicates an expected call of Sign.
func (*MockAuthMockRecorder) VerifyToken ¶
func (mr *MockAuthMockRecorder) VerifyToken(arg0 any) *gomock.Call
VerifyToken indicates an expected call of VerifyToken.
type OidcClaims ¶
type OidcClaims struct { LogoutUrl string `json:"logout_url"` OpenIDClaims }
func (OidcClaims) ToUserInfo ¶
func (c OidcClaims) ToUserInfo() *UserInfo
type OpenIDClaims ¶
type OpenIDClaims struct { Sub string `json:"sub"` Name string `json:"name"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` MiddleName string `json:"middle_name"` Nickname string `json:"nickname"` PreferredUsername string `json:"preferred_username"` Profile string `json:"profile"` Picture string `json:"picture"` Website string `json:"website"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Gender string `json:"gender"` Birthdate string `json:"birthdate"` Zoneinfo string `json:"zoneinfo"` Locale string `json:"locale"` PhoneNumber string `json:"phone_number"` PhoneNumberVerified bool `json:"phone_number_verified"` Address map[string]any `json:"address"` UpdatedAt int `json:"updated_at"` // Roles 自定义权限 Roles []string `json:"roles"` }
Click to show internal directories.
Click to hide internal directories.