reads hosts and certificates against a live NPM 2.15.1. one grantable permission, with /_config owner-only — reading which hosts are healthy is worth sharing, an NPM admin login is not, and NPM has no read-only role. the quirk that shapes the whole plugin: NPM answers an unauthenticated read with 404, not 401, because its router only registers a resource once a token is present. so 'not signed in' and 'no such endpoint' are the same response, and a naive client tells you a feature is missing when your password is wrong. the client mints a fresh token and retries once, then reports a persistent 404 as likelyAuth. certificates sort by expiry rather than name, which is the only ordering that answers a question. no create/edit/delete and no cert issuance: NPM's own UI does those and a wrong proxy host takes a domain off the internet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
789 B
TypeScript
20 lines
789 B
TypeScript
import { Route, ShieldCheck } from 'lucide-react';
|
|
import type { AppRegistryMeta } from 'officerdev';
|
|
import { HostsPanel } from './HostsPanel';
|
|
import { CertificatesPanel } from './CertificatesPanel';
|
|
|
|
// Two panels. Hosts is what the plugin is for; certificates is the thing that quietly breaks and is
|
|
// worth seeing beside it rather than a click away.
|
|
//
|
|
// `availableOnPanel: false` — these belong to this plugin's screen, not to the generic panel picker.
|
|
export const appRegistryMetas: AppRegistryMeta[] = [
|
|
{ key: 'proxy-manager-hosts', name: 'Hosts', icon: Route, component: HostsPanel, availableOnPanel: false },
|
|
{
|
|
key: 'proxy-manager-certificates',
|
|
name: 'Certificates',
|
|
icon: ShieldCheck,
|
|
component: CertificatesPanel,
|
|
availableOnPanel: false,
|
|
},
|
|
];
|