Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

caccl-lti

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caccl-lti - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

test/selenium/config.json

2

index.js

@@ -76,3 +76,3 @@ const Validator = require('./Validator');

// include redirectToAfterLaunch as the 'next' url
return res.redirect(`${config.launchPath}?next=${redirectToAfterLaunch}`);
return res.redirect(`${launchPath}?next=${redirectToAfterLaunch}`);
}

@@ -79,0 +79,0 @@ // Not authorizing on launch. Redirect to redirectToAfterLaunch

{
"name": "caccl-lti",
"version": "1.0.5",
"version": "1.0.6",
"description": "LTI launch validator for IMS-LTI standard launches.",

@@ -8,3 +8,3 @@ "main": "index.js",

"test": "mocha --exit",
"ltitest": "node ./test/lti/spinUpServer.js"
"selenium": "node ./node_modules/dce-selenium/run"
},

@@ -42,8 +42,10 @@ "repository": {

"chai-as-promised": "^7.1.1",
"eslint": "^5.12.0",
"dce-selenium": "^1.0.18",
"eslint": "^5.13.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.12.3",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"express": "^4.16.4",
"express-session": "^1.15.6",
"fs": "0.0.1-security",

@@ -50,0 +52,0 @@ "https": "^1.0.0",

@@ -8,3 +8,8 @@ {

"func-names": ["error","never"]
},
"globals": {
"itS": false,
"describeS": false,
"driver": false
}
}
const chai = require('chai');
const clone = require('fast-clone');
const chaiAsPromised = require('chai-as-promised');

@@ -12,18 +13,2 @@ const oauth = require('oauth-signature');

// const updateAndAddSignature = (examplesPackage, example) => {
// const newExample = example;
//
// newExample.body.oauth_timestamp = Math.ceil(Date.now() / 1000);
// newExample.body.oauth_signature = decodeURIComponent(
// oauth.generate(
// examplesPackage.method,
// examplesPackage.url,
// examplesPackage.body,
// examplesPackage.consumerSecret
// )
// );
//
// return newExample;
// };
describe('Validator', function () {

@@ -37,3 +22,3 @@ it('Accepts valid requests', function () {

valid.examples.forEach((example) => {
const { body } = example;
const body = clone(example.body);

@@ -68,3 +53,3 @@ // Reset timestamp

it('Rejects invalid requests', function () {
it('Rejects invalid requests', async function () {
const validator = new Validator({

@@ -75,4 +60,5 @@ consumer_key: valid.consumerKey,

valid.examples.forEach((example) => {
const { body } = example;
for (let i = 0; i < valid.examples.length; i++) {
const example = valid.examples[i];
const body = clone(example.body);

@@ -104,6 +90,11 @@ // Reset timestamp

// eslint-disable-next-line no-unused-expressions
expect(validator.isValid(req)).to.be.rejected;
});
/* eslint-disable no-await-in-loop */
try {
await validator.isValid(req);
throw new Error('Validator marked example as valid when it wasnt');
} catch (err) {
// Good!
}
}
});
});

@@ -96,3 +96,2 @@ const oauth = require('oauth-signature');

);
return (generatedSignature === req.body.oauth_signature);

@@ -99,0 +98,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc