chore: remove chats experiment (#18535)

This commit is contained in:
Danny Kopping
2025-06-25 13:03:32 +00:00
committed by GitHub
parent 9fde8353ad
commit 688d2ee3eb
56 changed files with 16 additions and 7505 deletions
-11
View File
@@ -54,16 +54,6 @@ var (
Type: "audit_log",
}
// ResourceChat
// Valid Actions
// - "ActionCreate" :: create a chat
// - "ActionDelete" :: delete a chat
// - "ActionRead" :: read a chat
// - "ActionUpdate" :: update a chat
ResourceChat = Object{
Type: "chat",
}
// ResourceCryptoKey
// Valid Actions
// - "ActionCreate" :: create crypto keys
@@ -378,7 +368,6 @@ func AllResources() []Objecter {
ResourceAssignOrgRole,
ResourceAssignRole,
ResourceAuditLog,
ResourceChat,
ResourceCryptoKey,
ResourceDebugInfo,
ResourceDeploymentConfig,
-8
View File
@@ -124,14 +124,6 @@ var RBACPermissions = map[string]PermissionDefinition{
ActionRead: actDef("read and use a workspace proxy"),
},
},
"chat": {
Actions: map[Action]ActionDefinition{
ActionCreate: actDef("create a chat"),
ActionRead: actDef("read a chat"),
ActionDelete: actDef("delete a chat"),
ActionUpdate: actDef("update a chat"),
},
},
"license": {
Actions: map[Action]ActionDefinition{
ActionCreate: actDef("create a license"),
-2
View File
@@ -305,8 +305,6 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
ResourceOrganizationMember.Type: {policy.ActionRead},
// Users can create provisioner daemons scoped to themselves.
ResourceProvisionerDaemon.Type: {policy.ActionRead, policy.ActionCreate, policy.ActionRead, policy.ActionUpdate},
// Users can create, read, update, and delete their own agentic chat messages.
ResourceChat.Type: {policy.ActionCreate, policy.ActionRead, policy.ActionUpdate, policy.ActionDelete},
})...,
),
}.withCachedRegoValue()
-31
View File
@@ -849,37 +849,6 @@ func TestRolePermissions(t *testing.T) {
},
},
},
// Members may read their own chats.
{
Name: "CreateReadUpdateDeleteMyChats",
Actions: []policy.Action{policy.ActionCreate, policy.ActionRead, policy.ActionUpdate, policy.ActionDelete},
Resource: rbac.ResourceChat.WithOwner(currentUser.String()),
AuthorizeMap: map[bool][]hasAuthSubjects{
true: {memberMe, orgMemberMe, owner},
false: {
userAdmin, orgUserAdmin, templateAdmin,
orgAuditor, orgTemplateAdmin,
otherOrgMember, otherOrgAuditor, otherOrgUserAdmin, otherOrgTemplateAdmin,
orgAdmin, otherOrgAdmin,
},
},
},
// Only owners can create, read, update, and delete other users' chats.
{
Name: "CreateReadUpdateDeleteOtherUserChats",
Actions: []policy.Action{policy.ActionCreate, policy.ActionRead, policy.ActionUpdate, policy.ActionDelete},
Resource: rbac.ResourceChat.WithOwner(uuid.NewString()), // some other user
AuthorizeMap: map[bool][]hasAuthSubjects{
true: {owner},
false: {
memberMe, orgMemberMe,
userAdmin, orgUserAdmin, templateAdmin,
orgAuditor, orgTemplateAdmin,
otherOrgMember, otherOrgAuditor, otherOrgUserAdmin, otherOrgTemplateAdmin,
orgAdmin, otherOrgAdmin,
},
},
},
}
// We expect every permission to be tested above.