diff --git a/src/lib/api.ts b/src/lib/api.ts index 8c06de0..f93e5c6 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1331,10 +1331,10 @@ export const api = { }, true, requestConfig), // Sign a certificate for the given key - signCertificate: (key_id: string, principals?: string[], cert_type?: 'user' | 'host', expiry_hours?: number, requestConfig?: RequestConfig) => + signCertificate: (key_id: string, principals?: string[], cert_type?: 'user' | 'host', expiry_hours?: number, organization_id?: string, requestConfig?: RequestConfig) => request('/ssh/sign', { method: 'POST', - body: JSON.stringify({ key_id, principals, cert_type, expiry_hours }), + body: JSON.stringify({ key_id, principals, cert_type, expiry_hours, organization_id }), }, true, requestConfig), // Issue a host certificate by submitting a raw server host public key diff --git a/src/pages/admin/UserManagementPage.tsx b/src/pages/admin/UserManagementPage.tsx index 596dcac..5635ff0 100644 --- a/src/pages/admin/UserManagementPage.tsx +++ b/src/pages/admin/UserManagementPage.tsx @@ -291,6 +291,9 @@ function CertificateRow({ cert }: { cert: AdminUserSshCertificate }) { CA ID {cert.ca_id} + Principals + {cert.principals.join(", ")} + {cert.request_ip && ( <> Request IP diff --git a/src/pages/user/SSHKeysPage.tsx b/src/pages/user/SSHKeysPage.tsx index b924449..068112e 100644 --- a/src/pages/user/SSHKeysPage.tsx +++ b/src/pages/user/SSHKeysPage.tsx @@ -47,6 +47,7 @@ import { AlertDialogTitle, } from "@/components/ui/alert-dialog"; import { useToast } from "@/hooks/use-toast"; +import { useOrg } from "@/contexts/OrgContext"; import { api, SSHKey, SSHCertificate, ApiError, PrincipalOption, MyPrincipalsOrg, DeptCertPolicy } from "@/lib/api"; import { formatDate as _formatDate } from "@/lib/date"; @@ -87,6 +88,7 @@ function CopyButton({ text }: { text: string }) { export default function SSHKeysPage() { const { toast } = useToast(); + const { selectedOrgId } = useOrg(); // Key list state const [keys, setKeys] = useState([]); @@ -379,6 +381,7 @@ export default function SSHKeysPage() { principals.length > 0 ? principals : undefined, certType, parsedExpiry, + selectedOrgId ?? undefined, ); setCertResult(result.certificate); fetchCerts(); // refresh certs list