How usnistgov/policy-machine-admin works
Policy Machine Admin is a browser UI for administering NGAC policies through a gRPC-Web proxy. Users sign in, enter the protected dashboard, browse the policy-node hierarchy, and inspect or change policy data; the API layer issues query and adjudication requests to the backend. Other documented capabilities include PML editing and execution, operations, prohibitions, obligations, access-right selection, and graph/DAG views. Edges reflect sampled calls, imports listed in the SOURCE INDEX, or README statements; unsampled implementations are represented only where the tree supports the subsystem.
Main entry points: pdp_query.api.ts PDP queries · pdp_adjudication.api.ts PDP adjudication · DashboardPage.tsx Dashboard · Router.tsx Route dispatcher
Components 26
Application shell
- Route dispatcher
src/Router.tsx - Protected route
src/ProtectedRoute.tsx - Login
src/pages/login/Login.tsx - Dashboard
src/pages/dashboard/DashboardPage.tsx - Local auth
src/lib/auth.tsx
Policy browsing
- Policy tree
src/features/pmtree/PMTree.tsx - Tree operations
src/features/pmtree/hooks/usePMTreeOperations.ts - Tree data fetch
src/features/pmtree/tree-data-fetcher.ts - Tree model
src/features/pmtree/tree-utils.tsx - Node details
src/features/info/InfoPanel.tsx - Association graph
src/pages/dag/dag.tsx - Association editor
src/pages/dag/AssociationModal.tsx - Graph rendering
src/features/graph/GraphBuilder.tsx
Policy administration
- PML editor
src/features/pml/PMLEditor.tsx - Operations
src/features/operations/Operations.tsx - Prohibitions
src/features/prohibitions/ProhibitionsPanel.tsx - Obligations
src/features/obligations/ObligationsPanel.tsx - Access rights
src/components/access-rights/AccessRightsSelection.tsx - Policy classes
src/pages/dashboard/PolicyClassesPanel.tsx
Backend access
- Policy data types
src/shared/api/pdp.types.ts - PDP queries
src/shared/api/pdp_query.api.ts - PDP adjudication
src/shared/api/pdp_adjudication.api.ts - gRPC-Web transport
src/lib/grpc-client.ts
Other components
- Administrator
- Envoy proxy
- Policy Machine backend
Connections 35
- Administrator → Route dispatcher: opens
src/Router.tsx - Route dispatcher → Login: routes
src/Router.tsx - Route dispatcher → Protected route: protects
src/Router.tsx - Protected route → Local auth: checks session
src/ProtectedRoute.tsx - Route dispatcher → Dashboard: routes
src/Router.tsx - Login → Local auth: authenticates
src/pages/login/Login.tsx - Dashboard → Node details: displays
src/pages/dashboard/DashboardPage.tsx - Dashboard → Policy classes: displays
src/pages/dashboard/DashboardPage.tsx - Dashboard → Association graph: opens graph
- Dashboard → PML editor: opens editor
- Policy tree → Tree operations: loads children
- Tree operations → Tree data fetch: fetches filtered children
src/features/pmtree/hooks/usePMTreeOperations.ts - Tree operations → Tree model: updates children
src/features/pmtree/hooks/usePMTreeOperations.ts - Tree data fetch → PDP queries: queries nodes
src/features/pmtree/tree-data-fetcher.ts - Node details → Policy tree: renders picker
src/features/info/InfoPanel.tsx - Node details → Tree data fetch: fetches associations
src/features/info/InfoPanel.tsx - Association graph → Association editor: opens editor
src/pages/dag/dag.tsx - Association editor → PDP queries: reads policy
src/pages/dag/AssociationModal.tsx - Association editor → PDP adjudication: changes associations
src/pages/dag/AssociationModal.tsx - PML editor → PDP adjudication: executes PML
src/features/pml/PMLEditor.tsx - Operations → PDP queries: reads operations
src/features/operations/Operations.tsx - Operations → PDP adjudication: adjudicates
src/features/operations/Operations.tsx - Prohibitions → PDP queries: reads policy
- Prohibitions → PDP adjudication: changes policy
- Obligations → PDP queries: reads policy
- Obligations → PDP adjudication: changes policy
- Policy classes → PDP queries: queries policy
src/pages/dashboard/PolicyClassesPanel.tsx - Policy classes → PDP adjudication: changes policy
src/pages/dashboard/PolicyClassesPanel.tsx - Access rights → Policy data types: uses policy types
- PDP queries → Policy data types: uses models
src/shared/api/pdp_query.api.ts - PDP adjudication → gRPC-Web transport: sends RPCs
src/shared/api/pdp_adjudication.api.ts - PDP queries → gRPC-Web transport: sends RPCs
src/shared/api/pdp_query.api.ts - gRPC-Web transport → Envoy proxy: gRPC-Web
README.md - Envoy proxy → Policy Machine backend: forwards requests
README.md - Graph rendering → Association graph: renders graph