@icgc-argo/ego-token-utils
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -235,6 +235,7 @@ /** | ||
var authorizedProgramScopes = getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
}); | ||
return (isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
})); | ||
}; | ||
@@ -247,6 +248,8 @@ /** | ||
var authorizedProgramScopes = getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && [PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
}); | ||
return (isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && | ||
[PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
})); | ||
}; | ||
@@ -253,0 +256,0 @@ /** |
@@ -241,6 +241,7 @@ (function (global, factory) { | ||
var authorizedProgramScopes = getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
}); | ||
return (isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
})); | ||
}; | ||
@@ -253,6 +254,8 @@ /** | ||
var authorizedProgramScopes = getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && [PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
}); | ||
return (isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && | ||
[PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
})); | ||
}; | ||
@@ -259,0 +262,0 @@ /** |
@@ -137,6 +137,7 @@ "use strict"; | ||
var authorizedProgramScopes = exports.getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
}); | ||
return (exports.isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy; | ||
return policy.includes(args.programId); | ||
})); | ||
}; | ||
@@ -149,6 +150,8 @@ /** | ||
var authorizedProgramScopes = exports.getReadableProgramScopes(args.egoJwt); | ||
return authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && [PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
}); | ||
return (exports.isDccMember(args.egoJwt) || | ||
authorizedProgramScopes.some(function (_a) { | ||
var policy = _a.policy, permission = _a.permission; | ||
return policy.includes(args.programId) && | ||
[PERMISSIONS.WRITE, PERMISSIONS.ADMIN].includes(permission); | ||
})); | ||
}; | ||
@@ -155,0 +158,0 @@ /** |
{ | ||
"name": "@icgc-argo/ego-token-utils", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
# Ego Token Utils | ||
[![Coverage Status](https://coveralls.io/repos/github/icgc-argo/ego-token-utils/badge.svg?branch=master)](https://coveralls.io/github/icgc-argo/ego-token-utils?branch=master) | ||
@@ -7,27 +8,30 @@ [![Build Status](https://travis-ci.org/icgc-argo/ego-token-utils.svg?branch=master)](https://travis-ci.org/icgc-argo/ego-token-utils) | ||
This repo contains a library of utility functions written in __Typescript__ interpret __Ego JWT__ content in the Argo system. | ||
This repo contains a library of utility functions written in **Typescript** interpret **Ego JWT** content in the Argo system. | ||
## Usage | ||
- install: | ||
``` | ||
npm i --save @icgc-argo/ego-token-utils | ||
``` | ||
- install: | ||
``` | ||
npm i --save @icgc-argo/ego-token-utils | ||
``` | ||
- use: | ||
```typescript | ||
```typescript | ||
import TokenUtils from '@icgc-argo/ego-token-utils' | ||
TokenUtils.decodeToken(egoJwt) | ||
TokenUtils.canReadProgram(egoJwt, "PROGRAM-TEST-AU.READ") | ||
TokenUtils.canReadProgram(egoJwt, "TEST-AU") | ||
... | ||
``` | ||
Interactive documentation is available at: https://icgc-argo.github.io/ego-token-utils/ | ||
``` | ||
Interactive documentation is available at: https://icgc-argo.github.io/ego-token-utils/ | ||
## Development | ||
This project uses the following bootstrap setup: [typescript-library-starter](https://github.com/alexjoverm/typescript-library-starter) | ||
### Notes | ||
- `npm i`: install dependencies | ||
- `npm run test:watch`: to start developing with interactive live test | ||
- `npm run build`: to trigger build (for local testing only) | ||
- `npm run commit`: to commit changes. __IMPORTANT__ as commits are analyzed for release | ||
- `npm run commit`: to commit changes. **IMPORTANT** as commits are analyzed for release | ||
- Once happy, submit a PR to the `develop` branch. | ||
@@ -34,0 +38,0 @@ - Releases happen automatically through Travis once merged to `master` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103418
850
40