The JSON view of a delegation for `--json`.
(resolved: &ResolvedDelegation)
| 132 | |
| 133 | /// The JSON view of a delegation for `--json`. |
| 134 | fn describe_delegation(resolved: &ResolvedDelegation) -> serde_json::Value { |
| 135 | let d = &resolved.delegation; |
| 136 | json!({ |
| 137 | "id": d.id.to_urn(), |
| 138 | "delegator": d.delegator, |
| 139 | "delegatorName": d.delegator_name, |
| 140 | "softwareAgent": d.software_agent, |
| 141 | "permissions": d.scope.permissions.iter().map(|p| p.to_string()).collect::<Vec<_>>(), |
| 142 | "servers": d.scope.servers, |
| 143 | "workspaces": d.scope.workspaces, |
| 144 | "projects": d.scope.projects, |
| 145 | "views": d.scope.views, |
| 146 | "maxChanges": d.scope.max_changes, |
| 147 | "issued": d.issued.to_rfc3339(), |
| 148 | "expires": d.expires.map(|e| e.to_rfc3339()), |
| 149 | "status": resolved.status.to_string(), |
| 150 | }) |
| 151 | } |
| 152 | |
| 153 | /// Render a list into a fixed width, eliding the tail as `first,+n`. |
| 154 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected