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
6 changes: 3 additions & 3 deletions packages/api/agent_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ func CallCreateAgentVaultSessionLogChunk(ctx context.Context, httpClient *resty.
}

type CreateAgentVaultSessionRequest struct {
AccessBundles []string `json:"accessBundles"`
TTL string `json:"ttl"`
Label string `json:"label,omitempty"`
AccessBundle string `json:"accessBundle"`
TTL string `json:"ttl"`
Comment thread
saifsmailbox98 marked this conversation as resolved.
Resolved
Label string `json:"label,omitempty"`
}

type AgentVaultSession struct {
Expand Down
4 changes: 2 additions & 2 deletions packages/api/agent_vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func TestAgentVaultCredentialCallsRefuseAnOversizedBody(t *testing.T) {

func TestCreateAgentVaultSessionRequestSendsALabelOnlyWhenGiven(t *testing.T) {
// Without --label the request body stays exactly what it was before sessions had labels.
unlabeled, err := json.Marshal(CreateAgentVaultSessionRequest{AccessBundles: []string{"coding-agent"}, TTL: "never"})
unlabeled, err := json.Marshal(CreateAgentVaultSessionRequest{AccessBundle: "coding-agent", TTL: "never"})
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(unlabeled), "label") {
t.Errorf("want no label key, got %s", unlabeled)
}

labeled, err := json.Marshal(CreateAgentVaultSessionRequest{AccessBundles: []string{"coding-agent"}, TTL: "never", Label: "nightly deploy"})
labeled, err := json.Marshal(CreateAgentVaultSessionRequest{AccessBundle: "coding-agent", TTL: "never", Label: "nightly deploy"})
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cmd/agent_vault_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func runAgentVaultRun(cmd *cobra.Command, args []string) {
}
httpClient.SetAuthToken(identity)

created, mintErr := api.CallCreateAgentVaultSession(httpClient, api.CreateAgentVaultSessionRequest{AccessBundles: accessBundles, TTL: ttl, Label: label})
created, mintErr := api.CallCreateAgentVaultSession(httpClient, api.CreateAgentVaultSessionRequest{AccessBundle: accessBundles[0], TTL: ttl, Label: label})
if mintErr != nil {
util.HandleError(mintErr, "Unable to mint an Agent Vault session")
}
Expand Down
Loading