authing_model

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LoginTabPassword  = "password"
	LoginTabCode      = "phone-code"
	PasswordMethods   = []string{"phone-password", "email-password", "username-password"}
	VerifyCodeMethods = []string{"phone-code", "email-code"}
)

Functions

This section is empty.

Types

type AppOIDCConfig

type AppOIDCConfig struct {
	Display_prompt_page                bool     `json:"display_prompt_page"`                // true
	Id_token_signed_response_alg       string   `json:"id_token_signed_response_alg"`       // HS256 RS256
	Grant_types                        []string `json:"grant_types"`                        // "authorization_code", "refresh_token"
	Response_types                     []string `json:"response_types"`                     // id_token
	Introspection_endpoint_auth_method string   `json:"introspection_endpoint_auth_method"` // client_secret_post
	Revocation_endpoint_auth_method    string   `json:"revocation_endpoint_auth_method"`    // client_secret_post
	Token_endpoint_auth_method         string   `json:"token_endpoint_auth_method"`         // none
}

type Application

type Application struct {
	Id          string    `json:"id"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	UserPoolId  string    `json:"userPoolId"`
	Protocol    string    `json:"protocol"`
	IsOfficial  bool      `json:"isOfficial"`
	IsDeleted   bool      `json:"isDeleted"`
	IsDefault   bool      `json:"isDefault"`
	IsDemo      bool      `json:"isDemo"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Secret      string    `json:"secret"`
	Identifier  string    `json:"identifier"`
}

type AuthingSessionUserInfo

type AuthingSessionUserInfo struct {
	Sub      string `json:"sub"`
	Unionid  string `json:"unionid"`
	TenantId string `json:"tenant_id"`
}

type CreateApplicationReq

type CreateApplicationReq struct {
	Name               string               `json:"name"`
	Identifier         string               `json:"identifier,omitempty"`
	Description        string               `json:"description,omitempty"`
	Type               string               `json:"type,omitempty"`
	DefaultProtocol    string               `json:"defaultProtocol,omitempty"`
	RedirectUris       []string             `json:"redirectUris,omitempty"`
	LogoutRedirectUris []string             `json:"logoutRedirectUris,omitempty"`
	InitLoginUri       string               `json:"initLoginUri,omitempty"`
	LoginCfg           MyAuthingLoginConfig `json:"login,omitempty"`
}

type CreateTenantRequest

type CreateTenantRequest struct {
	Name        string `json:"name"`
	AppIds      string `json:"appIds"`
	Description string `json:"description,omitempty"`
}

type CreateUserInput

type CreateUserInput struct {
	Username          *string  `json:"username,omitempty"`
	Email             *string  `json:"email,omitempty"`
	EmailVerified     *bool    `json:"emailVerified,omitempty"`
	Phone             *string  `json:"phone,omitempty"`
	PhoneVerified     *bool    `json:"phoneVerified,omitempty"`
	Unionid           *string  `json:"unionid,omitempty"`
	Openid            *string  `json:"openid,omitempty"`
	Nickname          *string  `json:"nickname,omitempty"`
	Photo             *string  `json:"photo,omitempty"`
	Password          *string  `json:"password,omitempty"`
	RegisterSource    []string `json:"registerSource,omitempty"`
	Browser           *string  `json:"browser,omitempty"`
	Oauth             *string  `json:"oauth,omitempty"`
	LoginsCount       *int64   `json:"loginsCount,omitempty"`
	LastLogin         *string  `json:"lastLogin,omitempty"`
	Company           *string  `json:"company,omitempty"`
	LastIP            *string  `json:"lastIP,omitempty"`
	SignedUp          *string  `json:"signedUp,omitempty"`
	Blocked           *bool    `json:"blocked,omitempty"`
	IsDeleted         *bool    `json:"isDeleted,omitempty"`
	Device            *string  `json:"device,omitempty"`
	Name              *string  `json:"name,omitempty"`
	GivenName         *string  `json:"givenName,omitempty"`
	FamilyName        *string  `json:"familyName,omitempty"`
	MiddleName        *string  `json:"middleName,omitempty"`
	Profile           *string  `json:"profile,omitempty"`
	PreferredUsername *string  `json:"preferredUsername,omitempty"`
	Website           *string  `json:"website,omitempty"`
	Gender            *string  `json:"gender,omitempty"`
	Birthdate         *string  `json:"birthdate,omitempty"`
	Zoneinfo          *string  `json:"zoneinfo,omitempty"`
	Locale            *string  `json:"locale,omitempty"`
	Address           *string  `json:"address,omitempty"`
	Formatted         *string  `json:"formatted,omitempty"`
	StreetAddress     *string  `json:"streetAddress,omitempty"`
	Locality          *string  `json:"locality,omitempty"`
	Region            *string  `json:"region,omitempty"`
	PostalCode        *string  `json:"postalCode,omitempty"`
	Country           *string  `json:"country,omitempty"`
	ExternalId        *string  `json:"externalId,omitempty"`
}

type GroupModel

type GroupModel struct {
	Id          string    `json:"Id"`
	Code        string    `json:"code"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type Identity

type Identity struct {
	Id            *string                `json:"id"`
	Openid        *string                `json:"openid"`
	UserIdInIdp   *string                `json:"userIdInIdp"`
	UserId        *string                `json:"userId"`
	ExtIdpId      *string                `json:"extIdpId"`
	IsSocial      *bool                  `json:"isSocial"`
	Provider      *string                `json:"provider"`
	UserPoolId    *string                `json:"userPoolId"`
	RefreshToken  *string                `json:"refreshToken"`
	AccessToken   *string                `json:"accessToken"`
	Type          *string                `json:"type"`
	UserInfoInIdp *IdentityUserInfoInIdp `json:"userInfoInIdp"`
	OriginConnId  *string                `json:"originConnId,omitempty"`
	OauthLdap     *IdpOauthLdap          `json:"oauthLdap,omitempty"`
}

type IdentityUserInfoInIdp

type IdentityUserInfoInIdp struct {
	Oauth     string        `json:"oauth,omitempty"`
	Username  string        `json:"username,omitempty"`
	OpenId    string        `json:"openid,omitempty"`
	UnionId   string        `json:"unionid,omitempty"`
	Email     string        `json:"email,omitempty"`
	Name      string        `json:"name,omitempty"`
	GivenName string        `json:"givenName,omitempty"`
	OauthLdap *IdpOauthLdap `json:"oauthLdap,omitempty"`
}

type IdpOauthLdap

type IdpOauthLdap struct {
	Uid         string   `json:"uid,omitempty"`         // carl
	DN          string   `json:"dn,omitempty"`          // cn=carl,ou=sales,dc=sdp-console,dc=cn
	SN          string   `json:"sn,omitempty"`          // carl
	CN          string   `json:"cn,omitempty"`          // carl
	GivenName   string   `json:"givenName,omitempty"`   // carl
	Mail        string   `json:"mail,omitempty"`        // carl@xxx.com
	ObjectClass []string `json:"objectClass,omitempty"` // ["inetOrgPerson","top"]
}

type LoginPageUpdateReq

type LoginPageUpdateReq struct {
	CustomSecurityEnabled bool `json:"customSecurityEnabled"`

	AutoRegisterThenLogin bool              `json:"autoRegisterThenLogin"` // this will trigger auto add user when user not exist
	RegisterTabs          []string          `json:"registerTabs"`          //
	DefaultLoginTab       string            `json:"defaultLoginTab"`       // phone-code, password
	LoginTabs             []string          `json:"loginTabs"`
	PasswordTabConfig     LoginTabConfigReq `json:"passwordTabConfig"`   // phone-password,email-password,username-password
	VerifyCodeTabConfig   LoginTabConfigReq `json:"verifyCodeTabConfig"` // phone-code, email-code

	OidcConfig AppOIDCConfig `json:"oidcConfig"`
}

type LoginTabConfigReq

type LoginTabConfigReq struct {
	EnabledLoginMethods  []string `json:"enabledLoginMethods"`
	ValidLoginMethods    []string `json:"validLoginMethods"`
	ValidRegisterMethods []string `json:"validRegisterMethods"`
}

type MfaBindResp

type MfaBindResp struct {
	Token string         `json:"token"`
	Data  MfaBindRespOpt `json:"data,omitempty"`
}

type MfaBindRespOpt

type MfaBindRespOpt struct {
	QrCodeUri     string `json:"qrcode_uri"`
	QrCodeDataUrl string `json:"qrcode_data_url"`
	RecoveryCode  string `json:"recovery_code"`
}

type MfaFactorDto

type MfaFactorDto struct {
	FactorId   string      `json:"factorId"`
	FactorType string      `json:"factorType"`
	Profile    interface{} `json:"profile"`
}

type MyAuthingLoginConfig

type MyAuthingLoginConfig struct {
	DefaultCodeVerifyLoginTab bool
	EnablePasswordLogin       bool
	EnableCodeVerifyLogin     bool
}

DefaultLoginTab = "password", "phone-code" passwordMethods = "phone-password", "email-password", "username-password" codeMethods = phone-code, email-code

type Tenant

type Tenant struct {
	ID         string    `json:"id"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	UserPoolID string    `json:"userPoolId"`
	Name       string    `json:"name"`
}

type TenantApp

type TenantApp struct {
	ID         string    `json:"id"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	UserPoolID string    `json:"userPoolId"`
	Protocol   string    `json:"protocol"`
	Name       string    `json:"name"`
	Secret     string    `json:"secret"`
	Identifier string    `json:"identifier"`
}

type TenantDetails

type TenantDetails struct {
	Tenant
	Apps []TenantApp
}

type UpdateTenantExtraReq

type UpdateTenantExtraReq struct {
	AdminAmount  uint32 `json:"adminAmount"`  // 0, 租户内部管理员数量, 0 means no limit
	ExpireTime   string `json:"expireTime"`   // "2024/04/30"
	MauAmount    uint32 `json:"mauAmount"`    // 100, 租户成员活跃数量, 1-100
	MemberAmount uint32 `json:"memberAmount"` // 100, 租户成员数量,1-100
}

type UpdateUserInput

type UpdateUserInput struct {
	Email             *string `json:"email,omitempty"`
	Unionid           *string `json:"unionid,omitempty"`
	Openid            *string `json:"openid,omitempty"`
	EmailVerified     *bool   `json:"emailVerified,omitempty"`
	Phone             *string `json:"phone,omitempty"`
	PhoneVerified     *bool   `json:"phoneVerified,omitempty"`
	Username          *string `json:"username,omitempty"`
	Nickname          *string `json:"nickname,omitempty"`
	Password          *string `json:"password,omitempty"`
	Photo             *string `json:"photo,omitempty"`
	Company           *string `json:"company,omitempty"`
	Browser           *string `json:"browser,omitempty"`
	Device            *string `json:"device,omitempty"`
	Oauth             *string `json:"oauth,omitempty"`
	TokenExpiredAt    *string `json:"tokenExpiredAt,omitempty"`
	LoginsCount       *int64  `json:"loginsCount,omitempty"`
	LastLogin         *string `json:"lastLogin,omitempty"`
	LastIP            *string `json:"lastIP,omitempty"`
	Blocked           *bool   `json:"blocked,omitempty"`
	Name              *string `json:"name,omitempty"`
	GivenName         *string `json:"givenName,omitempty"`
	FamilyName        *string `json:"familyName,omitempty"`
	MiddleName        *string `json:"middleName,omitempty"`
	Profile           *string `json:"profile,omitempty"`
	PreferredUsername *string `json:"preferredUsername"`
	Website           *string `json:"website,omitempty"`
	Gender            *string `json:"gender,omitempty"`
	Birthdate         *string `json:"birthdate,omitempty"`
	Zoneinfo          *string `json:"zoneinfo,omitempty"`
	Locale            *string `json:"locale,omitempty"`
	Address           *string `json:"address,omitempty"`
	Formatted         *string `json:"formatted,omitempty"`
	StreetAddress     *string `json:"streetAddress,omitempty"`
	Locality          *string `json:"locality,omitempty"`
	Region            *string `json:"region,omitempty"`
	PostalCode        *string `json:"postalCode,omitempty"`
	City              *string `json:"city,omitempty"`
	Province          *string `json:"province,omitempty"`
	Country           *string `json:"country,omitempty"`
	ExternalId        *string `json:"externalId,omitempty"`
}

type User

type User struct {
	Id  string `json:"id"`
	Arn string `json:"arn"`
	//Status            *EnumUserStatus `json:"status"`
	UserPoolId        string        `json:"userPoolId"`
	Username          *string       `json:"username"`
	Email             *string       `json:"email"`
	EmailVerified     *bool         `json:"emailVerified"`
	Phone             *string       `json:"phone"`
	PhoneVerified     *bool         `json:"phoneVerified"`
	Unionid           *string       `json:"unionid"`
	Openid            *string       `json:"openid"`
	Identities        []*Identity   `json:"identities"`
	Nickname          *string       `json:"nickname"`
	RegisterSource    []string      `json:"registerSource"`
	Photo             *string       `json:"photo"`
	Password          *string       `json:"password"`
	Oauth             *string       `json:"oauth"`
	Token             *string       `json:"token"`
	TokenExpiredAt    *string       `json:"tokenExpiredAt"`
	LoginsCount       *int64        `json:"loginsCount"`
	LastLogin         *string       `json:"lastLogin"`
	LastIP            *string       `json:"lastIP"`
	SignedUp          *string       `json:"signedUp"`
	Blocked           *bool         `json:"blocked"`
	IsDeleted         *bool         `json:"isDeleted"`
	Device            *string       `json:"device"`
	Browser           *string       `json:"browser"`
	Company           *string       `json:"company"`
	Name              *string       `json:"name"`
	GivenName         *string       `json:"givenName"`
	FamilyName        *string       `json:"familyName"`
	MiddleName        *string       `json:"middleName"`
	Profile           *string       `json:"profile"`
	PreferredUsername *string       `json:"preferredUsername"`
	Website           *string       `json:"website"`
	Gender            *string       `json:"gender"`
	BirthDate         *string       `json:"birthdate"`
	ZoneInfo          *string       `json:"zoneinfo"`
	Locale            *string       `json:"locale"`
	Address           *string       `json:"address"`
	Formatted         *string       `json:"formatted"`
	StreetAddress     *string       `json:"streetAddress"`
	Locality          *string       `json:"locality"`
	Region            *string       `json:"region"`
	PostalCode        *string       `json:"postalCode"`
	City              *string       `json:"city"`
	Province          *string       `json:"province"`
	Country           *string       `json:"country"`
	CreatedAt         *string       `json:"createdAt"`
	UpdatedAt         *string       `json:"updatedAt"`
	OauthLdap         *IdpOauthLdap `json:"oauthLdap,omitempty"`
}

func (*User) GetCreateAt

func (u *User) GetCreateAt() (time.Time, error)

func (*User) InitFrom

func (u *User) InitFrom(user *model.User) *User

Jump to

Keyboard shortcuts

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