Skip to content

Commit dfe37e3

Browse files
authored
fix(auth): tell a first-run operator where the first certificate comes from (#106)
On a fleet nobody has logged in to yet, the no-certificate denial told the reader their fleet operator issues the certificate. At first run the reader is the operator and no certificate exists yet, so the landing page was a dead end. The install help now carries a short first-run section: issue the first admin credential from the operator CA the manager trusts (operatorCAPath), and a link to the deployment guide section with the OpenSSL recipe. Refs #70
1 parent f525432 commit dfe37e3

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

‎src/components/layout/certificate-help.test.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,20 @@ describe("CertificateHelp", () => {
5454

5555
expect(screen.getByText(/reload/i)).toBeInTheDocument();
5656
});
57+
58+
// On a fleet nobody has logged in to yet, "your fleet operator issues the
59+
// certificate" names someone who does not exist: the person reading this is
60+
// the operator, and no certificate has been issued (#70). Until the manager
61+
// can mint the first one itself, say where it comes from instead of leaving
62+
// them at a dead end.
63+
it("tells someone standing up a new fleet where the first certificate comes from", () => {
64+
render(<CertificateHelp />);
65+
66+
expect(screen.getByRole("heading", { name: /new fleet/i })).toBeInTheDocument();
67+
expect(screen.getByText(/operatorCAPath/)).toBeInTheDocument();
68+
expect(screen.getByRole("link", { name: /deployment guide/i })).toHaveAttribute(
69+
"href",
70+
expect.stringMatching(/manager\/blob\/main\/docs\/deploying-standalone\.md#3-/),
71+
);
72+
});
5773
});

‎src/components/layout/certificate-help.tsx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ limitations under the License.
2525
// certificate during the TLS handshake, so this page cannot trigger the prompt
2626
// -- hence the reload step, which is the part people otherwise miss.
2727

28+
const FIRST_CREDENTIAL_GUIDE =
29+
"https://github.com/CryptOS-PKI/manager/blob/main/docs/deploying-standalone.md#3-the-operator-ca-does-not-have-to-be-a-cryptos-node";
30+
2831
interface Platform {
2932
/** Shell command that performs the import, where one exists. */
3033
command?: string;
@@ -92,5 +95,25 @@ export const CertificateHelp = () => (
9295
{p.note ? <p className="italic">{p.note}</p> : null}
9396
</div>
9497
))}
98+
99+
{/* On a fleet nobody has logged in to yet there is no one to issue the
100+
certificate but the reader, and this page cannot mint it (#70). */}
101+
<div className="flex flex-col gap-1">
102+
<h3 className="text-primary">Standing up a new fleet?</h3>
103+
<p>
104+
No operator certificate exists until the first one is issued. Issue it yourself from the
105+
operator CA this manager trusts (<code>operatorCAPath</code> in its config), with the admin
106+
level extension, then install it as above. The{" "}
107+
<a
108+
className="text-primary underline underline-offset-2"
109+
href={FIRST_CREDENTIAL_GUIDE}
110+
rel="noreferrer"
111+
target="_blank"
112+
>
113+
deployment guide
114+
</a>
115+
, section 3, has the full OpenSSL recipe.
116+
</p>
117+
</div>
95118
</div>
96119
);

0 commit comments

Comments
 (0)