From 924149cdb711c510d2eb94c3d03f492977fac335 Mon Sep 17 00:00:00 2001 From: Novak Zaballa <41410593+novakzaballa@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:21:34 -0400 Subject: [PATCH] feat: Add new url for role master api keys (#3215) --- .github/workflows/api-deploy-production-ecs.yml | 2 +- .github/workflows/api-deploy-staging-ecs.yml | 2 +- .../workflows/api-tests-with-private-packages.yml | 2 +- ...platform-docker-publish-all-features-image.yml | 2 +- api/organisations/urls.py | 15 ++++++++++++++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/api-deploy-production-ecs.yml b/.github/workflows/api-deploy-production-ecs.yml index ee7c532e9ddc..e8cb9d46a2c0 100644 --- a/.github/workflows/api-deploy-production-ecs.yml +++ b/.github/workflows/api-deploy-production-ecs.yml @@ -39,7 +39,7 @@ jobs: flagsmith_saml_revision: v1.1.0 flagsmith_workflows_revision: v1.2.5 flagsmith_auth_controller_revision: v0.0.1 - flagsmith_rbac_revision: v0.6.0 + flagsmith_rbac_revision: v0.7.0 sse_pgp_private_key: ${{ secrets.SSE_PGP_PRIVATE_KEY }} - name: Deploy task processor to Production diff --git a/.github/workflows/api-deploy-staging-ecs.yml b/.github/workflows/api-deploy-staging-ecs.yml index 859ee4f68711..c69ae54259c1 100644 --- a/.github/workflows/api-deploy-staging-ecs.yml +++ b/.github/workflows/api-deploy-staging-ecs.yml @@ -40,7 +40,7 @@ jobs: flagsmith_saml_revision: v1.1.0 flagsmith_workflows_revision: v1.2.5 flagsmith_auth_controller_revision: v0.0.1 - flagsmith_rbac_revision: v0.6.0 + flagsmith_rbac_revision: v0.7.0 sse_pgp_private_key: ${{ secrets.SSE_PGP_PRIVATE_KEY }} - name: Deploy task processor to Staging diff --git a/.github/workflows/api-tests-with-private-packages.yml b/.github/workflows/api-tests-with-private-packages.yml index 8e39f838767c..8d551dfb6906 100644 --- a/.github/workflows/api-tests-with-private-packages.yml +++ b/.github/workflows/api-tests-with-private-packages.yml @@ -14,7 +14,7 @@ defaults: working-directory: api env: - FLAGSMITH_RBAC_REVISION: v0.6.0 + FLAGSMITH_RBAC_REVISION: v0.7.0 jobs: test: diff --git a/.github/workflows/platform-docker-publish-all-features-image.yml b/.github/workflows/platform-docker-publish-all-features-image.yml index be48e294390a..22b41487b96d 100644 --- a/.github/workflows/platform-docker-publish-all-features-image.yml +++ b/.github/workflows/platform-docker-publish-all-features-image.yml @@ -7,7 +7,7 @@ on: env: FLAGSMITH_SAML_REVISION: v1.1.0 - FLAGSMITH_RBAC_REVISION: v0.6.0 + FLAGSMITH_RBAC_REVISION: v0.7.0 FLAGSMITH_WORKFLOWS_REVISION: v1.2.5 FLAGSMITH_AUTH_CONTROLLER_REVISION: v0.0.1 diff --git a/api/organisations/urls.py b/api/organisations/urls.py index ac9a3a00e8cb..1640493483b6 100644 --- a/api/organisations/urls.py +++ b/api/organisations/urls.py @@ -103,20 +103,27 @@ RoleOrganisationPermissionViewSet, RoleProjectPermissionsViewSet, RolesByGroupViewSet, + RolesbyMasterAPIPrefixViewSet, RolesByUserViewSet, RoleViewSet, UserRoleViewSet, ) + organisations_router.register("roles", RoleViewSet, basename="organisation-roles") nested_user_roles_routes = routers.NestedSimpleRouter( parent_router=organisations_router, parent_prefix=r"users", lookup="user" ) + nested_api_key_roles_routes = routers.NestedSimpleRouter( + parent_router=organisations_router, + parent_prefix=r"master-api-keys", + lookup="api_key", + ) + nested_group_roles_routes = routers.NestedSimpleRouter( parent_router=organisations_router, parent_prefix=r"groups", lookup="group" ) - organisations_router.register("roles", RoleViewSet, basename="organisation-roles") nested_roles_router = routers.NestedSimpleRouter( organisations_router, r"roles", lookup="role" ) @@ -125,6 +132,11 @@ viewset=RolesByUserViewSet, basename="role-users", ) + nested_api_key_roles_routes.register( + prefix="roles", + viewset=RolesbyMasterAPIPrefixViewSet, + basename="role-api-keys", + ) nested_group_roles_routes.register( prefix="roles", viewset=RolesByGroupViewSet, @@ -155,6 +167,7 @@ url(r"^", include(organisations_router.urls)), url(r"^", include(nested_roles_router.urls)), url(r"^", include(nested_user_roles_routes.urls)), + url(r"^", include(nested_api_key_roles_routes.urls)), url(r"^", include(nested_group_roles_routes.urls)), ] )