We want to support a flow for SSO-enabled Enterprise customers who have
agreed off-platform that none of their learners will opt-in to marketing emails
or sharing research data. This change proposes to do so by
adding an optional field that, when enabled, disables the presence of
the two checkboxes on this registration form and sets their values to false.
ENT-11401
Some models in third_party_auth used settings.SITE_ID as a field
default, which caused Django to say migrations were out of sync whenever
settings.SITE_ID happened to be anything other than 1 for any developer:
Your models in app(s): 'third_party_auth' have changes that are not
yet reflected in a migration, and so won't be applied. Run
'manage.py makemigrations' to make new migrations, and then re-run
'manage.py migrate' to apply them.
This could easily happen if a developer is testing out site
configuration or site-specific theming and ends up with a SITE_ID other
than 1.
The fix, inspired by a StackOverflow answer [1], is to simply create
a wrapper function for the dynamic default value. The wrapper function,
rather than the current value of SITE_ID, will be serialized to the
migraiton file.
This commit includes a migration file, but from a database perspective,
the migration is a no-op.
[1] https://stackoverflow.com/a/12654998
Allows admins to configure same oauth backend for multiple sites.
This change includes site_id in KEY_FIELDS for oauth configuration
provider allowing a backend configuration for each site.
When attempting to create a "Provider Configuration (LTI)" object in the
django admin, the following 500 error was being triggered:
"Either an icon class or an icon image must be given (but not both)"
This was caused by the `clean()` method of the mother class
(OAuth2ProviderConfig) which checked whether at least the icon_class XOR
icon_list attribute was well defined. In the case of the
LTIProviderConfig objects it isn't, but that's ok because this object
is not meant to be displayed in the login form.
To resolve this issue, we modify the `clean()` method to ensure that at
most icon_class or icon_image is set. Alternatively, we could have set
`visible = False` and then dropped the `visible` column from the
database, but it was deemed too risky.
unused.
Close CRI-205.
Rather than fetching the Site for every provider in a loop, just look at
the ID of the site.
Added regression test, showing N `django_site` requests before and 0 after.
* Removing from provider imports from openedx
* removed all uses of retire_dop_oauth2_models
* Removing provider library from lms, common, and cms
Created/copied function short_token(from django-oauth-provider) and create_hash256 to help with conversion
* Remove ThirdPartyAuthProviderApiPermission
Also removed ProviderApiPermissions and ApiPermissionsAdminForm and removal of DOP for third_party_auth
* Removing model
* Replaced long_token with default_token_generator
* Adding skip to test_migrations_are_in_sync
Logout link should be displayed only for learner portal
Added changed to display only for learner portal
Added unit tests
check third_party_auth is enabled
Changes to extend SSO logout link feature to Oauth providers
Fixed quality violations
Removed unncessary assert
Reviewer feedback changes
* fix type mismatch in third_party_auth migrations
* fix type mismatch in verify_student migrations
* fix type mismatch in video_config migrations
* fix type mismatch in verified_track_content migrations
* fix type mismatch in commercemigrations
* fix type mismatch in xblock_config migrations
* fix type mismatch in course_creators migrations
* fix type mismatch in contentstore migrations
Django 2.0 will make this field required for `ForeignKey` and `OneToOneFields`.
In previous versions the option defaulted to `models.CASCADE` when not
specified. This change should make the deprecation warnings in the current
Django version go away.
The migrations where also modified, but the changes should not cause a change in
the database schema since `models.CASCADE` was already the old default.