feat: display SSH cert principals in expanded certificate details
This commit is contained in:
+2
-2
@@ -1331,10 +1331,10 @@ export const api = {
|
|||||||
}, true, requestConfig),
|
}, true, requestConfig),
|
||||||
|
|
||||||
// Sign a certificate for the given key
|
// 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<SSHSignResponse>('/ssh/sign', {
|
request<SSHSignResponse>('/ssh/sign', {
|
||||||
method: 'POST',
|
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),
|
}, true, requestConfig),
|
||||||
|
|
||||||
// Issue a host certificate by submitting a raw server host public key
|
// Issue a host certificate by submitting a raw server host public key
|
||||||
|
|||||||
@@ -291,6 +291,9 @@ function CertificateRow({ cert }: { cert: AdminUserSshCertificate }) {
|
|||||||
<span className="text-muted-foreground">CA ID</span>
|
<span className="text-muted-foreground">CA ID</span>
|
||||||
<span className="font-mono truncate">{cert.ca_id}</span>
|
<span className="font-mono truncate">{cert.ca_id}</span>
|
||||||
|
|
||||||
|
<span className="text-muted-foreground">Principals</span>
|
||||||
|
<span className="font-mono">{cert.principals.join(", ")}</span>
|
||||||
|
|
||||||
{cert.request_ip && (
|
{cert.request_ip && (
|
||||||
<>
|
<>
|
||||||
<span className="text-muted-foreground">Request IP</span>
|
<span className="text-muted-foreground">Request IP</span>
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import {
|
|||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from "@/components/ui/alert-dialog";
|
} from "@/components/ui/alert-dialog";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
|
import { useOrg } from "@/contexts/OrgContext";
|
||||||
import { api, SSHKey, SSHCertificate, ApiError, PrincipalOption, MyPrincipalsOrg, DeptCertPolicy } from "@/lib/api";
|
import { api, SSHKey, SSHCertificate, ApiError, PrincipalOption, MyPrincipalsOrg, DeptCertPolicy } from "@/lib/api";
|
||||||
import { formatDate as _formatDate } from "@/lib/date";
|
import { formatDate as _formatDate } from "@/lib/date";
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ function CopyButton({ text }: { text: string }) {
|
|||||||
|
|
||||||
export default function SSHKeysPage() {
|
export default function SSHKeysPage() {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
const { selectedOrgId } = useOrg();
|
||||||
|
|
||||||
// Key list state
|
// Key list state
|
||||||
const [keys, setKeys] = useState<SSHKey[]>([]);
|
const [keys, setKeys] = useState<SSHKey[]>([]);
|
||||||
@@ -379,6 +381,7 @@ export default function SSHKeysPage() {
|
|||||||
principals.length > 0 ? principals : undefined,
|
principals.length > 0 ? principals : undefined,
|
||||||
certType,
|
certType,
|
||||||
parsedExpiry,
|
parsedExpiry,
|
||||||
|
selectedOrgId ?? undefined,
|
||||||
);
|
);
|
||||||
setCertResult(result.certificate);
|
setCertResult(result.certificate);
|
||||||
fetchCerts(); // refresh certs list
|
fetchCerts(); // refresh certs list
|
||||||
|
|||||||
Reference in New Issue
Block a user