File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,26 @@ import { getConfigValue } from './config'
1212import { AuthError } from './errors'
1313import constants from '../constants'
1414
15- const { SOCKET_CLI_NO_API_TOKEN , SOCKET_SECURITY_API_TOKEN } = constants
15+ const {
16+ SOCKET_CLI_NO_API_TOKEN ,
17+ SOCKET_SECURITY_API_BASE_URL ,
18+ SOCKET_SECURITY_API_PROXY ,
19+ SOCKET_SECURITY_API_TOKEN
20+ } = constants
1621
1722// The API server that should be used for operations.
1823function getDefaultApiBaseUrl ( ) : string | undefined {
1924 const baseUrl =
20- process . env [ 'SOCKET_SECURITY_API_BASE_URL' ] || getConfigValue ( 'apiBaseUrl' )
25+ // Lazily access constants.ENV[SOCKET_SECURITY_API_BASE_URL].
26+ constants . ENV [ SOCKET_SECURITY_API_BASE_URL ] || getConfigValue ( 'apiBaseUrl' )
2127 return isNonEmptyString ( baseUrl ) ? baseUrl : undefined
2228}
2329
2430// The API server that should be used for operations.
2531function getDefaultHttpProxy ( ) : string | undefined {
2632 const apiProxy =
27- process . env [ 'SOCKET_SECURITY_API_PROXY' ] || getConfigValue ( 'apiProxy' )
33+ // Lazily access constants.ENV[SOCKET_SECURITY_API_PROXY].
34+ constants . ENV [ SOCKET_SECURITY_API_PROXY ] || getConfigValue ( 'apiProxy' )
2835 return isNonEmptyString ( apiProxy ) ? apiProxy : undefined
2936}
3037
You can’t perform that action at this time.
0 commit comments