forked from baron/baron-sso
- Kratos Identity 스키마에 로그인 전용 `id` 속성 추가 - 테넌트 Config의 `loginIdField` 설정에 따라 User의 `login_id` 및 Kratos `traits.id` 동기화 로직 구현 - Admin UI 테넌트 스키마 설정 내 '로그인 ID로 사용' 체크박스 추가 - Admin UI 사용자 생성/수정/조회 화면에 로그인 ID 관리 필드 및 컬럼 반영 - Userfront 로그인 화면 접속 시 테넌트 설정에 따라 동적 로그인 ID 라벨 적용 - 관련 다국어(ko/en) 번역 추가 및 로그인 ID 설계 문서 업데이트
114 lines
3.9 KiB
Go
114 lines
3.9 KiB
Go
package domain
|
|
|
|
type EnchantedLinkInitRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
URI string `json:"uri,omitempty"` // Redirect URI (optional for polling flow)
|
|
Method string `json:"method,omitempty"` // "email" or "sms"
|
|
CodeOnly bool `json:"codeOnly,omitempty"`
|
|
DryRun bool `json:"dryRun,omitempty"`
|
|
DrySend bool `json:"drySend,omitempty"`
|
|
}
|
|
|
|
type EnchantedLinkInitResponse struct {
|
|
LinkID string `json:"linkId"`
|
|
PendingRef string `json:"pendingRef"`
|
|
MaskedEmail string `json:"maskedEmail"`
|
|
}
|
|
|
|
type EnchantedLinkPollRequest struct {
|
|
PendingRef string `json:"pendingRef"`
|
|
}
|
|
|
|
type EnchantedLinkPollResponse struct {
|
|
SessionToken string `json:"sessionToken"` // JWT
|
|
RefreshToken string `json:"refreshToken"`
|
|
UserID string `json:"userId,omitempty"`
|
|
}
|
|
|
|
type MagicLinkVerifyRequest struct {
|
|
Token string `json:"token"`
|
|
VerifyOnly bool `json:"verifyOnly,omitempty"`
|
|
}
|
|
|
|
type QRInitResponse struct {
|
|
QRCode string `json:"qrCode"` // Base64 or URL
|
|
PendingRef string `json:"pendingRef"`
|
|
ExpiresIn int `json:"expiresIn"`
|
|
}
|
|
|
|
// Signup Flow Models
|
|
|
|
type CheckEmailRequest struct {
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
type SendSignupCodeRequest struct {
|
|
Target string `json:"target"` // Email or Phone
|
|
Type string `json:"type"` // "email" or "phone"
|
|
}
|
|
|
|
type VerifySignupCodeRequest struct {
|
|
Target string `json:"target"` // Email or Phone
|
|
Type string `json:"type"` // "email" or "phone"
|
|
Code string `json:"code"`
|
|
}
|
|
|
|
type SignupRequest struct {
|
|
Email string `json:"email"`
|
|
LoginID string `json:"loginId,omitempty"`
|
|
Password string `json:"password"`
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
AffiliationType string `json:"affiliationType"` // "AFFILIATE" or "GENERAL"
|
|
CompanyCode string `json:"companyCode,omitempty"`
|
|
Department string `json:"department"`
|
|
Metadata JSONMap `json:"metadata,omitempty"`
|
|
TermsAccepted bool `json:"termsAccepted"`
|
|
}
|
|
|
|
// User Profile Models
|
|
|
|
type UserProfileResponse struct {
|
|
ID string `json:"id"`
|
|
Email string `json:"email"`
|
|
LoginID string `json:"loginId,omitempty"`
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
Role string `json:"role"` // 추가
|
|
SessionAuthenticatedAt string `json:"sessionAuthenticatedAt,omitempty"`
|
|
Department string `json:"department"`
|
|
AffiliationType string `json:"affiliationType"`
|
|
CompanyCode string `json:"companyCode,omitempty"`
|
|
TenantID *string `json:"tenantId,omitempty"` // 추가
|
|
RelyingPartyID *string `json:"relyingPartyId,omitempty"` // 추가
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
Tenant *Tenant `json:"tenant,omitempty"`
|
|
ManageableTenants []Tenant `json:"manageableTenants,omitempty"` // 추가: 관리 가능한 테넌트 목록
|
|
}
|
|
|
|
type UpdateUserRequest struct {
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
Department string `json:"department"`
|
|
VerificationCode string `json:"verificationCode,omitempty"` // For phone change
|
|
}
|
|
|
|
// PasswordResetInitiateRequest is the request body for initiating a password reset.
|
|
type PasswordResetInitiateRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
DryRun bool `json:"dryRun,omitempty"`
|
|
DrySend bool `json:"drySend,omitempty"`
|
|
}
|
|
|
|
// PasswordResetCompleteRequest is the request body for completing a password reset.
|
|
type PasswordResetCompleteRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
NewPassword string `json:"newPassword"`
|
|
}
|
|
|
|
// PasswordChangeRequest는 로그인 상태에서 비밀번호 변경 요청을 표현합니다.
|
|
type PasswordChangeRequest struct {
|
|
CurrentPassword string `json:"currentPassword"`
|
|
NewPassword string `json:"newPassword"`
|
|
}
|