mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lens proxy with TLS (#6851)
* lens proxy tls support Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * integration test fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * don't override getRequestOptions if they are set Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix electronAppInjectable override Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * use runnables on renderer Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * move certificate generation to runnables Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * simplify Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
fba93b889e
commit
7052dc0dba
35 files changed
+353
-66
No files matched your search
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { SelfSignedCert } from "selfsigned";
|
||||
import { getRequestChannel } from "../utils/channel/get-request-channel";
|
||||
|
||||
export const lensProxyCertificateChannel = getRequestChannel<void, SelfSignedCert>("request-lens-proxy-certificate");
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getGlobalOverride } from "../test-utils/get-global-override";
|
||||
import lensProxyCertificateInjectable from "./lens-proxy-certificate.injectable";
|
||||
|
||||
export default getGlobalOverride(lensProxyCertificateInjectable, () => {
|
||||
return {
|
||||
get: () => ({
|
||||
public: "<public-data>",
|
||||
private: "<private-data>",
|
||||
cert: "<ca-data>",
|
||||
}),
|
||||
set: () => {},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 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";
|
||||
import type { SelfSignedCert } from "selfsigned";
|
||||
|
||||
const lensProxyCertificateInjectable = getInjectable({
|
||||
id: "lens-proxy-certificate",
|
||||
instantiate: () => {
|
||||
let certState: SelfSignedCert;
|
||||
const cert = {
|
||||
get: () => {
|
||||
if (!certState) {
|
||||
throw "certificate has not been set";
|
||||
}
|
||||
|
||||
return certState;
|
||||
},
|
||||
set: (certificate: SelfSignedCert) => {
|
||||
if (certState) {
|
||||
throw "certificate has already been set";
|
||||
}
|
||||
|
||||
certState = certificate;
|
||||
},
|
||||
};
|
||||
|
||||
return cert;
|
||||
},
|
||||
});
|
||||
|
||||
export default lensProxyCertificateInjectable;
|
||||
Reference in new issue
Block a user