forked from openedx/openedx-platform
-
Notifications
You must be signed in to change notification settings - Fork 6
Rnoep #8
Closed
Closed
Rnoep #8
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cb22822
Add staff mode to API
sendr afad5c5
Add update object signals
sendr 6533522
Fix api
sendr 885240a
Add update object signals
sendr a20beef
LMS SSO login
maximst 5927493
Merge branch 'rnoep' of https://github.com/raccoongang/edx-platform i…
maximst 4d40dca
Added file with npoed specific settings
dixon-che f49eaf4
Revert changes in lms/templates/navigation.html
dixon-che b7d7a5b
Added open_edx_api_extension to urls and requirements
dixon-che 0b28aeb
Added PLPRedirection middleware to npoed settings
dixon-che c26d242
Revert "Add update object signals"
maximst 678f93f
Revert "Add staff mode to API"
maximst 8635042
Add social logout URL
maximst 421359d
Fix requirements
maximst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import datetime | ||
|
|
||
| from .aws import * | ||
|
|
||
|
|
||
| SSO_NPOED_URL = ENV_TOKENS.get('SSO_NPOED_URL') #'http://sso.rnoep.raccoongang.com' | ||
|
|
||
| SSO_API_URL = "%s/api-edx/" % SSO_NPOED_URL #'http://sso.rnoep.raccoongang.com/api-edx/' | ||
| SSO_API_TOKEN = AUTH_TOKENS.get('SSO_API_TOKEN') #'b4c2b895087d457b86fc9096f344a687947b70fb' | ||
|
|
||
|
|
||
| SOCIAL_AUTH_EXCLUDE_URL_PATTERN = r'^/admin' | ||
| SOCIAL_AUTH_LOGOUT_URL = "%s/logout/" % SSO_NPOED_URL #'http://sso.rnoep.raccoongang.com/logout/' | ||
| SOCIAL_AUTH_RAISE_EXCEPTIONS = True | ||
|
|
||
| MIDDLEWARE_CLASSES += ('sso_edx_npoed.middleware.SeamlessAuthorization', ) | ||
|
|
||
| # We should login always with npoed-sso. There is specific backend for cms | ||
| # from sso_edx_npoed.backends.npoed import NpoedBackendCMS | ||
| # NpoedBackendCMS.name | ||
| SSO_NPOED_BACKEND_NAME = 'sso_npoed_cms-oauth2' | ||
| LOGIN_URL = '/auth/login/%s/' % SSO_NPOED_BACKEND_NAME | ||
|
|
||
| # Add extra dir for mako templates finder | ||
| # '/edx/app/edxapp/venvs/edxapp/src/npoed-sso-edx-client/sso_edx_npoed/templates') | ||
| NPOED_MAKO_TEMPLATES = ENV_TOKENS.get('NPOED_MAKO_TEMPLATES', []) | ||
|
|
||
| #TEMPLATE_DIRS.insert(0, '/edx/app/edxapp/venvs/edxapp/src/npoed-sso-edx-client/sso_edx_npoed') | ||
| MAKO_TEMPLATES['main'] = NPOED_MAKO_TEMPLATES + MAKO_TEMPLATES['main'] | ||
|
|
||
|
|
||
| CELERYBEAT_SCHEDULE = {} | ||
|
|
||
| ##### Third-party auth options ################################################ copied from lms/aws.py | ||
| if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'): | ||
| THIRD_PARTY_AUTH_BACKENDS = ENV_TOKENS.get('THIRD_PARTY_AUTH_BACKENDS') | ||
|
|
||
| if THIRD_PARTY_AUTH_BACKENDS: | ||
| AUTHENTICATION_BACKENDS = THIRD_PARTY_AUTH_BACKENDS + list(AUTHENTICATION_BACKENDS) | ||
|
|
||
| # The reduced session expiry time during the third party login pipeline. (Value in seconds) | ||
| SOCIAL_AUTH_PIPELINE_TIMEOUT = ENV_TOKENS.get('SOCIAL_AUTH_PIPELINE_TIMEOUT', 600) | ||
|
|
||
| # third_party_auth config moved to ConfigurationModels. This is for data migration only: | ||
| THIRD_PARTY_AUTH_OLD_CONFIG = AUTH_TOKENS.get('THIRD_PARTY_AUTH', None) | ||
|
|
||
| if ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24) is not None: | ||
| CELERYBEAT_SCHEDULE['refresh-saml-metadata'] = { | ||
| 'task': 'third_party_auth.fetch_saml_metadata', | ||
| 'schedule': datetime.timedelta(hours=ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24)), | ||
| } | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,3 +205,13 @@ | |
| url(r'404', handler404), | ||
| url(r'500', handler500), | ||
| ) | ||
|
|
||
| # Third-party auth. | ||
| if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'): | ||
| urlpatterns += ( | ||
| url(r'', include('third_party_auth.urls')), | ||
| # NOTE: The following login_oauth_token endpoint is DEPRECATED. | ||
| # Please use the exchange_access_token endpoint instead. | ||
| url(r'^login_oauth_token/(?P<backend>[^/]+)/$', 'student.views.login_oauth_token'), | ||
| url(r'^social-logout', 'sso_edx_npoed.views.logout', name='social-logout'), | ||
| ) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. пустая строка There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. почему пустая? мы же ставим ENABLE_THIRD_PARTY_AUTH=True |
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from .aws import * | ||
|
|
||
|
|
||
| SSO_NPOED_URL = ENV_TOKENS.get('SSO_NPOED_URL') #'http://sso.rnoep.raccoongang.com' | ||
|
|
||
| SSO_API_URL = "%s/api-edx/" % SSO_NPOED_URL #'http://sso.rnoep.raccoongang.com/api-edx/' | ||
| SSO_API_TOKEN = AUTH_TOKENS.get('SSO_API_TOKEN') #'b4c2b895087d457b86fc9096f344a687947b70fb' | ||
|
|
||
|
|
||
| SOCIAL_AUTH_EXCLUDE_URL_PATTERN = r'^/admin' | ||
| SOCIAL_AUTH_LOGOUT_URL = "%s/logout/" % SSO_NPOED_URL #'http://sso.rnoep.raccoongang.com/logout/' | ||
| SOCIAL_AUTH_RAISE_EXCEPTIONS = True | ||
|
|
||
| MIDDLEWARE_CLASSES += ('sso_edx_npoed.middleware.PLPRedirection', | ||
| 'sso_edx_npoed.middleware.SeamlessAuthorization') | ||
|
|
||
| PLP_URL = ENV_TOKENS.get('PLP_URL') | ||
|
|
||
| # We should login always with npoed-sso | ||
| # from sso_edx_npoed.backends.npoed import NpoedBackend | ||
| # NpoedBackend.name | ||
| SSO_NPOED_BACKEND_NAME = 'sso_npoed-oauth2' | ||
| LOGIN_URL = '/auth/login/%s/' % SSO_NPOED_BACKEND_NAME | ||
|
|
||
| # Add extra dir for mako templates finder | ||
| # '/edx/app/edxapp/venvs/edxapp/src/npoed-sso-edx-client/sso_edx_npoed/templates') | ||
| NPOED_MAKO_TEMPLATES = ENV_TOKENS.get('NPOED_MAKO_TEMPLATES', []) | ||
|
|
||
| #TEMPLATE_DIRS.insert(0, '/edx/app/edxapp/venvs/edxapp/src/npoed-sso-edx-client/sso_edx_npoed') | ||
| MAKO_TEMPLATES['main'] = NPOED_MAKO_TEMPLATES + MAKO_TEMPLATES['main'] | ||
|
|
||
|
|
||
|
|
||
| #OAUTH_OIDC_ISSUER = "https://rnoep.raccoongang.com/oauth2" |
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
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
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.
Пустая строка