mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix most tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
6d0e5277aa
commit
d22af76e60
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { getGlobalOverride } from "../../common/test-utils/get-global-override";
|
||||||
|
import lensProxyCertificateLifespanInjectable from "./certificate-lifespan.injectable";
|
||||||
|
|
||||||
|
// Update this value in a hundred years :D
|
||||||
|
export default getGlobalOverride(lensProxyCertificateLifespanInjectable, () => 100 * 365);
|
||||||
12
src/main/lens-proxy/certificate-lifespan.injectable.ts
Normal file
12
src/main/lens-proxy/certificate-lifespan.injectable.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
|
||||||
|
const lensProxyCertificateLifespanInjectable = getInjectable({
|
||||||
|
id: "lens-proxy-certificate-lifespan",
|
||||||
|
instantiate: () => 365, // days
|
||||||
|
});
|
||||||
|
|
||||||
|
export default lensProxyCertificateLifespanInjectable;
|
||||||
@ -4,14 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { generate } from "selfsigned";
|
import { generate } from "selfsigned";
|
||||||
import lensProxyCertificateInjectable from "../../../common/certificate/lens-proxy-certificate.injectable";
|
import lensProxyCertificateInjectable from "../../common/certificate/lens-proxy-certificate.injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
||||||
|
import lensProxyCertificateLifespanInjectable from "./certificate-lifespan.injectable";
|
||||||
|
|
||||||
const setupLensProxyCertificateInjectable = getInjectable({
|
const setupLensProxyCertificateInjectable = getInjectable({
|
||||||
id: "setup-lens-proxy-certificate",
|
id: "setup-lens-proxy-certificate",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||||
|
const lifespan = di.inject(lensProxyCertificateLifespanInjectable);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: "setup-lens-proxy-certificate",
|
id: "setup-lens-proxy-certificate",
|
||||||
@ -22,7 +24,7 @@ const setupLensProxyCertificateInjectable = getInjectable({
|
|||||||
], {
|
], {
|
||||||
keySize: 2048,
|
keySize: 2048,
|
||||||
algorithm: "sha256",
|
algorithm: "sha256",
|
||||||
days: 365,
|
days: lifespan,
|
||||||
extensions: [
|
extensions: [
|
||||||
{
|
{
|
||||||
name: "basicConstraints",
|
name: "basicConstraints",
|
||||||
Loading…
Reference in New Issue
Block a user