Commit c13e517a authored by Diego Molteni's avatar Diego Molteni Committed by Sacha Brants
Browse files

feat: added possibility to specify the suffix of entitlement delete group...

feat: added possibility to specify the suffix of entitlement delete group endpoint as config via env variable
parent a0286e2f
......@@ -36,6 +36,7 @@ export interface ConfigModel {
DES_SERVICE_HOST_COMPLIANCE: string;
DES_SERVICE_HOST_STORAGE: string;
DES_SERVICE_HOST_PARTITION: string;
DES_ENTITLEMENT_DELETE_ENDPOINT_PATH?: string;
DES_SERVICE_APPKEY: string;
DES_GROUP_CHAR_LIMIT: number;
JWKS_URL: string;
......@@ -109,6 +110,7 @@ export abstract class Config implements IConfig {
public static DES_SERVICE_HOST_COMPLIANCE: string;
public static DES_SERVICE_HOST_STORAGE: string;
public static DES_SERVICE_HOST_PARTITION: string;
public static DES_ENTITLEMENT_DELETE_ENDPOINT_PATH: string;
public static DES_SERVICE_APPKEY: string;
public static DES_GROUP_CHAR_LIMIT: number;
public static DE_FORWARD_APPKEY = Symbol('seismic-dms-fw-caller-appkey');
......@@ -206,6 +208,7 @@ export abstract class Config implements IConfig {
Config.DES_SERVICE_HOST_COMPLIANCE = model.DES_SERVICE_HOST_COMPLIANCE;
Config.DES_SERVICE_HOST_STORAGE = model.DES_SERVICE_HOST_STORAGE;
Config.DES_SERVICE_HOST_PARTITION = model.DES_SERVICE_HOST_PARTITION;
Config.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH = model.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH || '/groups/data/';
Config.DES_SERVICE_APPKEY = model.DES_SERVICE_APPKEY;
Config.DES_GROUP_CHAR_LIMIT = model.DES_GROUP_CHAR_LIMIT;
......@@ -236,6 +239,7 @@ export abstract class Config implements IConfig {
Config.checkRequiredConfig(Config.DES_SERVICE_HOST_COMPLIANCE, 'DES_SERVICE_HOST_COMPLIANCE');
Config.checkRequiredConfig(Config.DES_SERVICE_HOST_STORAGE, 'DES_SERVICE_HOST_STORAGE');
Config.checkRequiredConfig(Config.DES_SERVICE_HOST_PARTITION, 'DES_SERVICE_HOST_PARTITION');
Config.checkRequiredConfig(Config.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH, 'DES_ENTITLEMENT_DELETE_ENDPOINT_PATH');
Config.checkRequiredConfig(Config.DES_SERVICE_APPKEY, 'DES_SERVICE_APPKEY');
// JWT validation
......
......@@ -52,6 +52,7 @@ export class AzureConfig extends Config {
AzureConfig.DES_SERVICE_HOST_ENTITLEMENT = process.env.DES_SERVICE_HOST
AzureConfig.DES_SERVICE_HOST_STORAGE = process.env.DES_SERVICE_HOST
AzureConfig.DES_SERVICE_HOST_PARTITION = process.env.DES_SERVICE_HOST
AzureConfig.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH = process.env.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH;
AzureConfig.DES_SERVICE_APPKEY = 'undefined'
Config.checkRequiredConfig(AzureConfig.DES_SERVICE_HOST_COMPLIANCE, 'DES_SERVICE_HOST');
Config.checkRequiredConfig(AzureConfig.DES_SERVICE_HOST_ENTITLEMENT, 'DES_SERVICE_HOST');
......@@ -84,6 +85,7 @@ export class AzureConfig extends Config {
DES_SERVICE_HOST_ENTITLEMENT: AzureConfig.DES_SERVICE_HOST_ENTITLEMENT,
DES_SERVICE_HOST_STORAGE: AzureConfig.DES_SERVICE_HOST_STORAGE,
DES_SERVICE_HOST_PARTITION: AzureConfig.DES_SERVICE_HOST_PARTITION,
DES_ENTITLEMENT_DELETE_ENDPOINT_PATH: AzureConfig.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH,
DES_SERVICE_APPKEY: AzureConfig.DES_SERVICE_APPKEY,
DES_GROUP_CHAR_LIMIT: AzureConfig.DES_GROUP_CHAR_LIMIT,
JWKS_URL: process.env.JWKS_URL,
......
......@@ -247,7 +247,7 @@ export class DESEntitlement {
'Content-Type': 'application/json'
},
url: Config.DES_SERVICE_HOST_ENTITLEMENT + dataecosystem.getEntitlementBaseUrlPath()
+ '/groups/data/' + groupEmail
+ Config.DES_ENTITLEMENT_DELETE_ENDPOINT_PATH + groupEmail
};
options.headers[dataecosystem.getDataPartitionIDRestHeaderName()] = dataPartitionID;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment