Skip to content

Refactor LTI 1.1 validator - #44

Merged
yuvipanda merged 2 commits into
jupyterhub:masterfrom
jgwerner:refactor-validator
May 17, 2021
Merged

Refactor LTI 1.1 validator#44
yuvipanda merged 2 commits into
jupyterhub:masterfrom
jgwerner:refactor-validator

Conversation

@jgwerner

Copy link
Copy Markdown
Collaborator

The LTI 1.3 validator has more validation requirements than LTI 1.1. This PR refactors the validator to establish a more common pattern between both LTI versions.

Related to #39

@yuvipanda yuvipanda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a delight to review :)


launch_url = protocol + "://" + handler.request.host + handler.request.uri
self.log.debug(
"Original arguments received in request: %s" % handler.request.arguments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these be sensitive?

@jgwerner jgwerner Apr 15, 2021

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuvipanda Not that I am aware of. The launch request arguments could contain sensitive information if the integration with the LMS is set to public, in which case the username is fetched from one of the personally identifiable arguments, such as email. When the application is set to private, the user_id is an opaque identifier and not considered personally identifiable information (PII). But in these cases the arguments that would contain PII values are empty. The other arguments are related to context (courses) or assignments/modules (resources), etc. Lastly, there are oauth_* arguments but these shouldn't be that sensitive. We could obfuscate some or all arguments from the request for logging, what do you think?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's debug logging I think it's ok. We already log user_ids elsewhere in JupyterHub.

Comment thread ltiauthenticator/lti11/auth.py
Comment thread ltiauthenticator/utils.py Outdated
Comment thread ltiauthenticator/utils.py Outdated

@jgwerner jgwerner left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuvipanda thanks for the review and the suggestions! Perhaps we could contribute a PR to add a feature to esapism so users can truncate the string to a predetermined number of characters and have the string length default to 253, although it's unlikely that it would be longer. I don't see that option in the esapism package. We can truncate the string length based on the specific needs for Kubernetes / Docker names separately.

@jgwerner

Copy link
Copy Markdown
Collaborator Author

@yuvipanda PR #43 is now updated to replace the custom utility functions with escapism.

@jgwerner

Copy link
Copy Markdown
Collaborator Author

@yuvipanda to make the review process a little simpler for you I rebased this branch with #43.

Signed-off-by: Greg Werner <werner.greg@gmail.com>
Signed-off-by: Greg Werner <werner.greg@gmail.com>
@yuvipanda

Copy link
Copy Markdown
Collaborator

Thank you very much for your patience, @jgwerner!

@yuvipanda
yuvipanda merged commit 98fe61a into jupyterhub:master May 17, 2021
@consideRatio

Copy link
Copy Markdown
Member

Wieeee thank you for your effort on this @jgwerner ❤️ 🎉 🌻 !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants