New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: LTI 1.3 reusable configuration #2
Merged
Agrendalath
merged 4 commits into
open-craft:main
from
Pearson-Advance:kuipumu/lti_1p3_reusable_configuration
Oct 24, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.0.1" | ||
__version__ = "1.0.0" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Generated by Django 3.2.17 on 2023-09-27 04:41 | ||
|
||
from django.db import migrations, models | ||
import lti_store.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('lti_store', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_client_id', | ||
field=models.CharField(blank=True, help_text='Client ID used by LTI tool', max_length=255, verbose_name='LTI 1.3 Client ID'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_deployment_id', | ||
field=models.CharField(blank=True, help_text='Deployment ID used by LTI tool', max_length=255, verbose_name='LTI 1.3 Deployment ID'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_launch_url', | ||
field=models.URLField(blank=True, help_text='This is the LTI launch URL, otherwise known as the target_link_uri.\n It represents the LTI resource to launch to or load in the second leg of the launch flow,\n when the resource is actually launched or loaded.', max_length=255, verbose_name='LTI 1.3 Launch URL'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_oidc_url', | ||
field=models.URLField(blank=True, help_text='This is the OIDC third-party initiated login endpoint URL in the LTI 1.3 flow,\n which should be provided by the LTI Tool.', max_length=255, verbose_name='LTI 1.3 OIDC URL'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_private_key', | ||
field=models.TextField(blank=True, help_text="Platform's generated Private key. Keep this value secret.", validators=[lti_store.models.validate_rsa_key], verbose_name='LTI 1.3 Private Key'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_private_key_id', | ||
field=models.CharField(blank=True, help_text="Platform's generated Private key ID", max_length=255, verbose_name='LTI 1.3 Private Key ID'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_public_jwk', | ||
field=models.JSONField(blank=True, default=dict, editable=False, help_text="Platform's generated JWK keyset.", verbose_name='LTI 1.3 Public JWK'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_redirect_uris', | ||
field=models.TextField(blank=True, default=list, help_text="Valid urls the Tool may request us to redirect the id token to.\n The redirect uris are often the same as the launch url/deep linking url so if\n this field is empty, it will use them as the default. If you need to use different\n redirect uri's, enter them here. If you use this field you must enter all valid\n redirect uri's the tool may request.", validators=[lti_store.models.validate_list_field], verbose_name='LTI 1.3 Redirect URIs'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_tool_keyset_url', | ||
field=models.URLField(blank=True, help_text="This is the LTI Tool's JWK (JSON Web Key)\n Keyset (JWKS) URL. This should be provided by the LTI\n Tool. One of either lti_1p3_tool_public_key or\n lti_1p3_tool_keyset_url must not be blank.", max_length=255, verbose_name='LTI 1.3 Tool Keyset URL'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_1p3_tool_public_key', | ||
field=models.TextField(blank=True, help_text="This is the LTI Tool's public key.\n This should be provided by the LTI Tool.\n One of either lti_1p3_tool_public_key or\n lti_1p3_tool_keyset_url must not be blank.", validators=[lti_store.models.validate_rsa_key], verbose_name='LTI 1.3 Tool Public Key'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_advantage_ags_mode', | ||
field=models.CharField(choices=[('disabled', 'Disabled'), ('declarative', 'Allow tools to submit grades only (declarative)'), ('programmatic', 'Allow tools to manage and submit grade (programmatic)')], default='declarative', help_text='Enable LTI Advantage Assignment and Grade Services and select the functionality\n enabled for LTI tools. The "declarative" mode (default) will provide a tool with a LineItem\n created from the XBlock settings, while the "programmatic" one will allow tools to manage,\n create and link the grades.', max_length=20, verbose_name='LTI Advantage Assignment and Grade Services Mode'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_advantage_deep_linking_enabled', | ||
field=models.BooleanField(default=False, help_text='Enable LTI Advantage Deep Linking.', verbose_name='Enable LTI Advantage Deep Linking'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_advantage_deep_linking_launch_url', | ||
field=models.URLField(blank=True, help_text='This is the LTI Advantage Deep Linking launch URL. If the LTI Tool\n does not provide one, use the same value as lti_1p3_launch_url.', max_length=255, verbose_name='LTI Advantage Deep Linking launch URL'), | ||
), | ||
migrations.AddField( | ||
model_name='externallticonfiguration', | ||
name='lti_advantage_enable_nrps', | ||
field=models.BooleanField(default=False, help_text='Enable LTI Advantage Names and Role Provisioning Services.', verbose_name='Enable LTI Advantage Names and Role Provisioning Services'), | ||
), | ||
migrations.AlterField( | ||
model_name='externallticonfiguration', | ||
name='version', | ||
field=models.CharField(choices=[('lti_1p1', 'LTI 1.1'), ('lti_1p3', 'LTI 1.3')], default='lti_1p1', max_length=10), | ||
), | ||
] |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to regenerate JWK on every save? The
LtiConfiguration
model is doing this only when the value is missing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only executed when the external configuration is saved, I don't think there is much of a performance hit compared to verifying if any key is missing every time they are being accessed. The method used on the LtiConfiguration has a disadvantage, if the LtiConfiguration private key is updated, the public JWK will need to be deleted so it's regenerated. I could add more logic to make sure the public JWK is only re-generated if the private key or private key ID is changed, but I didn't find a simple way to do this on the model save method.