Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Mgmt Services
Seismic
Seismic DMS Suite
seismic-dms-service
Commits
15ab43dd
Commit
15ab43dd
authored
Feb 10, 2021
by
Diego Molteni
Browse files
generalized the imposed TLS mode
parent
09529809
Pipeline
#25877
failed with stages
in 2 minutes and 35 seconds
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/cloud/config.ts
View file @
15ab43dd
...
...
@@ -27,9 +27,11 @@ export interface ConfigModel {
LOCKSMAP_REDIS_INSTANCE_ADDRESS
:
string
;
LOCKSMAP_REDIS_INSTANCE_PORT
:
number
;
LOCKSMAP_REDIS_INSTANCE_KEY
?:
string
;
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
?:
boolean
;
DES_REDIS_INSTANCE_ADDRESS
:
string
;
DES_REDIS_INSTANCE_PORT
:
number
;
DES_REDIS_INSTANCE_KEY
?:
string
;
DES_REDIS_INSTANCE_TLS_DISABLE
?:
boolean
;
DES_SERVICE_HOST_ENTITLEMENT
:
string
;
DES_SERVICE_HOST_COMPLIANCE
:
string
;
DES_SERVICE_HOST_STORAGE
:
string
;
...
...
@@ -57,9 +59,6 @@ export abstract class Config implements IConfig {
// Unit Test activation flag
public
static
UTEST
:
string
;
// Cache TLS DISABLE flag
public
static
CACHE_TLS_DISABLE
:
string
;
// Service base configurations
public
static
SERVICE_ENV
:
string
;
public
static
SERVICE_PORT
:
number
;
...
...
@@ -93,11 +92,13 @@ export abstract class Config implements IConfig {
public
static
LOCKSMAP_REDIS_INSTANCE_ADDRESS
:
string
;
public
static
LOCKSMAP_REDIS_INSTANCE_PORT
:
number
;
public
static
LOCKSMAP_REDIS_INSTANCE_KEY
:
string
;
public
static
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
:
boolean
;
// Redis cache for DataEcosystem results
public
static
DES_REDIS_INSTANCE_ADDRESS
:
string
;
public
static
DES_REDIS_INSTANCE_PORT
:
number
;
public
static
DES_REDIS_INSTANCE_KEY
:
string
;
public
static
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
:
boolean
;
// DataEcosystem Configuration
public
static
DES_SERVICE_HOST_ENTITLEMENT
:
string
;
...
...
@@ -145,6 +146,7 @@ export abstract class Config implements IConfig {
Config
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
=
model
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
;
Config
.
LOCKSMAP_REDIS_INSTANCE_PORT
=
model
.
LOCKSMAP_REDIS_INSTANCE_PORT
;
Config
.
LOCKSMAP_REDIS_INSTANCE_KEY
=
model
.
LOCKSMAP_REDIS_INSTANCE_KEY
;
Config
.
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
=
model
.
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
||
false
;
Config
.
DES_REDIS_INSTANCE_ADDRESS
=
model
.
DES_REDIS_INSTANCE_ADDRESS
||
model
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
;
...
...
@@ -152,6 +154,8 @@ export abstract class Config implements IConfig {
model
.
DES_REDIS_INSTANCE_PORT
||
model
.
LOCKSMAP_REDIS_INSTANCE_PORT
;
Config
.
DES_REDIS_INSTANCE_KEY
=
model
.
DES_REDIS_INSTANCE_KEY
||
model
.
LOCKSMAP_REDIS_INSTANCE_KEY
;
Config
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
=
model
.
DES_REDIS_INSTANCE_TLS_DISABLE
||
model
.
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
;
Config
.
FEATURE_FLAG_AUTHORIZATION
=
model
.
FEATURE_FLAG_AUTHORIZATION
;
Config
.
FEATURE_FLAG_LEGALTAG
=
model
.
FEATURE_FLAG_LEGALTAG
;
...
...
@@ -219,6 +223,3 @@ export class ConfigFactory extends CloudFactory {
// Set the Utest flag correctly as sooon as the config class get loaded
Config
.
UTEST
=
process
.
env
.
UTEST
;
// Set the CACHE(REDIS) TLS DISABLE flag correctly. If not SET TLS is assume enabled so that change is non breaking
Config
.
CACHE_TLS_DISABLE
=
process
.
env
.
CACHE_TLS_DISABLE
;
src/cloud/providers/azure/dataecosystem.ts
View file @
15ab43dd
...
...
@@ -112,7 +112,8 @@ export class AzureDataEcosystemServices extends AbstractDataEcosystemCore {
this
.
_storageConfigs
=
new
Cache
<
string
>
({
ADDRESS
:
AzureConfig
.
DES_REDIS_INSTANCE_ADDRESS
,
PORT
:
AzureConfig
.
DES_REDIS_INSTANCE_PORT
,
KEY
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY
KEY
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY
,
DISABLE_TLS
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
,
},
'
storage
'
)
}
...
...
@@ -137,7 +138,8 @@ export class AzureDataEcosystemServices extends AbstractDataEcosystemCore {
this
.
_cosmosConfigs
=
new
Cache
<
string
>
({
ADDRESS
:
AzureConfig
.
DES_REDIS_INSTANCE_ADDRESS
,
PORT
:
AzureConfig
.
DES_REDIS_INSTANCE_PORT
,
KEY
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY
KEY
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY
,
DISABLE_TLS
:
AzureConfig
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
,
},
'
cosmos
'
)
}
...
...
src/cloud/providers/ibm/config.ts
View file @
15ab43dd
...
...
@@ -92,9 +92,14 @@ export class IbmConfig extends Config {
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_PORT
=
+
process
.
env
.
REDIS_INSTANCE_PORT
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
=
process
.
env
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_KEY
=
process
.
env
.
LOCKSMAP_REDIS_INSTANCE_KEY
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
=
process
.
env
.
CACHE_TLS_DISABLE
?
process
.
env
.
CACHE_TLS_DISABLE
===
'
true
'
:
false
;
IbmConfig
.
DES_REDIS_INSTANCE_ADDRESS
=
process
.
env
.
DES_REDIS_INSTANCE_ADDRESS
IbmConfig
.
DES_REDIS_INSTANCE_PORT
=
+
process
.
env
.
DES_REDIS_INSTANCE_PORT
IbmConfig
.
DES_REDIS_INSTANCE_KEY
=
process
.
env
.
DES_REDIS_INSTANCE_KEY
IbmConfig
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
=
process
.
env
.
CACHE_TLS_DISABLE
?
process
.
env
.
CACHE_TLS_DISABLE
===
'
true
'
:
false
;
//Logger
IbmConfig
.
LOGGER_LEVEL
=
process
.
env
.
LOGGER_LEVEL
||
'
debug
'
;
...
...
@@ -110,9 +115,11 @@ export class IbmConfig extends Config {
LOCKSMAP_REDIS_INSTANCE_ADDRESS
:
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
,
LOCKSMAP_REDIS_INSTANCE_PORT
:
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_PORT
,
LOCKSMAP_REDIS_INSTANCE_KEY
:
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_KEY
,
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
:
IbmConfig
.
LOCKSMAP_REDIS_INSTANCE_TLS_DISABLE
,
DES_REDIS_INSTANCE_ADDRESS
:
IbmConfig
.
DES_REDIS_INSTANCE_ADDRESS
,
DES_REDIS_INSTANCE_PORT
:
IbmConfig
.
DES_REDIS_INSTANCE_PORT
,
DES_REDIS_INSTANCE_KEY
:
IbmConfig
.
DES_REDIS_INSTANCE_KEY
,
DES_REDIS_INSTANCE_TLS_DISABLE
:
IbmConfig
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
,
DES_SERVICE_HOST_COMPLIANCE
:
IbmConfig
.
DES_SERVICE_HOST_COMPLIANCE
,
DES_SERVICE_HOST_ENTITLEMENT
:
IbmConfig
.
DES_SERVICE_HOST_ENTITLEMENT
,
DES_SERVICE_HOST_STORAGE
:
IbmConfig
.
DES_SERVICE_HOST_STORAGE
,
...
...
src/dataecosystem/compliance.ts
View file @
15ab43dd
...
...
@@ -31,7 +31,8 @@ export class DESCompliance {
this
.
_cache
=
new
Cache
<
boolean
>
({
ADDRESS
:
Config
.
DES_REDIS_INSTANCE_ADDRESS
,
PORT
:
Config
.
DES_REDIS_INSTANCE_PORT
,
KEY
:
Config
.
DES_REDIS_INSTANCE_KEY
KEY
:
Config
.
DES_REDIS_INSTANCE_KEY
,
DISABLE_TLS
:
Config
.
DES_REDIS_INSTANCE_KEY_TLS_DISABLE
,
},
'
ltag
'
)
}
...
...
src/services/dataset/locker.ts
View file @
15ab43dd
...
...
@@ -48,12 +48,11 @@ export class Locker {
}
else
{
const
redis
=
require
(
'
redis
'
);
if
(
Config
.
LOCKSMAP_REDIS_INSTANCE_KEY
)
{
Config
.
CACH
E_TLS_DISABLE
?
Config
.
LOCKSMAP_REDIS_INSTANC
E_TLS_DISABLE
?
this
.
redisClient
=
redis
.
createClient
({
host
:
Config
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
,
port
:
Config
.
LOCKSMAP_REDIS_INSTANCE_PORT
,
auth_pass
:
Config
.
LOCKSMAP_REDIS_INSTANCE_KEY
,
///tls: {servername: Config.LOCKSMAP_REDIS_INSTANCE_ADDRESS}
}):
this
.
redisClient
=
redis
.
createClient
({
host
:
Config
.
LOCKSMAP_REDIS_INSTANCE_ADDRESS
,
...
...
src/shared/cache.ts
View file @
15ab43dd
...
...
@@ -21,7 +21,8 @@ import { Config } from '../cloud';
export
interface
ICacheParameters
{
ADDRESS
:
string
;
PORT
:
number
;
KEY
?:
string
KEY
?:
string
;
DISABLE_TLS
?:
boolean
;
}
export
class
Cache
<
T
=
string
>
{
...
...
@@ -37,7 +38,7 @@ export class Cache<T=string> {
this
.
_redisClient
=
Config
.
UTEST
?
require
(
'
redis-mock
'
).
createClient
()
:
connection
.
KEY
?
C
on
fig
.
CACHE_TLS_
DISABLE
?
connection
.
KEY
?
c
on
nection
.
DISABLE
_TLS
?
redis
.
createClient
({
host
:
connection
.
ADDRESS
,
port
:
connection
.
PORT
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment