use correct structure when ocis init

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-12-27 12:25:56 +01:00
parent 9676524070
commit ef3c214af6
3 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -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},
},
}

View File

@@ -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: