Skip to content

Commit c7ed873

Browse files
author
Maurice Faber
committed
feat: added ca to session [ci skip]
1 parent 850f036 commit c7ed873

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/openapi/session.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Session:
22
properties:
3+
ca:
4+
type: string
5+
readOnly: true
36
cluster:
47
$ref: cluster.yaml#/Cluster
58
clusters:

src/otomi-stack.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
import cloneRepo, { processValues, Repo } from './repo'
4343
import {
4444
cleanEnv,
45+
CUSTOM_ROOT_CA,
4546
CORE_VERSION,
4647
GIT_REPO_URL,
4748
GIT_LOCAL_PATH,
@@ -59,6 +60,7 @@ const debug = Debug('otomi:otomi-stack')
5960
const secretTransferProps = ['type', 'ca', 'crt', 'key', 'entries', 'dockerconfig']
6061

6162
const env = cleanEnv({
63+
CUSTOM_ROOT_CA,
6264
CORE_VERSION,
6365
GIT_REPO_URL,
6466
GIT_LOCAL_PATH,
@@ -663,6 +665,7 @@ export default class OtomiStack {
663665

664666
getSession(user: User): Session {
665667
const data: Session = {
668+
ca: env.CUSTOM_ROOT_CA,
666669
cluster: this.getSetting('cluster') as Session['cluster'],
667670
clusters: get(this.getSetting('otomi'), 'additionalClusters', []) as Session['clusters'],
668671
core: this.getCore(),

src/validators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { str, bool, cleanEnv as clean, CleanEnv, StrictCleanOptions, ValidatorSpec } from 'envalid'
22

33
export const CORE_VERSION = str({ desc: 'The otomi-core version', default: 'x.x.x' })
4+
export const CUSTOM_ROOT_CA = str({ desc: 'The root CA used for certs', default: undefined })
45
export const DB_PATH = str({ desc: 'The file path to the db. If not given in-memory db is used.', default: undefined })
56
export const DISABLE_PROCESSING = bool({ desc: 'Will disable processing by core', default: false })
67
export const DISABLE_SYNC = bool({ desc: 'Will disable pushing to the repo', default: false })

0 commit comments

Comments
 (0)