types

package
v0.0.0-...-3c68a0f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

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

Functions

func IsAdminRole

func IsAdminRole(role Role) bool

func IsValidRole

func IsValidRole(role Role) bool

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 Role

type Role string
const (
	RoleSuperUser    Role = "superuser"
	RoleSupport      Role = "support"
	RoleStory        Role = "story"
	RoleFile         Role = "file"
	RoleNotification Role = "notification"
	RoleClient       Role = "client"
	RoleGuest        Role = "guest"
	RoleBot          Role = "bot"
	RoleService      Role = "service"
)

type TokenType

type TokenType string
const (
	TokenTypeAccess  TokenType = "access"
	TokenTypeRefresh TokenType = "refresh"
	TokenTypeGuest   TokenType = "guest"
	TokenTypeClient  TokenType = "client"
)

type UserClaims

type UserClaims struct {
	jwt.RegisteredClaims

	UserID    ID        `json:"user_id"`
	Roles     []Role    `json:"roles"`
	TokenType TokenType `json:"token_type"`
}

Jump to

Keyboard shortcuts

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