mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-25 01:13:39 +10:00
In-app store, torrential backend, locales (#332)
* feat: add store nav and fixes * fix: reduce password requirement & new task error ui * fix: client webtoken fix * fix: delta versions and dockerfile * fix: use setup platforms for filter & display * fix: setup not accounted when returning valid options * feat: tighter delta version support * feat: dl/disk size * feat: offload manifest generation to torrential * fix: bump torrential * feat: remove droplet * feat: bump torrential * feat: convert locales
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import droplet from "@drop-oss/droplet";
|
||||
import type { CertificateStore } from "./ca-store";
|
||||
import { dropletInterface } from "../services/torrential/droplet-interface";
|
||||
|
||||
export type CertificateBundle = {
|
||||
priv: string;
|
||||
@@ -23,8 +23,7 @@ export class CertificateAuthority {
|
||||
const root = await store.fetch("ca");
|
||||
let ca;
|
||||
if (root === undefined) {
|
||||
const [cert, priv] = droplet.generateRootCa();
|
||||
const bundle: CertificateBundle = { priv, cert };
|
||||
const bundle: CertificateBundle = await dropletInterface.generateRootCa();
|
||||
await store.store("ca", bundle);
|
||||
ca = new CertificateAuthority(store, bundle);
|
||||
} else {
|
||||
@@ -43,16 +42,13 @@ export class CertificateAuthority {
|
||||
const caCertificate = await this.certificateStore.fetch("ca");
|
||||
if (!caCertificate)
|
||||
throw new Error("Certificate authority not initialised");
|
||||
const [cert, priv] = droplet.generateClientCertificate(
|
||||
clientId,
|
||||
clientName,
|
||||
caCertificate.cert,
|
||||
caCertificate.priv,
|
||||
);
|
||||
const certBundle: CertificateBundle = {
|
||||
priv,
|
||||
cert,
|
||||
};
|
||||
|
||||
const certBundle: CertificateBundle =
|
||||
await dropletInterface.generateClientCert(
|
||||
clientId,
|
||||
clientName,
|
||||
caCertificate,
|
||||
);
|
||||
return certBundle;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user