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

canvas-request

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-request - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

13

index.js

@@ -26,2 +26,3 @@ /*

var AWS;
var CANVAS_URL;
var parameter_header;

@@ -40,2 +41,7 @@ var ssm;

ssm = new AWS.SSM(aws_config);
if(!config.canvas_url) {
throw("Missing canvas_url in config")
} else {
CANVAS_URL = config.canvas_url;
}
if(config.aws.aws_params_location == 'file') {

@@ -53,2 +59,7 @@ var credentials = new AWS.SharedIniFileCredentials({profile: 'default'});

} else if(config.credential_method == 'env_vars') {
if(!config.canvas_url) {
throw("Missing canvas_url in config")
} else {
CANVAS_URL = config.canvas_url;
}
if(process.env.CANVAS_CLIENT_ID && process.env.CANVAS_CLIENT_SECRET && process.env.CANVAS_REFRESH_TOKEN) {

@@ -103,3 +114,3 @@ CANVAS_CLIENT_ID = process.env.CANVAS_CLIENT_ID;

request({
url: 'https://byu.test.instructure.com/login/oauth2/token?refresh_token='+ CANVAS_REFRESH_TOKEN + '&grant_type=refresh_token',
url: 'https://' + CANVAS_URL + '/login/oauth2/token?refresh_token='+ CANVAS_REFRESH_TOKEN + '&grant_type=refresh_token',
method: 'POST',

@@ -106,0 +117,0 @@ headers: {

2

package.json
{
"name": "canvas-request",
"version": "0.0.1",
"version": "0.0.2",
"description": "npm module for making api requests to canvas",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -22,12 +22,16 @@ /*

// var canvas_token = '<place your canvas token here>'
// var canvas_config = {
// // 'token': canvas_token, // If you include the token in the config, you don't need the CANVAS_CLIENT_ID, CANVAS_CLIENT_SECRET or the CANVAS_REFRESH_TOKEN. Omit to use aws_ssm or env_vars
// 'credential_method': 'aws_ssm', // Either aws_ssm or env_vars
// 'canvas_url': 'byu.test.instructure.com',
// 'aws': { // include if using aws_ssm
// 'parameter_header': 'lms-event-integration.dev',
// 'region': 'us-west-2',
// 'aws_params_location': 'file' // Either file (~/.aws/credentials) or env_vars
// }
// }
var canvas_config = {
// 'token': canvas_token, // If you include the token in the config, you don't need the CANVAS_CLIENT_ID, CANVAS_CLIENT_SECRET or the CANVAS_REFRESH_TOKEN. Omit to use aws_ssm or env_vars
'credential_method': 'aws_ssm', // Either aws_ssm or env_vars
'aws': { // include if using aws_ssm
'parameter_header': 'lms-event-integration.dev',
'region': 'us-west-2',
'aws_params_location': 'file' // Either file (~/.aws/credentials) or env_vars
}
'token': process.env.TOKEN
}
var requestOptions = {

@@ -34,0 +38,0 @@ 'url': 'https://byu.test.instructure.com/api/v1/accounts/1/users',

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