options.mjs 451 Bytes
import { default as _ } from 'lodash'
import { readEnv } from 'read-env'

export const readEnvOptions = {
  source: process.env,
  separator: '__',
  format: 'camelcase',
  sanitize: {
    object: false,
    array: false,
    bool: true,
    'int': true,
    'float': true,
  },
}

export const oidcParams = () => _.pickBy(_.merge({
  //bearerOnly: true,
}, readEnv('OIDC', readEnvOptions)), (value, key) => {
  return !_.startsWith(key, 'http')
})