Skip to content

Add LTI 1.1 config handler for the /lti11/config route - #67

Merged
consideRatio merged 14 commits into
jupyterhub:mainfrom
jgwerner:feat/lti11-config-handler
Sep 1, 2021
Merged

Add LTI 1.1 config handler for the /lti11/config route#67
consideRatio merged 14 commits into
jupyterhub:mainfrom
jgwerner:feat/lti11-config-handler

Conversation

@jgwerner

Copy link
Copy Markdown
Collaborator
  • Adds the LTI 1.1 configuration handler to render the authenticator's configuration in XML format
  • Updates README.md to included common settings section and adds LTI 1.1 configuration endpoint settings

Closes #49

@jgwerner
jgwerner requested a review from consideRatio August 29, 2021 22:23
@jgwerner jgwerner self-assigned this Aug 29, 2021
Signed-off-by: Greg Werner <werner.greg@gmail.com>
Signed-off-by: Greg Werner <werner.greg@gmail.com>
Signed-off-by: Greg Werner <werner.greg@gmail.com>
Signed-off-by: Greg Werner <werner.greg@gmail.com>
Comment thread ltiauthenticator/lti11/auth.py
Signed-off-by: Greg Werner <werner.greg@gmail.com>
@consideRatio

consideRatio commented Aug 29, 2021

Copy link
Copy Markdown
Member

@jgwerner from what I can tell given no actual experience with LTI, this LGTM.

Btw, I've not released 1.1.0 yet, I consider it briefly blocked by #65 or #66.

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

@consideRatio consideRatio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me but there were some issues with the markdown in the README.md after merging some formatting PR I think =/

Let's stop using explicit numbers and use 1. at all time to avoid numbering issues and make sure all numbered bullet points have their content indented under it.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread ltiauthenticator/lti11/handlers.py Outdated
@jgwerner

Copy link
Copy Markdown
Collaborator Author

Hi, @consideRatio thanks for the detailed review comments regarding the docs. I found some issues when testing with our Canvas sandbox and am updating the handlers/tests so will make sure to update the docs as well with the next push.

@consideRatio

Copy link
Copy Markdown
Member

@jgwerner absolutely!

Btw, do you think of this as something to release in 1.1.0 or later? Note I never cut that release when I ran into the outdated RELEASE.md docs.

Signed-off-by: Greg Werner <werner.greg@gmail.com>
@jgwerner
jgwerner requested a review from consideRatio August 30, 2021 21:22
@jgwerner

jgwerner commented Aug 30, 2021

Copy link
Copy Markdown
Collaborator Author

@consideRatio this should be ready now. The docs are updated and completed e2e tests with Canvas and Moodle.

Btw, do you think of this as something to release in 1.1.0 or later? Note I never cut that release when I ran into the outdated RELEASE.md docs.

I'm not sure if you follow the Semantic Release convention or not (I think @yuvipanda once mentioned that you do not). If you do, then this PR adds a new feature so it should require a new minor release version. If not, your call!

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

@consideRatio consideRatio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I made some documentation suggestions, but otherwise this LGTM from what I can tell.

Thank you for your thorough work on this @jgwerner!! ❤️ 🎉!

Comment thread README.md Outdated
Comment on lines +35 to +49
There are two configuration values to define with LTI 1.1:

Now we will use these strings to allow edX and JupyterHub to authenticate each other.
- The **consumers** setting: the value for the LTI 1.1 configuration `consumer key` and `shared secret`.
- The **username_key** setting: the parameter from the LTI 1.1 launch request used to set the JupyterHub username.
- The **config_description** setting:
- The **config_icon** setting:
- The **config_title** setting:

_Note_: These commands will simply generate strings for you, it will not store them anywhere on the computer. Therefore you do not need to run these commands on your JupyterHub server--we will be supplying them manually in the next few steps.
| LTI Authenticator Configuration Setting | Required | Description | Default |
| --------------------------------------- | -------- | ------------------------------------------------------------------------ | ---------------------------------- |
| config_description | No | The LTI 1.1 external tool description | `JupyterHub LTI 1.1 external tool` |
| config_icon | No | The http/s URL with the LTI 1.1 icon | `nil` |
| config_title | No | The LTI 1.1 external tool Title | `JupyterHub` |
| consumers | Yes | The key/value pair that represents the client key and shared secret | `{}` |
| username_key | No | The LTI 1.1 launch parameter that contains the JupyterHub username value | `canvas_custom_user_id` |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This section is confusing to me.

  1. "There are two configuration values to define with LTI 1.1:"
    I wonder both about "two" and "to define". Is the user required to set two values? Then why do I only see one listed as required in the table below?
  2. There is a bullet list table, followed by a markdown formatted table and both include the same things. I assume the bullet list table should be removed as an outdated duplicate.

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.

You're right, I goofed and had left the bullets in there by mistake. Only the table is documented now.

Comment thread README.md Outdated
Comment on lines +104 to +110
# Custom config for JupyterHub's helm chart
auth:
type: "lti"
lti:
consumers: { "client-key": "client-secret" }
username_key: "lis_person_contact_email_primary"
config_icon: "https://my.static.assets/img/icon.jpg"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The documentation above is outdated, it should be like this since ~0.10.X or 0.11.X i think, and the chart is now at 1.1.3.

Suggested change
# Custom config for JupyterHub's helm chart
auth:
type: "lti"
lti:
consumers: { "client-key": "client-secret" }
username_key: "lis_person_contact_email_primary"
config_icon: "https://my.static.assets/img/icon.jpg"
# Custom config for JupyterHub's helm chart
hub:
config:
# Additional documentation related to authentication and authorization available at
# https://zero-to-jupyterhub.readthedocs.io/en/latest/administrator/authentication.html
JupyterHub:
authenticator_class: lti
LTI11Authenticator:
consumers: { "client-key": "client-secret" }
username_key: "lis_person_contact_email_primary"
config_icon: "https://my.static.assets/img/icon.jpg"

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.

Corrected.

Comment thread README.md Outdated
```

_Note_: You will see **Client Key** and **Consumer Key** used interchangably.
> _Note_: all settings available with the `jupyterhub-ltiauthenticator` package are available with the `lti` key when defining a custom config for the JupyterHub helm chart.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
> _Note_: all settings available with the `jupyterhub-ltiauthenticator` package are available with the `lti` key when defining a custom config for the JupyterHub helm chart.
> _Note_: Configuring for example `hub.config.LTI11Authenticator.username_key=lis_person_contact_email_primary` above is the same as in a `jupyterhub_config.py writing `c.LTI11Authenticator.username_key = lis_person_contact_email_primary`.

@consideRatio consideRatio changed the title Add LTI 1.1 config handler Add LTI 1.1 config handler for the /lti11/config route Sep 1, 2021
@consideRatio

consideRatio commented Sep 1, 2021

Copy link
Copy Markdown
Member

@jgwerner how is the endpoint /lti11/config that is returning the rendered XML template used in practice? Is it required to be around by LTI v1.1 or similar for example? Perhaps you can answer by updating the PR description for anyone reading info about this PR later as well.

Comment thread ltiauthenticator/lti11/handlers.py Outdated

class LTI11ConfigHandler(BaseHandler):
"""
Renders LTI 1.1 configuration file in XML format.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you elaborate a bit in this docstring, perhaps link out to relevant schemas as described in #49?

@jgwerner

jgwerner commented Sep 1, 2021

Copy link
Copy Markdown
Collaborator Author

@consideRatio updates are pushed based on your suggestions

@consideRatio consideRatio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wieee nice! Ready for merge I'd say, do you want to review this also @yuvipanda?

@yuvipanda

Copy link
Copy Markdown
Collaborator

Go for it, @consideRatio. Let's be generous with our minor versions :)

@consideRatio
consideRatio merged commit 307e95e into jupyterhub:main Sep 1, 2021
@consideRatio

Copy link
Copy Markdown
Member

Wieeee great work as always @jgwerner, I appreciate how caring you are for this project!!

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.

Add an LTI 1.1 Tool Provider XML endpoint

3 participants