Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ require (
github.com/go-micro/plugins/v4/wrapper/monitoring/prometheus v1.2.0
github.com/go-micro/plugins/v4/wrapper/trace/opentelemetry v1.2.0
github.com/go-playground/validator/v10 v10.28.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -230,6 +229,7 @@ require (
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/gofrs/flock v0.13.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down
12 changes: 6 additions & 6 deletions opencloud/pkg/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path"

"github.com/gofrs/uuid"
"github.com/google/uuid"
"gopkg.in/yaml.v2"

"github.com/opencloud-eu/opencloud/pkg/generators"
Expand Down Expand Up @@ -103,11 +103,11 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
}
}
} else {
systemUserID = uuid.Must(uuid.NewV4()).String()
adminUserID = uuid.Must(uuid.NewV4()).String()
graphApplicationID = uuid.Must(uuid.NewV4()).String()
storageUsersMountID = uuid.Must(uuid.NewV4()).String()
serviceAccountID = uuid.Must(uuid.NewV4()).String()
systemUserID = uuid.NewString()
adminUserID = uuid.NewString()
graphApplicationID = uuid.NewString()
storageUsersMountID = uuid.NewString()
serviceAccountID = uuid.NewString()

idmServicePassword, err = generators.GenerateRandomPassword(passwordLength)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions services/graph/pkg/identity/ldap_education_school.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/go-ldap/ldap/v3"
"github.com/gofrs/uuid"
"github.com/google/uuid"
libregraph "github.com/opencloud-eu/libre-graph-api-go"
"github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/opencloud/services/graph/pkg/config"
Expand Down Expand Up @@ -148,7 +148,7 @@ func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.Educ
ar.Attribute(i.educationConfig.schoolAttributeMap.schoolNumber, []string{school.GetSchoolNumber()})
}
if !i.useServerUUID {
ar.Attribute(i.educationConfig.schoolAttributeMap.id, []string{uuid.Must(uuid.NewV4()).String()})
ar.Attribute(i.educationConfig.schoolAttributeMap.id, []string{uuid.NewString()})
}
objectClasses := []string{"organizationalUnit", i.educationConfig.schoolObjectClass, "top"}
ar.Attribute("objectClass", objectClasses)
Expand Down
4 changes: 2 additions & 2 deletions services/graph/pkg/identity/ldap_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/CiscoM31/godata"
"github.com/go-ldap/ldap/v3"
"github.com/gofrs/uuid"
"github.com/google/uuid"
"github.com/libregraph/idm/pkg/ldapdn"
libregraph "github.com/opencloud-eu/libre-graph-api-go"

Expand Down Expand Up @@ -448,7 +448,7 @@ func (i *LDAP) groupToLDAPAttrValues(group libregraph.Group) (map[string][]strin
}

if !i.useServerUUID {
attrs["openCloudUUID"] = []string{uuid.Must(uuid.NewV4()).String()}
attrs["openCloudUUID"] = []string{uuid.NewString()}
attrs["objectClass"] = append(attrs["objectClass"], "openCloudObject")
}
return attrs, nil
Expand Down
6 changes: 3 additions & 3 deletions services/settings/pkg/store/metadata/assignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/json"
"fmt"

"github.com/gofrs/uuid"
"github.com/google/uuid"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
"github.com/opencloud-eu/opencloud/services/settings/pkg/settings"
"github.com/opencloud-eu/opencloud/services/settings/pkg/store/defaults"
Expand All @@ -20,7 +20,7 @@ func (s *Store) ListRoleAssignments(accountUUID string) ([]*settingsmsg.UserRole
if accountUUID == serviceAccountID {
return []*settingsmsg.UserRoleAssignment{
{
Id: uuid.Must(uuid.NewV4()).String(), // should we hardcode this id too?
Id: uuid.NewString(), // should we hardcode this id too?
AccountUuid: accountUUID,
RoleId: defaults.BundleUUIDServiceAccount,
},
Expand Down Expand Up @@ -136,7 +136,7 @@ func (s *Store) WriteRoleAssignment(accountUUID, roleID string) (*settingsmsg.Us
}

ass := &settingsmsg.UserRoleAssignment{
Id: uuid.Must(uuid.NewV4()).String(),
Id: uuid.NewString(),
AccountUuid: accountUUID,
RoleId: roleID,
}
Expand Down
4 changes: 2 additions & 2 deletions services/settings/pkg/store/metadata/assignments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
"testing"

"github.com/gofrs/uuid"
"github.com/google/uuid"
olog "github.com/opencloud-eu/opencloud/pkg/log"
"github.com/opencloud-eu/opencloud/pkg/shared"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
Expand Down Expand Up @@ -95,7 +95,7 @@ func initStore() *Store {
cfg: defaults.DefaultConfig(),
}
s.cfg.Commons = &shared.Commons{
AdminUserID: uuid.Must(uuid.NewV4()).String(),
AdminUserID: uuid.NewString(),
}

_ = NewMDC(s)
Expand Down
4 changes: 2 additions & 2 deletions services/settings/pkg/store/metadata/bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"fmt"

"github.com/gofrs/uuid"
"github.com/google/uuid"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
"github.com/opencloud-eu/opencloud/services/settings/pkg/settings"
"github.com/opencloud-eu/opencloud/services/settings/pkg/store/defaults"
Expand Down Expand Up @@ -146,7 +146,7 @@ func (s *Store) AddSettingToBundle(bundleID string, setting *settingsmsg.Setting
}

if setting.Id == "" {
setting.Id = uuid.Must(uuid.NewV4()).String()
setting.Id = uuid.NewString()
}

b.Settings = append(b.Settings, setting)
Expand Down
4 changes: 2 additions & 2 deletions services/settings/pkg/store/metadata/bundles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package store
import (
"testing"

"github.com/gofrs/uuid"
"github.com/google/uuid"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -102,7 +102,7 @@ var bundleScenarios = []struct {
}

var (
appendTestBundleID = uuid.Must(uuid.NewV4()).String()
appendTestBundleID = uuid.NewString()

appendTestSetting1 = &settingsmsg.Setting{
Id: "append-test-setting-1",
Expand Down
8 changes: 4 additions & 4 deletions services/settings/pkg/store/metadata/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"sync"

"github.com/gofrs/uuid"
"github.com/google/uuid"
olog "github.com/opencloud-eu/opencloud/pkg/log"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
"github.com/opencloud-eu/opencloud/services/settings/pkg/config"
Expand All @@ -21,7 +21,7 @@ var (
// Name is the default name for the settings store
Name = "opencloud-settings"
managerName = "metadata"
settingsSpaceID = "f1bdd61a-da7c-49fc-8203-0558109d1b4f" // uuid.Must(uuid.NewV4()).String()
settingsSpaceID = "f1bdd61a-da7c-49fc-8203-0558109d1b4f" // uuid.NewString()
rootFolderLocation = "settings"
bundleFolderLocation = "settings/bundles"
accountsFolderLocation = "settings/accounts"
Expand Down Expand Up @@ -156,7 +156,7 @@ func (s *Store) initMetadataClient(mdc MetadataClient) error {
}

ass := &settingsmsg.UserRoleAssignment{
Id: uuid.Must(uuid.NewV4()).String(),
Id: uuid.NewString(),
AccountUuid: accountUUID,
RoleId: roleID,
}
Expand Down Expand Up @@ -220,7 +220,7 @@ func (s *Store) userMustHaveAdminRole(accountUUID string, assIDs []string, mdc M
}

ass := &settingsmsg.UserRoleAssignment{
Id: uuid.Must(uuid.NewV4()).String(),
Id: uuid.NewString(),
AccountUuid: accountUUID,
RoleId: defaults.BundleUUIDRoleAdmin,
}
Expand Down
4 changes: 2 additions & 2 deletions services/settings/pkg/store/metadata/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/json"
"fmt"

"github.com/gofrs/uuid"
"github.com/google/uuid"
settingsmsg "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/messages/settings/v0"
"github.com/opencloud-eu/opencloud/services/settings/pkg/settings"
"github.com/opencloud-eu/reva/v2/pkg/errtypes"
Expand Down Expand Up @@ -127,7 +127,7 @@ func (s *Store) WriteValue(value *settingsmsg.Value) (*settingsmsg.Value, error)
ctx := context.TODO()

if value.Id == "" {
value.Id = uuid.Must(uuid.NewV4()).String()
value.Id = uuid.NewString()
}
b, err := json.Marshal(value)
if err != nil {
Expand Down