auth: cut over community machine access to agent keys
This commit is contained in:
@@ -87,11 +87,11 @@ async function publishOperation(page, workspaceId, operationId, version = 1) {
|
||||
);
|
||||
}
|
||||
|
||||
async function createPlatformApiKey(page, workspaceId, name, scopes) {
|
||||
async function createPlatformApiKey(page, workspaceId, agentId, name, scopes) {
|
||||
return browserJson(
|
||||
page,
|
||||
'POST',
|
||||
`/api/admin/workspaces/${encodeURIComponent(workspaceId)}/platform-api-keys`,
|
||||
`/api/admin/workspaces/${encodeURIComponent(workspaceId)}/agents/${encodeURIComponent(agentId)}/platform-api-keys`,
|
||||
{ name, scopes },
|
||||
);
|
||||
}
|
||||
@@ -520,7 +520,13 @@ async function setupPublishedAgent(page, { operationPayload, agentSlug, toolName
|
||||
]);
|
||||
await publishAgent(page, workspace.id, createdAgent.agent_id, createdAgent.version);
|
||||
|
||||
const key = await createPlatformApiKey(page, workspace.id, uniqueName('playwright_key'), ['read', 'write']);
|
||||
const key = await createPlatformApiKey(
|
||||
page,
|
||||
workspace.id,
|
||||
createdAgent.agent_id,
|
||||
uniqueName('playwright_key'),
|
||||
['read', 'write']
|
||||
);
|
||||
|
||||
return {
|
||||
workspace,
|
||||
|
||||
Reference in New Issue
Block a user