Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 18, 2025

Changes from v0.17.1 to 0.19.0:

  • Handle cache invalidation via a uuid in the database to ensure policy reloads
    occur only when necessary.

  • Migration to transfer legacy permissions from ContentLibraryPermission to the new Casbin-based authorization model.

More info: https://github.com/openedx/openedx-authz/blob/main/CHANGELOG.rst

Those changes add five more queries to retrieve permissions for tags and taxonomies, so I changed test_object_tags_query_count and test_list_taxonomy_query_count, respectively. The queries added are the following:

  1. SELECT "openedx_authz_policycachecontrol"."id", "openedx_authz_policycachecontrol"."version" FROM "openedx_authz_policycachecontrol" WHERE "openedx_authz_policycachecontrol"."id" = 1 LIMIT 21
  2. SAVEPOINT "s131104883403648_x24"
  3. INSERT INTO "openedx_authz_policycachecontrol" ("id", "version") VALUES (1, 'd6bac3280fd64a9eb593cd50fa388baf') RETURNING "openedx_authz_policycachecontrol"."id"
  4. RELEASE SAVEPOINT "s131104883403648_x24"
  5. SELECT "casbin_rule"."id", "casbin_rule"."ptype", "casbin_rule"."v0", "casbin_rule"."v1", "casbin_rule"."v2", "casbin_rule"."v3", "casbin_rule"."v4", "casbin_rule"."v5" FROM "casbin_rule"

@github-actions github-actions bot requested a review from MaferMazu November 18, 2025 20:14
@MaferMazu MaferMazu changed the title feat: Upgrade Python dependency openedx-authz [FC-0099] feat: Upgrade Python dependency openedx-authz Nov 18, 2025
@MaferMazu MaferMazu force-pushed the MaferMazu/upgrade-openedx-authz-1a7d985 branch 2 times, most recently from 27baa39 to 07b5525 Compare November 19, 2025 16:40
@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Nov 19, 2025

@MaferMazu: do you have the diff between the queries executed before and after this change? If those make sense, we can merge this as is and document why the query count increased. Thank you so much!

@mariajgrimaldi mariajgrimaldi requested review from mariajgrimaldi and removed request for MaferMazu November 19, 2025 16:47
@MaferMazu
Copy link
Contributor

Yes, @mariajgrimaldi, I just added them to the cover, but the difference is those 5 queries:

  1. SELECT "openedx_authz_policycachecontrol"."id", "openedx_authz_policycachecontrol"."version" FROM "openedx_authz_policycachecontrol" WHERE "openedx_authz_policycachecontrol"."id" = 1 LIMIT 21
  2. SAVEPOINT "s131104883403648_x24"
  3. INSERT INTO "openedx_authz_policycachecontrol" ("id", "version") VALUES (1, 'd6bac3280fd64a9eb593cd50fa388baf') RETURNING "openedx_authz_policycachecontrol"."id"
  4. RELEASE SAVEPOINT "s131104883403648_x24"
  5. SELECT "casbin_rule"."id", "casbin_rule"."ptype", "casbin_rule"."v0", "casbin_rule"."v1", "casbin_rule"."v2", "casbin_rule"."v3", "casbin_rule"."v4", "casbin_rule"."v5" FROM "casbin_rule"

MaferMazu and others added 2 commits November 19, 2025 13:58
handle cache invalidation

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
@MaferMazu MaferMazu force-pushed the MaferMazu/upgrade-openedx-authz-1a7d985 branch from 07b5525 to 92a91f2 Compare November 19, 2025 18:58
@MaferMazu MaferMazu merged commit 122b4e0 into master Nov 19, 2025
53 checks passed
@MaferMazu MaferMazu deleted the MaferMazu/upgrade-openedx-authz-1a7d985 branch November 19, 2025 19:34
MaferMazu added a commit to eduNEXT/edx-platform that referenced this pull request Nov 19, 2025
* feat: Upgrade Python dependency openedx-authz

handle cache invalidation

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

* fix: update the num of queries in tests

---------

Co-authored-by: MaferMazu <[email protected]>
Co-authored-by: Maria Fernanda Magallanes Zubillaga <[email protected]>
(cherry picked from commit 122b4e0)
MaferMazu added a commit to eduNEXT/edx-platform that referenced this pull request Nov 19, 2025
* feat: Upgrade Python dependency openedx-authz

handle cache invalidation

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

* fix: update the num of queries in tests

---------

Co-authored-by: MaferMazu <[email protected]>
Co-authored-by: Maria Fernanda Magallanes Zubillaga <[email protected]>
(cherry picked from commit 122b4e0)
mariajgrimaldi added a commit that referenced this pull request Nov 20, 2025
…cement points (#37633)

* feat: filter libraries based on user-role scopes (#37564)

(cherry picked from commit 6c6fc5d)

* feat: add openedx-authz to user_can_create_library and require_permission_for_library_key (#37501)

* feat: add the authz check to the library api function

feat: add the authz publish check in rest_api blocks and containers

feat: add the authz checks in libraries and refactor

feat: add collections checks

feat: update enforcement in serializer file

refactor: refactor the permission check functions

fix: fix value error

fix: calling the queries twice

* test: add structure for test and apply feedback

refactor: refactor the tests and apply feedback

fix: apply feedback

Revert "refactor: refactor the tests and apply feedback"

This reverts commit aa0bd52.

refactor: use constants and avoid mapping

test: fix the test to have them in order

docs: about we rely on bridgekeeper and the old check for two cases

docs: update openedx/core/djangoapps/content_libraries/api/libraries.py

Co-authored-by: Maria Grimaldi (Majo) <[email protected]>

refactor: use global scope wildcard instead of *

refactor: allow receiving PermissionData objects

refactor: do not inherit from BaseRolesTestCase to favor CL setup methods

If both BaseRolesTestCase and ContentLibrariesRestApiTest define a method
with the same name (e.g., setUp()), Python will use the one found first
in the MRO, which is the one in BaseRolesTestCase because it is
listed first in the class definition leading to unexpected behavior.

refactor: remove unnecessary imports and indent

* chore: bump openedx-authz version

(cherry picked from commit f4f14a6)

* feat: Upgrade Python dependency openedx-authz (#37652)

* feat: Upgrade Python dependency openedx-authz

handle cache invalidation

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

* fix: update the num of queries in tests

---------

Co-authored-by: MaferMazu <[email protected]>
Co-authored-by: Maria Fernanda Magallanes Zubillaga <[email protected]>
(cherry picked from commit 122b4e0)

* chore: update requirements to fix the inconsistency

---------

Co-authored-by: Maria Grimaldi (Majo) <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants