From b466a774e654893b8bb931d3c6ec9da5aebe3ce2 Mon Sep 17 00:00:00 2001 From: Alexander <42068202+ale8k@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:52:23 +0100 Subject: [PATCH] Move rebac admin to jimmhttp (#1409) --- cmd/jimmsrv/service/service.go | 2 +- internal/{ => jimmhttp}/rebac_admin/backend.go | 0 internal/{ => jimmhttp}/rebac_admin/capabilities.go | 0 internal/{ => jimmhttp}/rebac_admin/capabilities_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/entitlements.go | 0 internal/{ => jimmhttp}/rebac_admin/export_test.go | 0 internal/{ => jimmhttp}/rebac_admin/groups.go | 2 +- internal/{ => jimmhttp}/rebac_admin/groups_integration_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/groups_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/identities.go | 2 +- .../{ => jimmhttp}/rebac_admin/identities_integration_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/identities_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/package_test.go | 0 internal/{ => jimmhttp}/rebac_admin/resources.go | 2 +- .../{ => jimmhttp}/rebac_admin/resources_integration_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/resources_test.go | 2 +- internal/{ => jimmhttp}/rebac_admin/utils/auth.go | 0 internal/{ => jimmhttp}/rebac_admin/utils/errors.go | 0 internal/{ => jimmhttp}/rebac_admin/utils/types.go | 0 internal/{ => jimmhttp}/rebac_admin/utils/utils.go | 0 20 files changed, 11 insertions(+), 11 deletions(-) rename internal/{ => jimmhttp}/rebac_admin/backend.go (100%) rename internal/{ => jimmhttp}/rebac_admin/capabilities.go (100%) rename internal/{ => jimmhttp}/rebac_admin/capabilities_test.go (96%) rename internal/{ => jimmhttp}/rebac_admin/entitlements.go (100%) rename internal/{ => jimmhttp}/rebac_admin/export_test.go (100%) rename internal/{ => jimmhttp}/rebac_admin/groups.go (99%) rename internal/{ => jimmhttp}/rebac_admin/groups_integration_test.go (99%) rename internal/{ => jimmhttp}/rebac_admin/groups_test.go (99%) rename internal/{ => jimmhttp}/rebac_admin/identities.go (99%) rename internal/{ => jimmhttp}/rebac_admin/identities_integration_test.go (99%) rename internal/{ => jimmhttp}/rebac_admin/identities_test.go (99%) rename internal/{ => jimmhttp}/rebac_admin/package_test.go (100%) rename internal/{ => jimmhttp}/rebac_admin/resources.go (97%) rename internal/{ => jimmhttp}/rebac_admin/resources_integration_test.go (98%) rename internal/{ => jimmhttp}/rebac_admin/resources_test.go (97%) rename internal/{ => jimmhttp}/rebac_admin/utils/auth.go (100%) rename internal/{ => jimmhttp}/rebac_admin/utils/errors.go (100%) rename internal/{ => jimmhttp}/rebac_admin/utils/types.go (100%) rename internal/{ => jimmhttp}/rebac_admin/utils/utils.go (100%) diff --git a/cmd/jimmsrv/service/service.go b/cmd/jimmsrv/service/service.go index 4c9042a4e..af18249de 100644 --- a/cmd/jimmsrv/service/service.go +++ b/cmd/jimmsrv/service/service.go @@ -32,6 +32,7 @@ import ( "github.com/canonical/jimm/v3/internal/jimm" jimmcreds "github.com/canonical/jimm/v3/internal/jimm/credentials" "github.com/canonical/jimm/v3/internal/jimmhttp" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/jimmjwx" "github.com/canonical/jimm/v3/internal/jujuapi" "github.com/canonical/jimm/v3/internal/jujuclient" @@ -40,7 +41,6 @@ import ( "github.com/canonical/jimm/v3/internal/openfga" ofganames "github.com/canonical/jimm/v3/internal/openfga/names" "github.com/canonical/jimm/v3/internal/pubsub" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/vault" ) diff --git a/internal/rebac_admin/backend.go b/internal/jimmhttp/rebac_admin/backend.go similarity index 100% rename from internal/rebac_admin/backend.go rename to internal/jimmhttp/rebac_admin/backend.go diff --git a/internal/rebac_admin/capabilities.go b/internal/jimmhttp/rebac_admin/capabilities.go similarity index 100% rename from internal/rebac_admin/capabilities.go rename to internal/jimmhttp/rebac_admin/capabilities.go diff --git a/internal/rebac_admin/capabilities_test.go b/internal/jimmhttp/rebac_admin/capabilities_test.go similarity index 96% rename from internal/rebac_admin/capabilities_test.go rename to internal/jimmhttp/rebac_admin/capabilities_test.go index 66e23d703..e304ea1ed 100644 --- a/internal/rebac_admin/capabilities_test.go +++ b/internal/jimmhttp/rebac_admin/capabilities_test.go @@ -11,7 +11,7 @@ import ( qt "github.com/frankban/quicktest" - "github.com/canonical/jimm/v3/internal/rebac_admin" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" ) diff --git a/internal/rebac_admin/entitlements.go b/internal/jimmhttp/rebac_admin/entitlements.go similarity index 100% rename from internal/rebac_admin/entitlements.go rename to internal/jimmhttp/rebac_admin/entitlements.go diff --git a/internal/rebac_admin/export_test.go b/internal/jimmhttp/rebac_admin/export_test.go similarity index 100% rename from internal/rebac_admin/export_test.go rename to internal/jimmhttp/rebac_admin/export_test.go diff --git a/internal/rebac_admin/groups.go b/internal/jimmhttp/rebac_admin/groups.go similarity index 99% rename from internal/rebac_admin/groups.go rename to internal/jimmhttp/rebac_admin/groups.go index 70fbc1772..5ed505bde 100644 --- a/internal/rebac_admin/groups.go +++ b/internal/jimmhttp/rebac_admin/groups.go @@ -12,9 +12,9 @@ import ( "github.com/canonical/jimm/v3/internal/common/pagination" "github.com/canonical/jimm/v3/internal/errors" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin/utils" "github.com/canonical/jimm/v3/internal/jujuapi" ofganames "github.com/canonical/jimm/v3/internal/openfga/names" - "github.com/canonical/jimm/v3/internal/rebac_admin/utils" apiparams "github.com/canonical/jimm/v3/pkg/api/params" jimmnames "github.com/canonical/jimm/v3/pkg/names" ) diff --git a/internal/rebac_admin/groups_integration_test.go b/internal/jimmhttp/rebac_admin/groups_integration_test.go similarity index 99% rename from internal/rebac_admin/groups_integration_test.go rename to internal/jimmhttp/rebac_admin/groups_integration_test.go index 49fb34375..b65194056 100644 --- a/internal/rebac_admin/groups_integration_test.go +++ b/internal/jimmhttp/rebac_admin/groups_integration_test.go @@ -11,9 +11,9 @@ import ( "github.com/juju/names/v5" gc "gopkg.in/check.v1" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/openfga" ofganames "github.com/canonical/jimm/v3/internal/openfga/names" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" jimmnames "github.com/canonical/jimm/v3/pkg/names" ) diff --git a/internal/rebac_admin/groups_test.go b/internal/jimmhttp/rebac_admin/groups_test.go similarity index 99% rename from internal/rebac_admin/groups_test.go rename to internal/jimmhttp/rebac_admin/groups_test.go index 03cf27d2b..87e3eb8a1 100644 --- a/internal/rebac_admin/groups_test.go +++ b/internal/jimmhttp/rebac_admin/groups_test.go @@ -15,8 +15,8 @@ import ( "github.com/canonical/jimm/v3/internal/common/pagination" "github.com/canonical/jimm/v3/internal/dbmodel" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/openfga" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" "github.com/canonical/jimm/v3/internal/testutils/jimmtest/mocks" "github.com/canonical/jimm/v3/pkg/api/params" diff --git a/internal/rebac_admin/identities.go b/internal/jimmhttp/rebac_admin/identities.go similarity index 99% rename from internal/rebac_admin/identities.go rename to internal/jimmhttp/rebac_admin/identities.go index 479c9b6a3..b726f53bc 100644 --- a/internal/rebac_admin/identities.go +++ b/internal/jimmhttp/rebac_admin/identities.go @@ -14,10 +14,10 @@ import ( "github.com/canonical/jimm/v3/internal/common/pagination" "github.com/canonical/jimm/v3/internal/errors" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin/utils" "github.com/canonical/jimm/v3/internal/jujuapi" "github.com/canonical/jimm/v3/internal/openfga" ofganames "github.com/canonical/jimm/v3/internal/openfga/names" - "github.com/canonical/jimm/v3/internal/rebac_admin/utils" apiparams "github.com/canonical/jimm/v3/pkg/api/params" ) diff --git a/internal/rebac_admin/identities_integration_test.go b/internal/jimmhttp/rebac_admin/identities_integration_test.go similarity index 99% rename from internal/rebac_admin/identities_integration_test.go rename to internal/jimmhttp/rebac_admin/identities_integration_test.go index 2b7eca6bb..4cf444f26 100644 --- a/internal/rebac_admin/identities_integration_test.go +++ b/internal/jimmhttp/rebac_admin/identities_integration_test.go @@ -10,9 +10,9 @@ import ( "github.com/juju/names/v5" gc "gopkg.in/check.v1" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/openfga" ofganames "github.com/canonical/jimm/v3/internal/openfga/names" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" "github.com/canonical/jimm/v3/pkg/api/params" jimmnames "github.com/canonical/jimm/v3/pkg/names" diff --git a/internal/rebac_admin/identities_test.go b/internal/jimmhttp/rebac_admin/identities_test.go similarity index 99% rename from internal/rebac_admin/identities_test.go rename to internal/jimmhttp/rebac_admin/identities_test.go index df57b027a..08dfcdb56 100644 --- a/internal/rebac_admin/identities_test.go +++ b/internal/jimmhttp/rebac_admin/identities_test.go @@ -16,8 +16,8 @@ import ( "github.com/canonical/jimm/v3/internal/common/utils" "github.com/canonical/jimm/v3/internal/dbmodel" jimmm_errors "github.com/canonical/jimm/v3/internal/errors" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/openfga" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" "github.com/canonical/jimm/v3/internal/testutils/jimmtest/mocks" "github.com/canonical/jimm/v3/pkg/api/params" diff --git a/internal/rebac_admin/package_test.go b/internal/jimmhttp/rebac_admin/package_test.go similarity index 100% rename from internal/rebac_admin/package_test.go rename to internal/jimmhttp/rebac_admin/package_test.go diff --git a/internal/rebac_admin/resources.go b/internal/jimmhttp/rebac_admin/resources.go similarity index 97% rename from internal/rebac_admin/resources.go rename to internal/jimmhttp/rebac_admin/resources.go index c458de762..0db979cf9 100644 --- a/internal/rebac_admin/resources.go +++ b/internal/jimmhttp/rebac_admin/resources.go @@ -11,8 +11,8 @@ import ( "github.com/canonical/jimm/v3/internal/common/pagination" "github.com/canonical/jimm/v3/internal/db" "github.com/canonical/jimm/v3/internal/errors" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin/utils" "github.com/canonical/jimm/v3/internal/jujuapi" - "github.com/canonical/jimm/v3/internal/rebac_admin/utils" ) type resourcesService struct { diff --git a/internal/rebac_admin/resources_integration_test.go b/internal/jimmhttp/rebac_admin/resources_integration_test.go similarity index 98% rename from internal/rebac_admin/resources_integration_test.go rename to internal/jimmhttp/rebac_admin/resources_integration_test.go index 23ef19b13..0d0dd2908 100644 --- a/internal/rebac_admin/resources_integration_test.go +++ b/internal/jimmhttp/rebac_admin/resources_integration_test.go @@ -10,7 +10,7 @@ import ( gc "gopkg.in/check.v1" "github.com/canonical/jimm/v3/internal/common/utils" - "github.com/canonical/jimm/v3/internal/rebac_admin" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" ) diff --git a/internal/rebac_admin/resources_test.go b/internal/jimmhttp/rebac_admin/resources_test.go similarity index 97% rename from internal/rebac_admin/resources_test.go rename to internal/jimmhttp/rebac_admin/resources_test.go index efbe051ea..00e54032d 100644 --- a/internal/rebac_admin/resources_test.go +++ b/internal/jimmhttp/rebac_admin/resources_test.go @@ -13,8 +13,8 @@ import ( "github.com/canonical/jimm/v3/internal/common/pagination" "github.com/canonical/jimm/v3/internal/common/utils" "github.com/canonical/jimm/v3/internal/db" + "github.com/canonical/jimm/v3/internal/jimmhttp/rebac_admin" "github.com/canonical/jimm/v3/internal/openfga" - "github.com/canonical/jimm/v3/internal/rebac_admin" "github.com/canonical/jimm/v3/internal/testutils/jimmtest" ) diff --git a/internal/rebac_admin/utils/auth.go b/internal/jimmhttp/rebac_admin/utils/auth.go similarity index 100% rename from internal/rebac_admin/utils/auth.go rename to internal/jimmhttp/rebac_admin/utils/auth.go diff --git a/internal/rebac_admin/utils/errors.go b/internal/jimmhttp/rebac_admin/utils/errors.go similarity index 100% rename from internal/rebac_admin/utils/errors.go rename to internal/jimmhttp/rebac_admin/utils/errors.go diff --git a/internal/rebac_admin/utils/types.go b/internal/jimmhttp/rebac_admin/utils/types.go similarity index 100% rename from internal/rebac_admin/utils/types.go rename to internal/jimmhttp/rebac_admin/utils/types.go diff --git a/internal/rebac_admin/utils/utils.go b/internal/jimmhttp/rebac_admin/utils/utils.go similarity index 100% rename from internal/rebac_admin/utils/utils.go rename to internal/jimmhttp/rebac_admin/utils/utils.go