dynamicGrantRules expands a grant on a role into the credential paths its requests need (generate) and the role CRUD paths (manage); unticked access comes back empty so writing it revokes. Roles get an Access panel showing who can generate credentials or manage them, and the identity Access editor can pick dynamic mounts and roles. Checked against capabilities-self and a real token in the integration tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
13 lines
482 B
TypeScript
13 lines
482 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import type { BaoClient } from '../../api/bao'
|
|
import { mountKind } from '../../api/engines/registry'
|
|
import { listMounts } from '../../api/secrets'
|
|
|
|
/** KV v2 and dynamic-engine mounts (system, cubbyhole and identity mounts are left out). */
|
|
export function useMounts(client: BaoClient) {
|
|
return useQuery({
|
|
queryKey: ['mounts'],
|
|
queryFn: async () => (await listMounts(client)).filter((m) => mountKind(m) !== null),
|
|
})
|
|
}
|