This repository was archived by the owner on Sep 26, 2025. It is now read-only.
added url as a parameter to allow user to set the url directly, becau…#65
Open
rmundkowsky wants to merge 4 commits intomitodl:masterfrom
Open
added url as a parameter to allow user to set the url directly, becau…#65rmundkowsky wants to merge 4 commits intomitodl:masterfrom
rmundkowsky wants to merge 4 commits intomitodl:masterfrom
Conversation
…se oauth requires the exact url that LTI used, but the url can be changed by a redirect, rewrite, proxy, ssl offload, or etc.
Contributor
|
@rmundkowsky please fix pep8 issues |
Author
|
I corrected pep 8 issues. I am not sure if I need to create new pull request or if this request will pull the corrected code. |
amir-qayyum-khan
suggested changes
Jun 1, 2017
Contributor
amir-qayyum-khan
left a comment
There was a problem hiding this comment.
So for multiple instance under load balancer, users need to change change url in each instance?
| def lti(app=None, request='any', error=default_error, role='any', | ||
| def lti(app=None, request='any', error=default_error, role='any', url=None, | ||
| *lti_args, **lti_kwargs): | ||
| """ |
Contributor
There was a problem hiding this comment.
please update the doc string
Author
There was a problem hiding this comment.
I added a comment as requested. Hopefully the comment will answer your question.
amir-qayyum-khan
approved these changes
Jun 1, 2017
amir-qayyum-khan
suggested changes
Jun 1, 2017
pylti/flask.py
Outdated
| :param: request - Request type from | ||
| :py:attr:`pylti.common.LTI_REQUEST_TYPE`. (default: any) | ||
| :param: roles - LTI Role (default: any) | ||
| :param: url - This is an optional setting that allows you to set |
Author
|
pep8 corrected again. Sorry, about that. |
Contributor
|
please add unit test to assert that ur changed, pylti uses that url |
Author
|
finally got back to this. I am not sure how to make a unit test for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added url as a parameter to allow user to set the url directly, because oauth requires the exact url that LTI used, but the url can be changed by a redirect, rewrite, proxy, ssl offload, or etc.
For example, the LTI consumer might use https://foo.bar.com, but your app might be behind a load balancer, so url by the time it gets to the Flask app is http://server1.foo.bar.com:8443/
I had tried to make a decorator to do this, but was pretty complex. This approach is easier and will be commonly needed by LTI users anyways.