Skip to content

Commit 01f9259

Browse files
committed
refactor: Remove unused configuration variables
1 parent 4d790e2 commit 01f9259

6 files changed

Lines changed: 8 additions & 193 deletions

File tree

packages/uma/bin/demo.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

1212
export const launch: () => Promise<void> = async () => {
13-
14-
const variables: Record<string, any> = {};
13+
const variables: Record<string, unknown> = {};
1514

1615
variables['urn:uma:variables:port'] = port;
17-
variables['urn:uma:variables:host'] = host;
18-
variables['urn:uma:variables:protocol'] = protocol;
1916
variables['urn:uma:variables:baseUrl'] = baseUrl;
2017

2118
// variables['urn:uma:variables:policyDir'] = path.join(rootDir, './config/rules/policy');
22-
variables['urn:uma:variables:rulesDir'] = path.join(rootDir, './config/rules/n3');
2319
variables['urn:uma:variables:eyePath'] = 'eye';
2420

25-
variables['urn:uma:variables:mainModulePath'] = rootDir;
26-
variables['urn:uma:variables:customConfigPath'] = path.join(rootDir, './config/demo.json');
27-
28-
const mainModulePath = variables['urn:uma:variables:mainModulePath'];
29-
const configPath = variables['urn:uma:variables:customConfigPath'];
21+
const configPath = path.join(rootDir, './config/demo.json');
3022

3123
setGlobalLoggerFactory(new WinstonLoggerFactory('info'));
3224

3325
const manager = await ComponentsManager.build({
34-
mainModulePath,
26+
mainModulePath: rootDir,
3527
logLevel: 'silly',
3628
typeChecking: false,
3729
});
@@ -40,7 +32,6 @@ export const launch: () => Promise<void> = async () => {
4032

4133
const umaServer: ServerInitializer = await manager.instantiate('urn:uma:default:NodeHttpServer',{variables});
4234
await umaServer.handleSafe();
43-
4435
};
4536

4637
launch();

packages/uma/bin/main.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

1212
export const launch: () => Promise<void> = async () => {
13-
14-
const variables: Record<string, any> = {};
13+
const variables: Record<string, unknown> = {};
1514

1615
variables['urn:uma:variables:port'] = port;
17-
variables['urn:uma:variables:host'] = host;
18-
variables['urn:uma:variables:protocol'] = protocol;
1916
variables['urn:uma:variables:baseUrl'] = baseUrl;
2017

2118
variables['urn:uma:variables:policyDir'] = path.join(rootDir, './config/rules/policy');
22-
variables['urn:uma:variables:rulesDir'] = path.join(rootDir, './config/rules/n3');
2319
variables['urn:uma:variables:eyePath'] = 'eye';
2420

25-
variables['urn:uma:variables:mainModulePath'] = rootDir;
26-
variables['urn:uma:variables:customConfigPath'] = path.join(rootDir, './config/default.json');
27-
28-
const mainModulePath = variables['urn:uma:variables:mainModulePath'];
29-
const configPath = variables['urn:uma:variables:customConfigPath'];
21+
const configPath = path.join(rootDir, './config/default.json');
3022

3123
setGlobalLoggerFactory(new WinstonLoggerFactory('info'));
3224

3325
const manager = await ComponentsManager.build({
34-
mainModulePath,
26+
mainModulePath: rootDir,
3527
logLevel: 'silly',
3628
typeChecking: false,
3729
});
@@ -40,7 +32,6 @@ export const launch: () => Promise<void> = async () => {
4032

4133
const umaServer: ServerInitializer = await manager.instantiate('urn:uma:default:NodeHttpServer',{variables});
4234
await umaServer.handleSafe();
43-
4435
};
4536

4637
launch();

packages/uma/bin/odrl.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

1212
export const launch: () => Promise<void> = async () => {
13-
1413
const variables: Record<string, any> = {};
1514

1615
variables['urn:uma:variables:port'] = port;
17-
variables['urn:uma:variables:host'] = host;
18-
variables['urn:uma:variables:protocol'] = protocol;
1916
variables['urn:uma:variables:baseUrl'] = baseUrl;
2017

2118
variables['urn:uma:variables:policyDir'] = path.join(rootDir, './config/rules/odrl');
22-
// variables['urn:uma:variables:rulesDir'] = path.join(rootDir, './config/rules/n3');
2319
variables['urn:uma:variables:eyePath'] = 'eye';
2420

25-
variables['urn:uma:variables:mainModulePath'] = rootDir;
26-
variables['urn:uma:variables:customConfigPath'] = path.join(rootDir, './config/odrl.json');
27-
28-
const mainModulePath = variables['urn:uma:variables:mainModulePath'];
29-
const configPath = variables['urn:uma:variables:customConfigPath'];
21+
const configPath = path.join(rootDir, './config/odrl.json');
3022

3123
setGlobalLoggerFactory(new WinstonLoggerFactory('info'));
3224

3325
const manager = await ComponentsManager.build({
34-
mainModulePath,
26+
mainModulePath: rootDir,
3527
logLevel: 'silly',
3628
typeChecking: false,
3729
});
@@ -40,7 +32,6 @@ export const launch: () => Promise<void> = async () => {
4032

4133
const umaServer: ServerInitializer = await manager.instantiate('urn:uma:default:NodeHttpServer',{variables});
4234
await umaServer.handleSafe();
43-
4435
};
4536

4637
launch();

packages/uma/config/base_default.json

Lines changed: 0 additions & 74 deletions
This file was deleted.

packages/uma/config/contract_default.json

Lines changed: 0 additions & 74 deletions
This file was deleted.

packages/uma/config/variables/default.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,11 @@
1212
"@id": "urn:uma:variables:baseUrl",
1313
"@type": "Variable"
1414
},
15-
{
16-
"comment": "Hostname of the server.",
17-
"@id": "urn:uma:variables:host",
18-
"@type": "Variable"
19-
},
2015
{
2116
"comment": "Path to the directory containing the policy rules.",
2217
"@id": "urn:uma:variables:policyDir",
2318
"@type": "Variable"
2419
},
25-
{
26-
"comment": "Path to the directory containing the N3 rules.",
27-
"@id": "urn:uma:variables:rulesDir",
28-
"@type": "Variable"
29-
},
3020
{
3121
"comment": "Path of the local eye reasoner.",
3222
"@id": "urn:uma:variables:eyePath",

0 commit comments

Comments
 (0)