openedx-authz 3.2.0__tar.gz → 4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/CHANGELOG.rst +3 -0
- {openedx_authz-3.2.0/src/openedx_authz.egg-info → openedx_authz-4.0.0}/PKG-INFO +1 -1
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0028-api-contract-for-role-catalog.rst +8 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/utils.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/discovery.py +4 -10
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/parsing.py +7 -7
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/filters.py +2 -1
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/handlers.py +6 -2
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0010_scope_external_key.py +3 -4
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0011_authz_schema_definitions.py +2 -6
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/data.py +0 -7
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/serializers.py +1 -10
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/views.py +1 -1
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/pipeline.py +2 -7
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/views.py +1 -1
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_roles.py +4 -12
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_users.py +3 -9
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/test_builtin_definitions.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/test_instructor_dashboard_permissions.py +8 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/admin_console/test_views.py +8 -12
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/test_pipeline.py +16 -14
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/test_views.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_views.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_discovery.py +1 -5
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_loading.py +1 -6
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_translation.py +115 -39
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_imports.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_migrations.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_utils.py +36 -44
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/utils.py +1 -3
- {openedx_authz-3.2.0 → openedx_authz-4.0.0/src/openedx_authz.egg-info}/PKG-INFO +1 -1
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.annotation_safe_list.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.editorconfig +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/dependabot.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/add-depr-ticket-to-depr-board.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/add-remove-label-on-comment.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/ci.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/commitlint.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/release.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/self-assign-issue.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.github/workflows/upgrade-python-requirements.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.gitignore +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.pii_annotations.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/.readthedocs.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/LICENSE +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/MANIFEST.in +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/Makefile +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/catalog-info.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/codecov.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/Makefile +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/_images/architecture-overview.png +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/_static/theme_overrides.css +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/changelog.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/content_library_roles.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/course_roles.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/concepts/core_roles_and_permissions/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/concepts/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/conf.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0001-purpose-of-this-repo.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0002-authorization-model-foundation.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0003-jwt-usage.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0004-technology-selection.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0005-architecture-and-data-modeling.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0007-enforcement-mechanisms-mfe.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0008-compatibility-scheme.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0009-authz-for-course-authoring.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0010-course-authoring-flag.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0011-course-authoring-migration-process.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0012-auditability.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0012-glob-support-for-role-assignments.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0013-course-authoring-automatic-migration.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0014-bulk-assignment-queries-without-casbin-enforce.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0015-expose-course-authoring-waffle-flag-state-via-rest-api.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0016-static-and-dynamic-roles.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0017-static-authorization-schema.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0018-authorization-schema-lifecycle.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0019-authorization-schema-discovery.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0020-authorization-schema-internationalization.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0021-authorization-definition-api.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0022-defer-authorization-implications.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0023-extend-static-roles.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0024-api-contract-for-user-grouped-role-assignments.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0025-authorization-schema-source-tracking.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0026-rest-api-domain-ownership-boundary.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0027-cross-domain-filtering-via-openedx-filters.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0029-paragon-icon-list-maintenance.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0030-tutor-implementation-authz-schema-discovery.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0031-priority-applies-to-role-extensions-only.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0032-applets-for-built-in-authorization-capabilities.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0033-shared-applet-for-course-team-roles.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0034-permission-dependencies-in-authorization-schema.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/getting_started.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/how-tos/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/how-tos/use-built-in-constants.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/internationalization.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/make.bat +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/quickstarts/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/readme.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/authorization-schema-json.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/authorization-schema.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/built-in-constants.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/compiled-schema.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/compiled-schema.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/references/index.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/testing.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/manage.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/pylintrc +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/pylintrc_tweaks +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/pyproject.toml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/ruff.toml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/scripts/generate_compiled_schema.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/scripts/generate_paragon_icons.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/setup.cfg +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/admin.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/catalog.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/data.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/roles.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/api/users.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/schema/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/content_libraries/schema/roles.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/schema/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/schema/legacy_permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/course_team_roles/schema/roles.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/schema/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/schema/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/constants.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/schema/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/apps.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/authz/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/conf/locale/config.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/roles.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/constants/schema.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/data.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/adapter.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/apps.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/config/model.conf +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/enforcer.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/filter.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/matcher.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/policy.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/renderer.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/authz-schema-v1.json +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/compilation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/exceptions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/issues.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/loading.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/paragon_icons.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/pipeline.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/snapshot.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/syntax.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/translation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/compilation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/definitions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/types/loading.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/schema/validation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/engine/utils.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/authz_migrate_course_authoring.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/authz_rollback_course_authoring.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/enforcement.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/extract_schema_translations.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/load_authz_schema.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/management/commands/load_policies.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0001_add_casbin_dependency.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0002_initial.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0003_usersubject.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0004_contentlibraryscope.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0005_policycachecontrol.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0006_migrate_legacy_permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0007_coursescope.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0008_authzcourseauthoringmigrationrun.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0009_roleassignmentaudit.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0012_move_builtin_schema_sources_to_applets.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/authz_migration.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/base.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/core.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/engine.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/schema.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/scopes.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/models/subjects.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/decorators.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/urls.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/utils.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/filters.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/fields.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/paginators.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/serializers.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/urls.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/views.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/common.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/production.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/settings/test.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/templates/openedx_authz/base.html +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_catalog.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/api/test_data.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/applets/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/authz/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/authz/test_resources.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/conftest.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/categories.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/permissions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_compiled/roles.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_parse/malformed.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_semantics/unknown_category.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/items.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/invalid_structure/priority.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/categories.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/extensions.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/permissions.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/fixtures/schema_pipeline/valid/roles.yaml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_handlers.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_models.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_schema_apply.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_schema_pipeline.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/integration/test_views.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/admin_console/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/course_authoring/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/mixins.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/rest_api/test_utils.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/role_permissions.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/factories.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_apply.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_compilation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_json_schema.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_load_authz_schema_command.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_parsing.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_pipeline.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_renderer.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_schema_models.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_snapshot.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_source_storage.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_syntax.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_types.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_validation.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/apps.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0001_initial.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0002_learningpackage_contentlibrary_learning_package.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/migrations/0002_userprofile.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/stubs/models.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_commands.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_enforcement.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_enforcer.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_engine_utils.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_filter.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_handlers.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_models.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/test_policy.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/urls.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/SOURCES.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/dependency_links.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/entry_points.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/requires.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/scm_file_list.json +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz.egg-info/top_level.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tox.ini +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/.gitignore +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/LICENSE.txt +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/MANIFEST.in +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/Makefile +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/README.rst +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/pyproject.toml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/__about__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/__init__.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/patches/openedx-common-settings +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/plugin.py +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/tutor/tutor-contrib-authz/tutor_authz/templates/apps/openedx/config/authz-schema.yml +0 -0
- {openedx_authz-3.2.0 → openedx_authz-4.0.0}/uv.lock +0 -0
|
@@ -58,6 +58,9 @@ Changed
|
|
|
58
58
|
|
|
59
59
|
* Static roles may declare an empty permission list when ``role_extensions`` contribute their permissions. Permission lists used by extension edits remain non-empty.
|
|
60
60
|
* Built-in Content Library and course authorization definitions now live in capability applets. The compiled authorization schema, the permission constants, and the role keys remain unchanged.
|
|
61
|
+
* **Breaking**: ``GET /api/authz/v1/scopes/`` no longer accepts ``course`` and ``library`` as
|
|
62
|
+
``scope_type`` values. Use ``course-v1`` and ``lib`` instead. Requests with the old values now
|
|
63
|
+
return a 400 validation error, the same as ``/roles/``.
|
|
61
64
|
|
|
62
65
|
Removed
|
|
63
66
|
=======
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openedx-authz
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
4
4
|
Summary: Open edX AuthZ provides the architecture and foundations of the authorization framework.
|
|
5
5
|
Author-email: Open edX Project <oscm@openedx.org>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
{openedx_authz-3.2.0 → openedx_authz-4.0.0}/docs/decisions/0028-api-contract-for-role-catalog.rst
RENAMED
|
@@ -409,7 +409,15 @@ References
|
|
|
409
409
|
* `ADR 0025`_
|
|
410
410
|
* `ADR 0029`_
|
|
411
411
|
|
|
412
|
+
Addendum: 2026-11-11
|
|
413
|
+
********************
|
|
414
|
+
|
|
415
|
+
The deprecated ``course`` and ``library`` aliases of ``GET /api/authz/v1/scopes/`` were removed after the Admin Console migrated to ``course-v1`` and ``lib`` (`Issue #536`_). ``/scopes/`` and ``/roles/`` now accept only these values, and the short names are rejected as invalid choices.
|
|
416
|
+
|
|
417
|
+
This addendum replaces the alias bullets in "Scope type naming" and the mention of the aliases in the consequences.
|
|
418
|
+
|
|
412
419
|
.. _frontend-app-admin-console: https://github.com/openedx/frontend-app-admin-console
|
|
420
|
+
.. _Issue #536: https://github.com/openedx/openedx-authz/issues/536
|
|
413
421
|
.. _ADR 0020: 0020-authorization-schema-internationalization.rst
|
|
414
422
|
.. _ADR 0021: 0021-authorization-definition-api.rst
|
|
415
423
|
.. _ADR 0023: 0023-extend-static-roles.rst
|
|
@@ -100,9 +100,7 @@ def get_scope_display_name_map(scope_external_keys: set[str]) -> dict[str, str]:
|
|
|
100
100
|
if library_scopes and ContentLibrary is not None:
|
|
101
101
|
lib_pairs = {(s.library_key.org, s.library_key.slug) for s in library_scopes}
|
|
102
102
|
try:
|
|
103
|
-
lib_filter = reduce(
|
|
104
|
-
operator.or_, (Q(org__short_name=org, slug=slug) for org, slug in lib_pairs)
|
|
105
|
-
)
|
|
103
|
+
lib_filter = reduce(operator.or_, (Q(org__short_name=org, slug=slug) for org, slug in lib_pairs))
|
|
106
104
|
lib_qs = ContentLibrary.objects.filter(lib_filter).select_related("learning_package", "org")
|
|
107
105
|
|
|
108
106
|
for lib in lib_qs:
|
|
@@ -143,9 +143,7 @@ class DiscoveredFileResource(DiscoveredResource):
|
|
|
143
143
|
try:
|
|
144
144
|
return Path(self.resource_path).read_bytes()
|
|
145
145
|
except OSError as exc:
|
|
146
|
-
raise SchemaDiscoveryError(
|
|
147
|
-
f"Could not read schema file {self.resource_path!r}: {exc}"
|
|
148
|
-
) from exc
|
|
146
|
+
raise SchemaDiscoveryError(f"Could not read schema file {self.resource_path!r}: {exc}") from exc
|
|
149
147
|
|
|
150
148
|
|
|
151
149
|
class SchemaDiscoveryError(Exception):
|
|
@@ -250,8 +248,7 @@ class SchemaDiscovery:
|
|
|
250
248
|
return []
|
|
251
249
|
if not isinstance(file_paths, list):
|
|
252
250
|
raise SchemaDiscoveryError(
|
|
253
|
-
"OPENEDX_AUTHZ_SCHEMA_FILES must be a list of filesystem paths, "
|
|
254
|
-
f"got {type(file_paths).__name__!r}."
|
|
251
|
+
"OPENEDX_AUTHZ_SCHEMA_FILES must be a list of filesystem paths, " f"got {type(file_paths).__name__!r}."
|
|
255
252
|
)
|
|
256
253
|
discovered: list[DiscoveredResource] = []
|
|
257
254
|
for file_path in file_paths:
|
|
@@ -265,13 +262,10 @@ class SchemaDiscovery:
|
|
|
265
262
|
path = Path(file_path)
|
|
266
263
|
if not path.is_file():
|
|
267
264
|
raise SchemaDiscoveryError(
|
|
268
|
-
f"Schema file {file_path!r} contributed through "
|
|
269
|
-
"OPENEDX_AUTHZ_SCHEMA_FILES is not an actual file"
|
|
265
|
+
f"Schema file {file_path!r} contributed through " "OPENEDX_AUTHZ_SCHEMA_FILES is not an actual file"
|
|
270
266
|
)
|
|
271
267
|
|
|
272
|
-
discovered.append(
|
|
273
|
-
DiscoveredFileResource.from_path(file_path)
|
|
274
|
-
)
|
|
268
|
+
discovered.append(DiscoveredFileResource.from_path(file_path))
|
|
275
269
|
return discovered
|
|
276
270
|
|
|
277
271
|
def _iter_directory(self, directory: str, *, origin: Origin) -> list[DiscoveredResource]:
|
|
@@ -54,7 +54,7 @@ class SchemaParser:
|
|
|
54
54
|
|
|
55
55
|
@staticmethod
|
|
56
56
|
def parse_yamls(contents: bytes, resource: DiscoveredResource) -> list[object]:
|
|
57
|
-
"""Parse YAML bytes as a multi-document stream, skipping empty
|
|
57
|
+
"""Parse YAML bytes as a multi-document stream, skipping empty
|
|
58
58
|
documents, and preserve the resulting root value.
|
|
59
59
|
"""
|
|
60
60
|
try:
|
|
@@ -73,12 +73,12 @@ class SchemaParser:
|
|
|
73
73
|
distribution, version = self.resolve_distribution(resource)
|
|
74
74
|
content_digest = hashlib.sha256(contents).hexdigest()
|
|
75
75
|
source_record = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
"distribution": distribution,
|
|
77
|
+
"distribution_version": version,
|
|
78
|
+
"module": resource.module,
|
|
79
|
+
"resource_path": resource.resource_path,
|
|
80
|
+
"schema_version": schema_version,
|
|
81
|
+
"content_digest": content_digest,
|
|
82
82
|
}
|
|
83
83
|
if isinstance(resource, DiscoveredFileResource):
|
|
84
84
|
return SourceFileRecord(**source_record)
|
|
@@ -47,7 +47,8 @@ class AuthorizationDataRequested(OpenEdxPublicFilter, Generic[AuthorizationItems
|
|
|
47
47
|
|
|
48
48
|
@classmethod
|
|
49
49
|
def run_filter(
|
|
50
|
-
cls,
|
|
50
|
+
cls,
|
|
51
|
+
items: AuthorizationItems,
|
|
51
52
|
) -> tuple[AuthorizationItems, list[dict[str, Any]]]:
|
|
52
53
|
"""
|
|
53
54
|
Run the operation's configured pipeline with an initially empty error list.
|
|
@@ -161,7 +161,9 @@ def backfill_course_scope(sender, instance, **kwargs): # pylint: disable=unused
|
|
|
161
161
|
CourseScope.link_pending_scope(instance)
|
|
162
162
|
except Exception as exc: # pylint: disable=broad-exception-caught
|
|
163
163
|
logger.exception(
|
|
164
|
-
"Error linking pending CourseScope to CourseOverview %s",
|
|
164
|
+
"Error linking pending CourseScope to CourseOverview %s",
|
|
165
|
+
instance.pk,
|
|
166
|
+
exc_info=exc,
|
|
165
167
|
)
|
|
166
168
|
|
|
167
169
|
|
|
@@ -177,7 +179,9 @@ def backfill_content_library_scope(sender, instance, **kwargs): # pylint: disab
|
|
|
177
179
|
ContentLibraryScope.link_pending_scope(instance)
|
|
178
180
|
except Exception as exc: # pylint: disable=broad-exception-caught
|
|
179
181
|
logger.exception(
|
|
180
|
-
"Error linking pending ContentLibraryScope to ContentLibrary %s",
|
|
182
|
+
"Error linking pending ContentLibraryScope to ContentLibrary %s",
|
|
183
|
+
instance.pk,
|
|
184
|
+
exc_info=exc,
|
|
181
185
|
)
|
|
182
186
|
|
|
183
187
|
|
{openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/migrations/0010_scope_external_key.py
RENAMED
|
@@ -4,15 +4,14 @@ from django.db import migrations, models
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class Migration(migrations.Migration):
|
|
7
|
-
|
|
8
7
|
dependencies = [
|
|
9
|
-
(
|
|
8
|
+
("openedx_authz", "0009_roleassignmentaudit"),
|
|
10
9
|
]
|
|
11
10
|
|
|
12
11
|
operations = [
|
|
13
12
|
migrations.AddField(
|
|
14
|
-
model_name=
|
|
15
|
-
name=
|
|
13
|
+
model_name="scope",
|
|
14
|
+
name="external_key",
|
|
16
15
|
field=models.CharField(blank=True, max_length=255, null=True, unique=True),
|
|
17
16
|
),
|
|
18
17
|
]
|
|
@@ -301,9 +301,7 @@ class Migration(migrations.Migration):
|
|
|
301
301
|
),
|
|
302
302
|
migrations.AddConstraint(
|
|
303
303
|
model_name="authzschemasource",
|
|
304
|
-
constraint=models.UniqueConstraint(
|
|
305
|
-
fields=["distribution", "module"], name="authz_source_dist_module_uniq"
|
|
306
|
-
),
|
|
304
|
+
constraint=models.UniqueConstraint(fields=["distribution", "module"], name="authz_source_dist_module_uniq"),
|
|
307
305
|
),
|
|
308
306
|
migrations.AddConstraint(
|
|
309
307
|
model_name="authzpermissiondefinition",
|
|
@@ -321,9 +319,7 @@ class Migration(migrations.Migration):
|
|
|
321
319
|
),
|
|
322
320
|
migrations.AddConstraint(
|
|
323
321
|
model_name="authzpermissionsource",
|
|
324
|
-
constraint=models.UniqueConstraint(
|
|
325
|
-
fields=["permission", "source"], name="authz_permission_source_uniq"
|
|
326
|
-
),
|
|
322
|
+
constraint=models.UniqueConstraint(fields=["permission", "source"], name="authz_permission_source_uniq"),
|
|
327
323
|
),
|
|
328
324
|
migrations.AddConstraint(
|
|
329
325
|
model_name="authzrolesource",
|
|
@@ -99,10 +99,3 @@ class SerializedAssignment(TypedDict, total=False):
|
|
|
99
99
|
scope: str
|
|
100
100
|
scope_display_name: str
|
|
101
101
|
permission_count: int
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
DEPRECATED_SCOPE_TYPE_ALIASES = {
|
|
105
|
-
"course": ScopesTypeField.COURSE,
|
|
106
|
-
"library": ScopesTypeField.LIBRARY,
|
|
107
|
-
}
|
|
108
|
-
"""Short names that ``GET /api/authz/v1/scopes/`` still accepts until the Admin Console migrates."""
|
|
@@ -7,7 +7,6 @@ from rest_framework import serializers
|
|
|
7
7
|
from openedx_authz import api
|
|
8
8
|
from openedx_authz.api.data import UserAssignments
|
|
9
9
|
from openedx_authz.rest_api.data import (
|
|
10
|
-
DEPRECATED_SCOPE_TYPE_ALIASES,
|
|
11
10
|
AssignmentSortField,
|
|
12
11
|
ScopesTypeField,
|
|
13
12
|
UserAssignmentSortField,
|
|
@@ -26,19 +25,11 @@ class OrgMixin(serializers.Serializer): # pylint: disable=abstract-method
|
|
|
26
25
|
org = serializers.CharField(required=False, max_length=255)
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
class ScopeTypeAliasField(serializers.ChoiceField):
|
|
30
|
-
"""Scope type choice that also accepts the deprecated short names (``course``, ``library``)."""
|
|
31
|
-
|
|
32
|
-
def to_internal_value(self, data):
|
|
33
|
-
"""Map a deprecated short name to its scope type before validating the choice."""
|
|
34
|
-
return super().to_internal_value(DEPRECATED_SCOPE_TYPE_ALIASES.get(data, data))
|
|
35
|
-
|
|
36
|
-
|
|
37
28
|
class ListScopesQuerySerializer(OrgMixin): # pylint: disable=abstract-method
|
|
38
29
|
"""Serializer for validating query parameters in ScopesAPIView."""
|
|
39
30
|
|
|
40
31
|
management_permission_only = serializers.BooleanField(required=False, default=False)
|
|
41
|
-
scope_type =
|
|
32
|
+
scope_type = serializers.ChoiceField(
|
|
42
33
|
choices=[(e.value, e.name) for e in ScopesTypeField], required=False, default=None, allow_null=True
|
|
43
34
|
)
|
|
44
35
|
search = serializers.CharField(required=False, default="", allow_blank=True)
|
{openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/admin_console/views.py
RENAMED
|
@@ -210,7 +210,7 @@ class AdminConsoleOrgsAPIView(generics.ListAPIView):
|
|
|
210
210
|
apidocs.query_parameter(
|
|
211
211
|
"scope_type",
|
|
212
212
|
str,
|
|
213
|
-
description="Filter by scope type. Either 'course' or '
|
|
213
|
+
description="Filter by scope type. Either 'course-v1' or 'lib'. Returns both if not specified.",
|
|
214
214
|
),
|
|
215
215
|
],
|
|
216
216
|
responses={
|
|
@@ -122,11 +122,7 @@ class CourseAuthoringVisibilityFilter(PipelineStep, Generic[AuthorizationItems])
|
|
|
122
122
|
Returns:
|
|
123
123
|
set[str]: Scope keys hidden by the flag.
|
|
124
124
|
"""
|
|
125
|
-
return {
|
|
126
|
-
scope
|
|
127
|
-
for scope in scopes
|
|
128
|
-
if scope and not is_scope_visible(api.ScopeData(external_key=scope))
|
|
129
|
-
}
|
|
125
|
+
return {scope for scope in scopes if scope and not is_scope_visible(api.ScopeData(external_key=scope))}
|
|
130
126
|
|
|
131
127
|
@staticmethod
|
|
132
128
|
def _role_change_errors(user_identifiers: list[str], hidden_scopes: Iterable[str]) -> list[dict]:
|
|
@@ -186,8 +182,7 @@ class CourseAuthoringPermissionValidationFilter(CourseAuthoringVisibilityFilter[
|
|
|
186
182
|
"""
|
|
187
183
|
hidden = self._hidden_scopes(item.get("scope") for item in items)
|
|
188
184
|
filtered: list[ValidationItem] = [
|
|
189
|
-
{**item, "allowed": False} if item.get("scope") in hidden else item
|
|
190
|
-
for item in items
|
|
185
|
+
{**item, "allowed": False} if item.get("scope") in hidden else item for item in items
|
|
191
186
|
]
|
|
192
187
|
return filtered, []
|
|
193
188
|
|
{openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/rest_api/v1/course_authoring/views.py
RENAMED
|
@@ -46,6 +46,6 @@ class WaffleFlagStatesAPIView(APIView):
|
|
|
46
46
|
try:
|
|
47
47
|
data = get_waffle_flag_states()
|
|
48
48
|
return Response(data, status=status.HTTP_200_OK)
|
|
49
|
-
except Exception as e:
|
|
49
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
50
50
|
logger.exception("Error getting waffle flag states: %s", e)
|
|
51
51
|
return Response({"message": "error"}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
|
@@ -1057,9 +1057,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1057
1057
|
[
|
|
1058
1058
|
RoleAssignmentData(
|
|
1059
1059
|
subject=SubjectData(external_key="alice"),
|
|
1060
|
-
roles=[
|
|
1061
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
1062
|
-
],
|
|
1060
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
1063
1061
|
scope=ScopeData(external_key="lib:Org1:math_101"),
|
|
1064
1062
|
)
|
|
1065
1063
|
],
|
|
@@ -1069,9 +1067,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1069
1067
|
[
|
|
1070
1068
|
RoleAssignmentData(
|
|
1071
1069
|
subject=SubjectData(external_key="bob"),
|
|
1072
|
-
roles=[
|
|
1073
|
-
RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)
|
|
1074
|
-
],
|
|
1070
|
+
roles=[RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)],
|
|
1075
1071
|
scope=ScopeData(external_key="lib:Org1:history_201"),
|
|
1076
1072
|
)
|
|
1077
1073
|
],
|
|
@@ -1081,9 +1077,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1081
1077
|
[
|
|
1082
1078
|
RoleAssignmentData(
|
|
1083
1079
|
subject=SubjectData(external_key="carol"),
|
|
1084
|
-
roles=[
|
|
1085
|
-
RoleData(external_key=roles.LIBRARY_CONTRIBUTOR.external_key)
|
|
1086
|
-
],
|
|
1080
|
+
roles=[RoleData(external_key=roles.LIBRARY_CONTRIBUTOR.external_key)],
|
|
1087
1081
|
scope=ScopeData(external_key="lib:Org1:science_301"),
|
|
1088
1082
|
)
|
|
1089
1083
|
],
|
|
@@ -1093,9 +1087,7 @@ class TestRoleAssignmentAPI(RolesTestSetupMixin):
|
|
|
1093
1087
|
[
|
|
1094
1088
|
RoleAssignmentData(
|
|
1095
1089
|
subject=SubjectData(external_key="dave"),
|
|
1096
|
-
roles=[
|
|
1097
|
-
RoleData(external_key=roles.LIBRARY_USER.external_key)
|
|
1098
|
-
],
|
|
1090
|
+
roles=[RoleData(external_key=roles.LIBRARY_USER.external_key)],
|
|
1099
1091
|
scope=ScopeData(external_key="lib:Org1:english_101"),
|
|
1100
1092
|
)
|
|
1101
1093
|
],
|
|
@@ -266,9 +266,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
266
266
|
[
|
|
267
267
|
RoleAssignmentData(
|
|
268
268
|
subject=UserData(external_key="alice"),
|
|
269
|
-
roles=[
|
|
270
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
271
|
-
],
|
|
269
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
272
270
|
scope=ContentLibraryData(external_key="lib:Org1:math_101"),
|
|
273
271
|
),
|
|
274
272
|
],
|
|
@@ -278,9 +276,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
278
276
|
[
|
|
279
277
|
RoleAssignmentData(
|
|
280
278
|
subject=UserData(external_key="bob"),
|
|
281
|
-
roles=[
|
|
282
|
-
RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)
|
|
283
|
-
],
|
|
279
|
+
roles=[RoleData(external_key=roles.LIBRARY_AUTHOR.external_key)],
|
|
284
280
|
scope=ContentLibraryData(external_key="lib:Org1:history_201"),
|
|
285
281
|
),
|
|
286
282
|
],
|
|
@@ -290,9 +286,7 @@ class TestUserRoleAssignments(UserAssignmentsSetupMixin):
|
|
|
290
286
|
[
|
|
291
287
|
RoleAssignmentData(
|
|
292
288
|
subject=UserData(external_key="eve"),
|
|
293
|
-
roles=[
|
|
294
|
-
RoleData(external_key=roles.LIBRARY_ADMIN.external_key)
|
|
295
|
-
],
|
|
289
|
+
roles=[RoleData(external_key=roles.LIBRARY_ADMIN.external_key)],
|
|
296
290
|
scope=ContentLibraryData(external_key="lib:Org2:physics_401"),
|
|
297
291
|
),
|
|
298
292
|
],
|
|
@@ -66,9 +66,7 @@ class TestBuiltinAppletDefinitions:
|
|
|
66
66
|
"""Compiled definitions expose their owning applet through source metadata."""
|
|
67
67
|
compiled = SchemaPipeline().compile()
|
|
68
68
|
|
|
69
|
-
assert compiled.roles["library_admin"].sources[0].module == (
|
|
70
|
-
"openedx_authz.applets.content_libraries.schema"
|
|
71
|
-
)
|
|
69
|
+
assert compiled.roles["library_admin"].sources[0].module == ("openedx_authz.applets.content_libraries.schema")
|
|
72
70
|
assert compiled.roles["course_admin"].sources[0].module == "openedx_authz.applets.course_team_roles.schema"
|
|
73
71
|
assert compiled.permissions["courses.view_course"].sources[0].module == (
|
|
74
72
|
"openedx_authz.applets.course_authoring.schema"
|
|
@@ -42,9 +42,14 @@ class TestInstructorDashboardPermissions(BaseRolesTestCase):
|
|
|
42
42
|
assign_role_to_user_in_scope("dashboard_admin", roles.COURSE_ADMIN.external_key, COURSE_KEY)
|
|
43
43
|
assign_role_to_user_in_scope("dashboard_staff", roles.COURSE_STAFF.external_key, COURSE_KEY)
|
|
44
44
|
|
|
45
|
-
@data(
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
@data(
|
|
46
|
+
*(
|
|
47
|
+
(username, permission, expected)
|
|
48
|
+
for (username, expected), permission in product(
|
|
49
|
+
USERS_WITH_EXPECTED_ACCESS, INSTRUCTOR_DASHBOARD_PERMISSIONS
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
)
|
|
48
53
|
@unpack
|
|
49
54
|
def test_course_team_roles_are_allowed_new_permissions(self, username, permission, expected_result):
|
|
50
55
|
"""Course Admin and Course Staff are allowed every new permission, and a user without a role is denied."""
|
|
@@ -38,6 +38,7 @@ COURSE_ORG1_GLOB = OrgCourseOverviewGlobData.build_external_key("Org1")
|
|
|
38
38
|
PLATFORM_COURSE_GLOB = PlatformCourseOverviewGlobData.build_external_key()
|
|
39
39
|
PLATFORM_LIBRARY_GLOB = PlatformContentLibraryGlobData.build_external_key()
|
|
40
40
|
|
|
41
|
+
|
|
41
42
|
@ddt
|
|
42
43
|
class TestScopesAPIView(ViewTestMixin):
|
|
43
44
|
"""
|
|
@@ -197,16 +198,10 @@ class TestScopesAPIView(ViewTestMixin):
|
|
|
197
198
|
@data(
|
|
198
199
|
("course-v1", "_get_courses_queryset", "_get_libraries_queryset"),
|
|
199
200
|
("lib", "_get_libraries_queryset", "_get_courses_queryset"),
|
|
200
|
-
# Deprecated aliases
|
|
201
|
-
("course", "_get_courses_queryset", "_get_libraries_queryset"),
|
|
202
|
-
("library", "_get_libraries_queryset", "_get_courses_queryset"),
|
|
203
201
|
)
|
|
204
202
|
@unpack
|
|
205
203
|
def test_type_param_calls_only_expected_queryset(self, scope_type, called_method, skipped_method):
|
|
206
|
-
"""When type=course-v1 only courses are fetched; when type=lib only libraries.
|
|
207
|
-
|
|
208
|
-
The deprecated aliases ``course`` and ``library`` behave the same.
|
|
209
|
-
"""
|
|
204
|
+
"""When type=course-v1 only courses are fetched; when type=lib only libraries."""
|
|
210
205
|
self.build_qs_patcher.stop()
|
|
211
206
|
with (
|
|
212
207
|
patch.object(ScopesAPIView, called_method, return_value=[]) as mock_called,
|
|
@@ -220,9 +215,10 @@ class TestScopesAPIView(ViewTestMixin):
|
|
|
220
215
|
mock_called.assert_called_once()
|
|
221
216
|
mock_skipped.assert_not_called()
|
|
222
217
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
@data("invalid", "course", "library")
|
|
219
|
+
def test_type_param_invalid_returns_400(self, scope_type):
|
|
220
|
+
"""An invalid type value, including the removed ``course`` and ``library`` aliases, returns 400."""
|
|
221
|
+
response = self.client.get(self.url, {"scope_type": scope_type})
|
|
226
222
|
|
|
227
223
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
|
228
224
|
|
|
@@ -399,7 +395,7 @@ class TestScopesAPIView(ViewTestMixin):
|
|
|
399
395
|
self.client.force_authenticate(user=user)
|
|
400
396
|
self.build_qs_patcher.stop()
|
|
401
397
|
|
|
402
|
-
response = self.client.get(self.url, {"scope_type": "course", "management_permission_only": "true"})
|
|
398
|
+
response = self.client.get(self.url, {"scope_type": "course-v1", "management_permission_only": "true"})
|
|
403
399
|
|
|
404
400
|
self.build_qs_patcher.start()
|
|
405
401
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
|
@@ -415,7 +411,7 @@ class TestScopesAPIView(ViewTestMixin):
|
|
|
415
411
|
self.client.force_authenticate(user=user)
|
|
416
412
|
self.build_qs_patcher.stop()
|
|
417
413
|
|
|
418
|
-
response = self.client.get(self.url, {"scope_type": "
|
|
414
|
+
response = self.client.get(self.url, {"scope_type": "lib", "management_permission_only": "true"})
|
|
419
415
|
|
|
420
416
|
self.build_qs_patcher.start()
|
|
421
417
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
|
@@ -127,9 +127,7 @@ class TestCourseAuthoringPermissionValidationFilter(TestCase):
|
|
|
127
127
|
with patch(
|
|
128
128
|
"openedx_authz.rest_api.v1.course_authoring.pipeline.enable_authz_course_authoring", return_value=False
|
|
129
129
|
):
|
|
130
|
-
result = CourseAuthoringPermissionValidationFilter(
|
|
131
|
-
filter_type="test", running_pipeline=[]
|
|
132
|
-
).run_filter(
|
|
130
|
+
result = CourseAuthoringPermissionValidationFilter(filter_type="test", running_pipeline=[]).run_filter(
|
|
133
131
|
items=items, errors=[]
|
|
134
132
|
)
|
|
135
133
|
|
|
@@ -152,9 +150,7 @@ class TestCourseAuthoringPermissionValidationFilter(TestCase):
|
|
|
152
150
|
with patch(
|
|
153
151
|
"openedx_authz.rest_api.v1.course_authoring.pipeline.enable_authz_course_authoring", return_value=False
|
|
154
152
|
):
|
|
155
|
-
result = CourseAuthoringPermissionValidationFilter(
|
|
156
|
-
filter_type="test", running_pipeline=[]
|
|
157
|
-
).run_filter(
|
|
153
|
+
result = CourseAuthoringPermissionValidationFilter(filter_type="test", running_pipeline=[]).run_filter(
|
|
158
154
|
items=items, errors=[]
|
|
159
155
|
)
|
|
160
156
|
|
|
@@ -172,11 +168,14 @@ class TestCourseAuthoringPermissionValidationFilter(TestCase):
|
|
|
172
168
|
)
|
|
173
169
|
|
|
174
170
|
self.assertEqual(result["items"], {**items, "scopes": [LIB_SCOPE]})
|
|
175
|
-
self.assertEqual(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
self.assertEqual(
|
|
172
|
+
result["errors"],
|
|
173
|
+
[
|
|
174
|
+
{"error": "previous_step"},
|
|
175
|
+
{"user_identifier": "alice", "scope": COURSE_SCOPE, "error": "scope_not_available"},
|
|
176
|
+
{"user_identifier": "bob", "scope": COURSE_SCOPE, "error": "scope_not_available"},
|
|
177
|
+
],
|
|
178
|
+
)
|
|
180
179
|
self.assertEqual(previous_errors, [{"error": "previous_step"}])
|
|
181
180
|
self.assertEqual(items["scopes"], [COURSE_SCOPE, LIB_SCOPE])
|
|
182
181
|
|
|
@@ -191,9 +190,12 @@ class TestCourseAuthoringPermissionValidationFilter(TestCase):
|
|
|
191
190
|
)
|
|
192
191
|
|
|
193
192
|
self.assertEqual(result["items"], {**items, "users": []})
|
|
194
|
-
self.assertEqual(
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
self.assertEqual(
|
|
194
|
+
result["errors"],
|
|
195
|
+
[
|
|
196
|
+
{"user_identifier": "alice", "scope": COURSE_SCOPE, "error": "scope_not_available"},
|
|
197
|
+
],
|
|
198
|
+
)
|
|
197
199
|
|
|
198
200
|
@data(
|
|
199
201
|
(PermissionValidationRequested, [{"action": "view", "allowed": True}]),
|
|
@@ -28,9 +28,7 @@ class TestWaffleFlagStatesAPIView(ViewTestMixin):
|
|
|
28
28
|
"org_overrides": {"on": ["Org1"], "off": []},
|
|
29
29
|
"course_overrides": {"on": [], "off": ["course-v1:Org1+COURSE1+2024"]},
|
|
30
30
|
}
|
|
31
|
-
with patch(
|
|
32
|
-
"openedx_authz.rest_api.v1.course_authoring.views.get_waffle_flag_states", return_value=flag_states
|
|
33
|
-
):
|
|
31
|
+
with patch("openedx_authz.rest_api.v1.course_authoring.views.get_waffle_flag_states", return_value=flag_states):
|
|
34
32
|
response = self.client.get(self.url)
|
|
35
33
|
|
|
36
34
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
|
@@ -852,9 +852,7 @@ class TestRoleUserAPIView(ViewTestMixin):
|
|
|
852
852
|
"""
|
|
853
853
|
other = "regular_5" if role == roles.LIBRARY_ADMIN.external_key else "regular_2"
|
|
854
854
|
if role == roles.COURSE_ADMIN.external_key:
|
|
855
|
-
self._assign_roles_to_users(
|
|
856
|
-
assignments=[{"subject_name": other, "role_name": role, "scope_name": scope}]
|
|
857
|
-
)
|
|
855
|
+
self._assign_roles_to_users(assignments=[{"subject_name": other, "role_name": role, "scope_name": scope}])
|
|
858
856
|
user = User.objects.get(username=username)
|
|
859
857
|
self.client.force_authenticate(user=user)
|
|
860
858
|
query_params = {"role": role, "scope": scope, "users": f"{identifier},{other}"}
|
{openedx_authz-3.2.0 → openedx_authz-4.0.0}/src/openedx_authz/tests/schema/test_discovery.py
RENAMED
|
@@ -94,11 +94,7 @@ class TestDirectoryExpansion:
|
|
|
94
94
|
def test_duplicate_directories_are_deduplicated(self):
|
|
95
95
|
"""The same directory passed twice yields each file only once."""
|
|
96
96
|
resources = SchemaDiscovery(passed_in_directories=[SCHEMA_DIR, SCHEMA_DIR]).discover()
|
|
97
|
-
content_library_paths = [
|
|
98
|
-
resource.resource_path
|
|
99
|
-
for resource in resources
|
|
100
|
-
if resource.module == SCHEMA_MODULE
|
|
101
|
-
]
|
|
97
|
+
content_library_paths = [resource.resource_path for resource in resources if resource.module == SCHEMA_MODULE]
|
|
102
98
|
assert len(content_library_paths) == len(set(content_library_paths)) == len(EXPECTED_FILES)
|
|
103
99
|
|
|
104
100
|
|
|
@@ -695,12 +695,7 @@ role_extensions:
|
|
|
695
695
|
|
|
696
696
|
def test_empty_document_between_separators_is_skipped(self):
|
|
697
697
|
"""An empty ``---`` block between contributions is silently dropped."""
|
|
698
|
-
contents =
|
|
699
|
-
b"schema_version: '1.0'\npriority: 1\n"
|
|
700
|
-
b"---\n"
|
|
701
|
-
b"---\n"
|
|
702
|
-
b"schema_version: '1.0'\npriority: 2\n"
|
|
703
|
-
)
|
|
698
|
+
contents = b"schema_version: '1.0'\npriority: 1\n" b"---\n" b"---\n" b"schema_version: '1.0'\npriority: 2\n"
|
|
704
699
|
|
|
705
700
|
docs = _load(contents)
|
|
706
701
|
|