Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion policy/memory-action.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ const (
// MemoryListSecretsAction - list the secrets in a cortex.
MemoryListSecretsAction MemoryAction = "memory:ListSecrets"

// MemoryPutAgentAction - write an agent record in a cortex.
// MemoryPutAgentAction - create an agent record, or write a memory beneath it.
// Create-only: it never modifies an existing record.
MemoryPutAgentAction MemoryAction = "memory:PutAgent"

// MemoryUpdateAgentAction - modify an existing agent record. Separate from
// MemoryPutAgentAction because an update re-derives the agent's IAM policy.
MemoryUpdateAgentAction MemoryAction = "memory:UpdateAgent"

// MemoryGetAgentAction - read an agent record from a cortex.
MemoryGetAgentAction MemoryAction = "memory:GetAgent"

Expand Down Expand Up @@ -84,6 +89,7 @@ var SupportedMemoryActions = map[MemoryAction]struct{}{
MemoryDeleteSecretAction: {},
MemoryListSecretsAction: {},
MemoryPutAgentAction: {},
MemoryUpdateAgentAction: {},
MemoryGetAgentAction: {},
MemoryDeleteAgentAction: {},
MemoryListAgentsAction: {},
Expand Down
1 change: 1 addition & 0 deletions policy/memory-action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestMemoryActionIsValid(t *testing.T) {
{MemoryDeleteSecretAction, true},
{MemoryListSecretsAction, true},
{MemoryPutAgentAction, true},
{MemoryUpdateAgentAction, true},
{MemoryGetAgentAction, true},
{MemoryDeleteAgentAction, true},
{MemoryListAgentsAction, true},
Expand Down
2 changes: 1 addition & 1 deletion policy/memory-resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ func TestMemoryEnumerationConditionKeys(t *testing.T) {
listActions := []string{
"memory:ListAgents", "memory:ListSecrets", "memory:ListCortexes", "memory:Search",
}
pointActions := []string{"memory:GetAgent", "memory:PutAgent", "memory:DeleteAgent", "memory:GetSecret", "memory:GetObjectBio"}
pointActions := []string{"memory:GetAgent", "memory:PutAgent", "memory:DeleteAgent", "memory:GetSecret", "memory:GetObjectBio", "memory:UpdateAgent"}

for _, action := range listActions {
keys, ok := MemoryActionConditionKeyMap[Action(action)]
Expand Down
Loading