kratos

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserActive   = "active"
	UserInActive = "inactive"
)

Variables

This section is empty.

Functions

func ChangeUserState

func ChangeUserState(kratosPrivateAddr string, userID string, state string) error

func HandlePagingUsers

func HandlePagingUsers(req *apistructs.UserPagingRequest, token string) (*common.UserPaging, error)

func IdentityToUserInfo

func IdentityToUserInfo(i OryKratosIdentity) common.UserInfo

func MigrationReady

func MigrationReady() bool

func UpdateIdentity

func UpdateIdentity(kratosPrivateAddr string, userID string, req OryKratosUpdateIdentitiyRequest) error

func UserMigration

func UserMigration(req OryKratosCreateIdentitiyRequest) (string, error)

func Whoami

func Whoami(kratosPublicAddr string, sessionID string) (common.UserInfo, error)

Types

type Config

type Config struct {
	OryKratosPrivateAddr string `default:"kratos-admin" file:"ORY_KRATOS_ADMIN_ADDR" env:"ORY_KRATOS_ADMIN_ADDR"`
}

type IdentityService

type IdentityService struct {
	Provider *provider
}

type Interface

type Interface common.Interface

type OryKratosAdminIdentityImportCredentials

type OryKratosAdminIdentityImportCredentials struct {
	Password *OryKratosAdminIdentityImportCredentialsPassword `json:"password"`
}

type OryKratosAdminIdentityImportCredentialsPassword

type OryKratosAdminIdentityImportCredentialsPassword struct {
	Config OryKratosIdentityCredentialsPasswordConfig `json:"config"`
}

type OryKratosCreateIdentitiyRequest

type OryKratosCreateIdentitiyRequest struct {
	SchemaID    string                                  `json:"schema_id"`
	Traits      OryKratosIdentityTraits                 `json:"traits"`
	Credentials OryKratosAdminIdentityImportCredentials `json:"credentials"`
}

type OryKratosFlowResponse

type OryKratosFlowResponse struct {
	ID string                  `json:"id"`
	UI OryKratosFlowResponseUI `json:"ui"`
}

type OryKratosFlowResponseUI

type OryKratosFlowResponseUI struct {
	Action string `json:"action"`
}

type OryKratosIdentity

type OryKratosIdentity struct {
	ID       common.USERID           `json:"id"`
	SchemaID string                  `json:"schema_id"`
	State    string                  `json:"state"`
	Traits   OryKratosIdentityTraits `json:"traits"`
}

type OryKratosIdentityCredentialsPasswordConfig

type OryKratosIdentityCredentialsPasswordConfig struct {
	HashedPassword string `json:"hashed_password"`
	Password       string `json:"password"`
}

type OryKratosIdentityTraits

type OryKratosIdentityTraits struct {
	Email  string `json:"email"`
	Name   string `json:"username"`
	Nick   string `json:"nickname"`
	Phone  string `json:"phone"`
	Avatar string `json:"avatar"`
}

type OryKratosReadyResponse

type OryKratosReadyResponse struct {
	Status string `json:"status"`
}

type OryKratosRegistrationRequest

type OryKratosRegistrationRequest struct {
	Traits   OryKratosIdentityTraits `json:"traits"`
	Password string                  `json:"password"`
	Method   string                  `json:"method"`
}

type OryKratosRegistrationResponse

type OryKratosRegistrationResponse struct {
	Identity OryKratosIdentity `json:"identity"`
}

type OryKratosSession

type OryKratosSession struct {
	ID       string            `json:"id"`
	Active   bool              `json:"active"`
	Identity OryKratosIdentity `json:"identity"`
}

type OryKratosUpdateIdentitiyRequest

type OryKratosUpdateIdentitiyRequest struct {
	State  string                  `json:"state"`
	Traits OryKratosIdentityTraits `json:"traits"`
}

type UserIDModel

type UserIDModel struct {
	ID     string
	UserID string
}

Jump to

Keyboard shortcuts

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