fix(secrets): include skill metadata references in usages, route, and delete dialog
secretsSvc.usages() previously only scanned agent env bindings. Skills can
reference a secret via metadata.sourceAuthSecretId (set by the PAT auth
feature), so removing a secret without checking those references could orphan
a sibling skill's PAT pointer.
- Extend usages() to return { agents, skills } with both reference kinds.
- Update remove() to block when either array is non-empty.
- /secrets/:id/usages now responds with { agents, skills }.
- The delete dialog displays both kinds inline so the operator knows which
references to detach first.
This commit is contained in:
@@ -23,5 +23,8 @@ export const secretsApi = {
|
||||
) => api.patch<CompanySecret>(`/secrets/${id}`, data),
|
||||
remove: (id: string) => api.delete<{ ok: true }>(`/secrets/${id}`),
|
||||
usages: (id: string) =>
|
||||
api.get<{ agents: { id: string; name: string; envKeys: string[] }[] }>(`/secrets/${id}/usages`),
|
||||
api.get<{
|
||||
agents: { id: string; name: string; envKeys: string[] }[];
|
||||
skills: { id: string; name: string; slug: string }[];
|
||||
}>(`/secrets/${id}/usages`),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user