From ec730a797c07c3b5e83f81f1cf843ad2bf047170 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 27 Dec 2023 12:25:56 +0100 Subject: [PATCH 1/2] use correct structure when ocis init Signed-off-by: jkoberg --- changelog/unreleased/service-account-roles.md | 5 +++++ ocis/pkg/init/init.go | 4 ++-- services/settings/pkg/store/metadata/bundles.go | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/service-account-roles.md diff --git a/changelog/unreleased/service-account-roles.md b/changelog/unreleased/service-account-roles.md new file mode 100644 index 0000000000..6811a6065e --- /dev/null +++ b/changelog/unreleased/service-account-roles.md @@ -0,0 +1,5 @@ +Bugfix: Fix Service Account Roles on external IDP + +Service Account Roles wouldn't work when using with external IDP + +https://github.com/owncloud/ocis/pull/8074 diff --git a/ocis/pkg/init/init.go b/ocis/pkg/init/init.go index b35ab68292..32993ec0a4 100644 --- a/ocis/pkg/init/init.go +++ b/ocis/pkg/init/init.go @@ -74,7 +74,7 @@ type IdmService struct { } type SettingsService struct { - ServiceAccountIDAdmin string `yaml:"service_account_id_admin"` + ServiceAccountIDs []string `yaml:"service_account_ids"` } type FrontendService struct { @@ -400,7 +400,7 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin ServiceAccount: serviceAccount, }, Settings: SettingsService{ - ServiceAccountIDAdmin: serviceAccount.ServiceAccountID, + ServiceAccountIDs: []string{serviceAccount.ServiceAccountID}, }, } diff --git a/services/settings/pkg/store/metadata/bundles.go b/services/settings/pkg/store/metadata/bundles.go index 7e36572930..ff634e7cad 100644 --- a/services/settings/pkg/store/metadata/bundles.go +++ b/services/settings/pkg/store/metadata/bundles.go @@ -34,6 +34,10 @@ func (s *Store) ListBundles(bundleType settingsmsg.Bundle_Type, bundleIDs []stri } var bundles []*settingsmsg.Bundle for _, id := range bundleIDs { + if id == defaults.BundleUUIDServiceAccount { + bundles = append(bundles, defaults.ServiceAccountBundle()) + continue + } b, err := s.mdc.SimpleDownload(ctx, bundlePath(id)) switch err.(type) { case nil: From 3ccadad19419a27379c06f1b6a8db33d8feb0eff Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Wed, 27 Dec 2023 17:40:19 +0100 Subject: [PATCH 2/2] docs: correct changelog --- changelog/unreleased/service-account-roles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/service-account-roles.md b/changelog/unreleased/service-account-roles.md index 6811a6065e..e96a828a6e 100644 --- a/changelog/unreleased/service-account-roles.md +++ b/changelog/unreleased/service-account-roles.md @@ -2,4 +2,4 @@ Bugfix: Fix Service Account Roles on external IDP Service Account Roles wouldn't work when using with external IDP -https://github.com/owncloud/ocis/pull/8074 +https://github.com/owncloud/ocis/pull/8077