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

edu.iu.uits.lms:canvasnotifier

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edu.iu.uits.lms:canvasnotifier

Allows authorized users to send Canvas messages to users in bulk.

  • 5.0.8
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

lms-canvas-canvas-notifier

App for authorized users to send Canvas messages to users in bulk.

:warning: Important Security Disclaimer :warning:

This tool will temporarily elevate the permissions of the designated sender to that of an account admin in your Canvas instance. Make sure that you are cool with that before using this tool!

Running standalone

Add env vars or system properties as desired.

ENV PropertySystem PropertyDefault ValueDescription
APP_FULLFILEPATHapp.fullFilePath/usr/src/app/configDirectory for configuration files
APP_OVERRIDESFILENAMEapp.overridesFileNameoverrides.propertiesCustomizable filename for additional configurations. Would be located in the above directory.
SPRING_PROFILES_ACTIVEspring.profiles.activeSupply spring profiles to activate. See configuration details below for potential values.
APP_ENVapp.envdevEnvironment designator. Free-form and can be used for your own purposes. Shows up in the application footer.
LTI_CLIENTREGISTRATION_DEFAULTCLIENTlti.clientregistration.defaultClientcanvasSpecify the launching configuration to expect (canvas/saltire)

Setup Database

After compiling, see target/generated-resources/sql/ddl/auto/postgresql9.sql for appropriate ddl. Insert a record into the LTI_13_AUTHZ table with your tool's registration_id (lms_lti_canvasnotifier), along with the client_id and secret from Canvas's Developer Key. An env designator is also required here, and allows a database to support multiple environments simultaneously (dev and reg, for example).

Add authorized users and senders

Add to the CANVASNOTIFIER_USERS table (either directly or via the rest endpoint) a record that maps to a user in your Canvas instance. A user in this table can either be a user, sender, or both. Setting the appropriate flags will determine what that user can do.

Test a local launch

Startup the application with the LTI_CLIENTREGISTRATION_DEFAULTCLIENT value set to saltire. Use an LTI tool consumer launcher, like https://saltire.lti.app/platform. Default values are fine, with the below exceptions...

In the Message section, set the following:

PropertyValue
Custom parameters
canvas_user_login_id=johnsmith
instructure_membership_roles=http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor

Use an appropriate canvas_user_login_id.

From the Security Model section, set the following:

PropertyValue
LTI version1.3.0
Message URLhttp://localhost:8080/app/launch OR http://localhost:8080/app/main
Client IDdev (or whatever is appropriate based on the record inserted in the database table from above)
Initiate login URLhttp://localhost:8080/lti/login_initiation/lms_lti_canvasnotifier
Redirection URI(s)http://localhost:8080/lti/login

Canvas JSON

Example json for the tool can be found in the examples directory.

Configuration

If choosing to use properties files for the configuration values, the default location is /usr/src/app/config, but that can be overridden by setting the APP_FULLFILEPATH value via system property or environment variable. You may use security.properties, overrides.properties, or set the APP_OVERRIDESFILENAME value with your desired file name.

Canvas Configuration

The following properties need to be set to configure the communication with Canvas and Canvas Catalog. They can be set in a properties file, or overridden as environment variables.

PropertyDefault ValueDescription
canvas.hostHostname of the Canvas instance
canvas.sso.hostHostname of the Canvas OIDC auth domain
canvas.baseUrlhttps://${canvas.host}Base URL of the Canvas instance
canvas.baseApiUrl${canvas.baseUrl}/api/v1Base URL for the Canvas API
canvas.tokenToken for access to Canvas instance
canvas.accountIdYour institution's root accountId in your Canvas instance
catalog.baseUrlBase URL of the Canvas Catalog instance
catalog.baseApiUrl${catalog.baseUrl}/api/v1Base URL for the Canvas Catalog API
catalog.tokenToken for access to the Canvas Catalog instance

Database Configuration

The following properties need to be set to configure the communication with a database. They can be set in a properties file, or overridden as environment variables.

PropertyDescription
lms.db.userUsername used to access the database
lms.db.urlJDBC URL of the database. Will have the form jdbc:<dbtype>://<host>:<port>/<database>
lms.db.passwordPassword for the user accessing the database
lms.db.poolTypeFully qualified name of the connection pool implementation to use. By default, it is auto-detected from the classpath.

Configure support contact information

The following properties need to be set to configure the contact information on the global error page. They can be set in a security.properties file, or overridden as environment variables.

PropertyDescription
lti.errorcontact.nameDisplay name for your support organization
lti.errorcontact.linkContact mechanism - URL or mailto:email (e.g. http://support.school.edu or mailto:support@school.edu)

Configure recipients for job notifications

PropertyDescription
canvasnotifier.batchNotificationEmailComma separated list of email addresses where job notifications will be sent

Denodo Configuration

To enable the Denodo configuration, include the value denodo into the SPRING_PROFILES_ACTIVE environment variable. Be aware that if the tool requires multiple values, that there could be more than one profile value in there. Make sure when you build with maven that you use the -P denodo parameter. Also, make sure if you run this locally in IntelliJ that you enable the denodo profile in the maven tab list of profiles. The following properties need to be set to configure the communication with the Denodo database.
They can be set in a properties file, or overridden as environment variables.

PropertyDescription
denodo.db.driverClassJDBC Driver class name
denodo.db.urlJDBC URL of the Denodo database. Will have the form jdbc:vdb://<host>:<port>/<database>
denodo.db.userUsername used to access the Denodo database
denodo.db.passwordPassword for the user accessing the Denodo database

Derdack Configuration

To enable the Derdack configuration (only needed for the batch job), include the value derdack into the SPRING_PROFILES_ACTIVE environment variable. Be aware that if the tool requires multiple values, that there could be more than one profile value in there. The following properties need to be set to configure the communication with the Derdack API. They can be set in a properties file, or overridden as environment variables.

PropertyDescription
derdack.baseUrlBase URL for the Derdack API endpoint
derdack.apiKeyAPI key fr the Derdack API
derdack.teamADS Group used to identify the team where notifications will go
derdack.recipientEmailEmail recipient used for non-critical notifications

Rabbit MQ Configuration

Job processing happens in the background, via a RabbitMQ job. Configuring the queue requires the following settings:

PropertyDescription
lms.rabbitmq.addressAddress of the Rabbit server, containing protocol, host, and port. Will have the form amqps://<host>:<port>
lms.rabbitmq.usernameUsername used to access the Rabbit server
lms.rabbitmq.passwordPassword for the user accessing the Rabbit server
lms.rabbitmq.virtualHostVirtual host of the Rabbit server. Most likely /.
lms.rabbitmq.queue_env_suffixEnvironment specific queue suffix. Allows for some "safety" if multiple instances run off of the same rabbit server.

Redis Configuration (optional)

If you would like to use Redis for session storage, you will need to enable it by including the value redis-session into the SPRING_PROFILES_ACTIVE environment variable. Be aware that if the tool requires multiple values, that there could be more than one profile value in there.

Additionally, the following properties need to be set to configure the communication with Redis. Then can be set in a properties file, or overridden as environment variables.

PropertyDescription
spring.redis.hostRedis server host.
spring.redis.portRedis server port.
spring.redis.databaseDatabase index used by the connection factory.
spring.redis.passwordLogin password of the redis server.

Vault Configuration (optional)

If you would like to use HasiCorp's Vault for secure property storage, you will need to enable it by including the value vault into the SPRING_PROFILES_ACTIVE environment variable. Be aware that if the tool requires multiple values, that there could be more than one profile value in there. Include any spring.cloud.vault.* properties that your environment requires in a properties file, or override as environment variables.

Exposing the LTI authz REST endpoints

If you would like to expose the LTI authz endpoints in this tool (for CRUD operations on the LTI authorizations), you will need to enable it by including the value ltirest into the SPRING_PROFILES_ACTIVE environment variable. Be aware that if the tool requires multiple values, that there could be more than one profile value in there.

Enabling swagger-ui for the LTI authz REST endpoints

:warning: Experimental :warning:

If you would like to enable the swagger-ui for interacting with the endpoints, include the value swagger into the SPRING_PROFILES_ACTIVE environment variable. Once enabled, the ui will be available at /api/lti/swagger-ui.html. There are some additional OAuth2 considerations that need to be accounted for while using this setup.

This is marked as experimental due to the fact that we aren't running with this option at IU. We are running into CORS issues when trying to talk to our OAuth2 service via swagger, so we can't verify if it really works or not!

Running the "cleanup" job

In order for this tool to work, the code will temporarily elevate the sender to an account administrator.
If something happens to go wrong in the job so that it doesn't get to its own cleanup activities, a user could be left with elevated permissions.
This poses a potential security risk (even though the approved users should be vetted beforehand).
To help with this, there is a job CanvasNotifierExpireElevationsJob that will look for notifier processes older than 5 minutes where a user was and still is elevated. Feel free to run this job at an interval that makes sense.

FAQs

Package last updated on 27 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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