Documentation
¶
Index ¶
- Constants
- func EnsureAdminOnUser(ctx *types.ServiceContext, targetUserID string) error
- func GetSessionExpiration() time.Duration
- func Register()
- type AdminSession
- type AdminSessionDeleteReq
- type AdminSessionDeleteRsp
- type AdminSessionGetRsp
- type AdminSessionListRsp
- type AdminSessionOwnerView
- type AdminUserCreateReq
- type AdminUserCreateRsp
- type AdminUserGetRsp
- type AdminUserListRsp
- type AdminUserPatchReq
- type AdminUserPatchRsp
- type AdminUserSession
- type AdminUserSessionDeleteReq
- type AdminUserSessionDeleteRsp
- type AdminUserSessionListRsp
- type AdminUserView
- type AuthenticatedSessionRsp
- type AuthenticatedSessionView
- type ChangePasswordReq
- type ChangePasswordRsp
- type CurrentDeleteReq
- type CurrentDeleteRsp
- type CurrentGetRsp
- type EmailIdentity
- type LoginReq
- type LoginRsp
- type LogoutRsp
- type PasswordCredential
- type PrincipalView
- type Profile
- type ProfileGetRsp
- type ProfilePatchReq
- type ProfilePatchRsp
- type ResetPasswordReq
- type ResetPasswordRsp
- type Session
- type SessionDeleteAllReq
- type SessionDeleteAllRsp
- type SessionDeleteReq
- type SessionDeleteRsp
- type SessionGetRsp
- type SessionListRsp
- type SessionView
- type SignupReq
- type SignupRsp
- type User
- type UserStatus
Constants ¶
const ( UserStatusActive = modeliamuser.UserStatusActive UserStatusInactive = modeliamuser.UserStatusInactive UserStatusLocked = modeliamuser.UserStatusLocked )
Variables ¶
This section is empty.
Functions ¶
func EnsureAdminOnUser ¶
func EnsureAdminOnUser(ctx *types.ServiceContext, targetUserID string) error
EnsureAdminOnUser reports whether the acting user may administer the target user under the IAM tenant-admin rules, returning a service error when it may not. System-root actors are granted globally; a tenant administrator must hold route permission in the current tenant and the target must belong to that same tenant, and system-root targets are never manageable through tenant-local admin APIs.
This is the seam other framework modules use to reuse IAM authorization. Resolving the two users and evaluating the rules are IAM's own steps, so a caller states what it wants to know rather than reproducing the procedure — and IAM stays free to change the procedure without touching those modules.
func GetSessionExpiration ¶
GetSessionExpiration returns the configured session expiration time. If not configured, it returns the default value of 8 hours.
func Register ¶
func Register()
Register registers IAM models, API routes, middleware, and scheduled jobs.
API Routes:
Session routes:
- GET /api/iam/session/current
- DELETE /api/iam/session/current
- GET /api/iam/sessions
- GET /api/iam/admin/sessions
- GET /api/iam/admin/sessions/:id
- DELETE /api/iam/admin/sessions/:id
- GET /api/iam/admin/users/:id/sessions
- DELETE /api/iam/admin/users/:id/sessions
- GET /api/iam/sessions/:id
- DELETE /api/iam/sessions
- DELETE /api/iam/sessions/:id
Note: DELETE /api/iam/sessions/:id treats id=others as a reserved self-service bulk logout that revokes every other session of the current user.
Account management routes:
- POST /api/login
- POST /api/logout
- POST /api/signup
- POST /api/iam/change-password
- POST /api/iam/reset-password
- POST /api/iam/admin/users
- GET /api/iam/admin/users
- GET /api/iam/admin/users/:id
- PATCH /api/iam/admin/users/:id
- GET /api/iam/profile
- PATCH /api/iam/profile
Middleware:
- IAMSession for protected IAM routes and session-aware APIs
Configuration:
- IAM_SESSION_EXPIRATION sets the session lifetime; it defaults to 8 hours. It is read at registration so an unparseable value fails startup rather than the first login.
NOTE: Register IAM modules before authz modules because authz middleware depends on IAMSession.
Types ¶
type AdminSessionDeleteReq ¶
type AdminSessionDeleteReq = modeliamsession.AdminSessionDeleteReq
Admin session API aliases.
type AdminSessionDeleteRsp ¶
type AdminSessionDeleteRsp = modeliamsession.AdminSessionDeleteRsp
Admin session API aliases.
type AdminSessionGetRsp ¶
type AdminSessionGetRsp = modeliamsession.AdminSessionGetRsp
Admin session API aliases.
type AdminSessionListRsp ¶
type AdminSessionListRsp = modeliamsession.AdminSessionListRsp
Admin session API aliases.
type AdminSessionOwnerView ¶
type AdminSessionOwnerView = modeliamsession.AdminSessionOwnerView
Admin session API aliases.
type AdminUserCreateReq ¶
type AdminUserCreateReq = modeliamuser.AdminUserCreateReq
User API aliases.
type AdminUserCreateRsp ¶
type AdminUserCreateRsp = modeliamuser.AdminUserCreateRsp
User API aliases.
type AdminUserSession ¶
type AdminUserSession = modeliamsession.AdminUserSession
Admin session API aliases.
type AdminUserSessionDeleteReq ¶
type AdminUserSessionDeleteReq = modeliamsession.AdminUserSessionDeleteReq
Admin session API aliases.
type AdminUserSessionDeleteRsp ¶
type AdminUserSessionDeleteRsp = modeliamsession.AdminUserSessionDeleteRsp
Admin session API aliases.
type AdminUserSessionListRsp ¶
type AdminUserSessionListRsp = modeliamsession.AdminUserSessionListRsp
Admin session API aliases.
type AuthenticatedSessionRsp ¶
type AuthenticatedSessionRsp = modeliamsession.AuthenticatedSessionRsp
Session API aliases.
type AuthenticatedSessionView ¶
type AuthenticatedSessionView = modeliamsession.AuthenticatedSessionView
Session API aliases.
type ChangePasswordReq ¶
type ChangePasswordReq = modeliamaccount.ChangePasswordReq
Account API aliases.
type ChangePasswordRsp ¶
type ChangePasswordRsp = modeliamaccount.ChangePasswordRsp
Account API aliases.
type CurrentDeleteReq ¶
type CurrentDeleteReq = modeliamsession.CurrentDeleteReq
Session API aliases.
type CurrentDeleteRsp ¶
type CurrentDeleteRsp = modeliamsession.CurrentDeleteRsp
Session API aliases.
type PasswordCredential ¶
type PasswordCredential = modeliamaccount.PasswordCredential
User API aliases.
type ResetPasswordReq ¶
type ResetPasswordReq = modeliamaccount.ResetPasswordReq
Account API aliases.
type ResetPasswordRsp ¶
type ResetPasswordRsp = modeliamaccount.ResetPasswordRsp
Account API aliases.
type SessionDeleteAllReq ¶
type SessionDeleteAllReq = modeliamsession.SessionDeleteAllReq
Session API aliases.
type SessionDeleteAllRsp ¶
type SessionDeleteAllRsp = modeliamsession.SessionDeleteAllRsp
Session API aliases.
type SessionDeleteReq ¶
type SessionDeleteReq = modeliamsession.SessionDeleteReq
Session API aliases.
type SessionDeleteRsp ¶
type SessionDeleteRsp = modeliamsession.SessionDeleteRsp
Session API aliases.