feat(access): add guest chat ACL (#235)

This commit is contained in:
BBQ
2026-03-14 17:15:41 +08:00
committed by GitHub
parent c8728ffc2c
commit 839e63acda
86 changed files with 6886 additions and 2554 deletions
+17 -18
View File
@@ -19,7 +19,6 @@ type Bot struct {
MaxContextLoadTime int32 `json:"max_context_load_time"`
MaxContextTokens int32 `json:"max_context_tokens"`
Language string `json:"language"`
AllowGuest bool `json:"allow_guest"`
ReasoningEnabled bool `json:"reasoning_enabled"`
ReasoningEffort string `json:"reasoning_effort"`
MaxInboxItems int32 `json:"max_inbox_items"`
@@ -37,6 +36,23 @@ type Bot struct {
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type BotAclRule struct {
ID pgtype.UUID `json:"id"`
BotID pgtype.UUID `json:"bot_id"`
Action string `json:"action"`
Effect string `json:"effect"`
SubjectKind string `json:"subject_kind"`
UserID pgtype.UUID `json:"user_id"`
ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
SourceChannel pgtype.Text `json:"source_channel"`
SourceConversationType pgtype.Text `json:"source_conversation_type"`
SourceConversationID pgtype.Text `json:"source_conversation_id"`
SourceThreadID pgtype.Text `json:"source_thread_id"`
CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type BotChannelConfig struct {
ID pgtype.UUID `json:"id"`
BotID pgtype.UUID `json:"bot_id"`
@@ -129,23 +145,6 @@ type BotInbox struct {
ReadAt pgtype.Timestamptz `json:"read_at"`
}
type BotMember struct {
BotID pgtype.UUID `json:"bot_id"`
UserID pgtype.UUID `json:"user_id"`
Role string `json:"role"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type BotPreauthKey struct {
ID pgtype.UUID `json:"id"`
BotID pgtype.UUID `json:"bot_id"`
Token string `json:"token"`
IssuedByUserID pgtype.UUID `json:"issued_by_user_id"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
UsedAt pgtype.Timestamptz `json:"used_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type BotStorageBinding struct {
ID pgtype.UUID `json:"id"`
BotID pgtype.UUID `json:"bot_id"`