Skip to content

Commit

Permalink
fix: up deps for changes in expires_in, last_login and last_access to…
Browse files Browse the repository at this point in the history
… timestamp fields
  • Loading branch information
Arun-KumarH committed Nov 15, 2023
1 parent 125865d commit 999fc74
Show file tree
Hide file tree
Showing 7 changed files with 447 additions and 473 deletions.
794 changes: 421 additions & 373 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"service"
],
"dependencies": {
"@restorecommerce/acs-client": "^1.1.20",
"@restorecommerce/chassis-srv": "^1.4.0",
"@restorecommerce/acs-client": "^1.3.1",
"@restorecommerce/chassis-srv": "^1.4.1",
"@restorecommerce/cluster-service": "^1.0.2",
"@restorecommerce/grpc-client": "^2.0.4",
"@restorecommerce/kafka-client": "^1.1.3",
"@restorecommerce/logger": "^1.2.5",
"@restorecommerce/rc-grpc-clients": "^5.1.3",
"@restorecommerce/resource-base-interface": "^1.4.0",
"@restorecommerce/service-config": "^1.0.7",
"@restorecommerce/grpc-client": "^2.0.7",
"@restorecommerce/kafka-client": "^1.1.8",
"@restorecommerce/logger": "^1.2.7",
"@restorecommerce/rc-grpc-clients": "^5.1.8",
"@restorecommerce/resource-base-interface": "^1.4.1",
"@restorecommerce/service-config": "^1.0.9",
"apollo-boost": "^0.4.9",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
Expand All @@ -38,21 +38,21 @@
"traverse": "^0.6.7"
},
"devDependencies": {
"@alenon/grpc-mock-server": "^3.1.3",
"@alenon/grpc-mock-server": "^3.1.7",
"@grpc/proto-loader": "^0.7.10",
"@types/lodash": "^4.14.199",
"@types/mocha": "^10.0.2",
"@types/lodash": "^4.14.201",
"@types/mocha": "^10.0.4",
"@types/nock": "^11.1.0",
"@types/node": "^20.8.3",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/eslint-plugin-tslint": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/eslint-plugin-tslint": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"eslint": "^8.51.0",
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
"eslint": "^8.53.0",
"eslint-plugin-prefer-arrow-functions": "^3.2.4",
"mocha": "^10.2.0",
"nock": "^13.3.3",
"nock": "^13.3.8",
"nodemon": "^3.0.1",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/accessControlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ export class AccessControlService implements AccessControlServiceImplementation
}
}
async loadPolicies(): Promise<void> {
this.logger.info('Loading policies....');
this.logger.info('Loading policies');

const policiesCfg = this.cfg.get('policies');
const loadType = policiesCfg?.type;
switch (loadType) {
case 'local':
this.logger.silly('Loading policies from local files....');
const path: string = policiesCfg?.path;
this.accessController = await core?.utils?.loadPoliciesFromDoc(this.accessController, path);
this.logger.silly('Policies from local files loaded');
break;
case 'database':
this.logger.silly('Loading policies from database....');
const policySetService = this.resourceManager.getResourceService('policy_set');
const policySets: Map<string, PolicySetWithCombinables> = await policySetService.load() || new Map();
this.accessController.policySets = policySets;
this.logger.silly('Policies from database loaded');
break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ const getUserServiceClient = async () => {
return idsClientInstance;
};

export async function checkAccessRequest(ctx: ACSClientContext, resource: Resource[], action: AuthZAction, operation: Operation.isAllowed, useCache?: boolean): Promise<DecisionResponse>;
export async function checkAccessRequest(ctx: ACSClientContext, resource: Resource[], action: AuthZAction, operation: Operation.whatIsAllowed, useCache?: boolean): Promise<PolicySetRQResponse>;

/**
* Perform an access request using inputs from a GQL request
*
Expand Down
1 change: 0 additions & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export class Worker {
await server.start();

this.logger.info('Access control service started correctly!');
this.logger.info('Loading resources...');
await accessControlService.loadPolicies();

const that = this;
Expand Down
4 changes: 2 additions & 2 deletions test/microservice_acs_enabled.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ interface MethodWithOutput {
output: any;
};

const PROTO_PATH = 'test/protos/io/restorecommerce/user.proto';
const PROTO_PATH = 'node_modules/@restorecommerce/protos/io/restorecommerce/user.proto';;
const PKG_NAME = 'io.restorecommerce.user';
const SERVICE_NAME = 'UserService';

const pkgDef: grpc.GrpcObject = grpc.loadPackageDefinition(
proto_loader.loadSync(PROTO_PATH, {
includeDirs: ['test/protos'],
includeDirs: ['node_modules/@restorecommerce/protos/'],
keepCase: true,
longs: String,
enums: String,
Expand Down
76 changes: 0 additions & 76 deletions test/protos/io/restorecommerce/user.proto

This file was deleted.

0 comments on commit 999fc74

Please sign in to comment.