Documentation
¶
Index ¶
Constants ¶
View Source
const ( ManagerServiceUsername = "manager-service" ChatServiceUsername = "chat-service" NotificationUsername = "notification-service" AdminServiceUsername = "admin-service" StorageServiceUsername = "storage-service" StoryUsername = "story-service" RAGServiceUsername = "rag-service" )
Variables ¶
View Source
var AdminRoles = []Role{RoleSuperUser, RoleSupport, RoleStory, RoleFile, RoleNotification}
View Source
var AllUserRole = []Role{RoleSuperUser, RoleSupport, RoleStory, RoleFile, RoleNotification, RoleClient, RoleGuest, RoleBot, RoleService}
Functions ¶
func IsAdminRole ¶
func IsValidRole ¶
Types ¶
type ContextType ¶
type ContextType string
const AuthorizationKey ContextType = "authorization"
const UserContextKey ContextType = "user_claims"
type ID ¶
type ID string
const ( BotUserID ID = "01J00000000000000000000BOT" ManagerServiceUserID ID = "01J0000000000000000MANAGER" ChatServiceUserID ID = "01J0000000000000000000CHAT" NotificationUserID ID = "01J000000000000000000NOTIF" AdminUserID ID = "01J000000000000000000ADMIN" StorageUserID ID = "01J0000000000000000STORAGE" StoryUserID ID = "01J000000000000000000STORY" RAGUserID ID = "01J00000000000000000000RAG" )
type UserClaims ¶
type UserClaims struct {
jwt.RegisteredClaims
UserID ID `json:"user_id"`
Roles []Role `json:"roles"`
TokenType TokenType `json:"token_type"`
}
Click to show internal directories.
Click to hide internal directories.