diff --git a/services/app-provider/pkg/config/defaults/defaultconfig.go b/services/app-provider/pkg/config/defaults/defaultconfig.go index bc9d84da056..bffc790338a 100644 --- a/services/app-provider/pkg/config/defaults/defaultconfig.go +++ b/services/app-provider/pkg/config/defaults/defaultconfig.go @@ -36,7 +36,7 @@ func DefaultConfig() *config.Config { Driver: "", Drivers: config.Drivers{ WOPI: config.WOPIDriver{ - WopiFolderURLBaseURL: "https://localhost:9200/", + WopiFolderURLBaseURL: "https://localhost:9200", WopiFolderURLPathTemplate: "/f/{{.ResourceID}}", }, }, diff --git a/services/app-provider/pkg/revaconfig/config.go b/services/app-provider/pkg/revaconfig/config.go index b1d1fda5807..0a96ef91ede 100644 --- a/services/app-provider/pkg/revaconfig/config.go +++ b/services/app-provider/pkg/revaconfig/config.go @@ -2,6 +2,8 @@ package revaconfig import ( + "strings" + "github.com/owncloud/ocis/v2/services/app-provider/pkg/config" ) @@ -38,7 +40,7 @@ func AppProviderConfigFromStruct(cfg *config.Config) map[string]interface{} { "iop_secret": cfg.Drivers.WOPI.IopSecret, "jwt_secret": cfg.TokenManager.JWTSecret, "wopi_url": cfg.Drivers.WOPI.WopiURL, - "wopi_folder_url_base_url": cfg.Drivers.WOPI.WopiFolderURLBaseURL, + "wopi_folder_url_base_url": strings.TrimRight(cfg.Drivers.WOPI.WopiFolderURLBaseURL, "/") + "/", // ensure it ends with "/" "wopi_folder_url_path_template": cfg.Drivers.WOPI.WopiFolderURLPathTemplate, }, }, diff --git a/services/auth-basic/pkg/config/defaults/defaultconfig.go b/services/auth-basic/pkg/config/defaults/defaultconfig.go index 36ce26a3e03..d73394ccc25 100644 --- a/services/auth-basic/pkg/config/defaults/defaultconfig.go +++ b/services/auth-basic/pkg/config/defaults/defaultconfig.go @@ -61,14 +61,14 @@ func DefaultConfig() *config.Config { PoolSize: 5, PoolCheckoutTimeout: 30 * time.Second, UserSchema: config.LDAPUserSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", - DisplayName: "displayname", + DisplayName: "displayName", Username: "uid", Enabled: "ownCloudUserEnabled", }, GroupSchema: config.LDAPGroupSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", DisplayName: "cn", Groupname: "cn", diff --git a/services/graph/pkg/config/defaults/defaultconfig.go b/services/graph/pkg/config/defaults/defaultconfig.go index 5f62f24f81a..7f07878461c 100644 --- a/services/graph/pkg/config/defaults/defaultconfig.go +++ b/services/graph/pkg/config/defaults/defaultconfig.go @@ -105,7 +105,7 @@ func DefaultConfig() *config.Config { UserNameAttribute: "uid", // FIXME: switch this to some more widely available attribute by default // ideally this needs to be constant for the lifetime of a users - UserIDAttribute: "owncloudUUID", + UserIDAttribute: "ownCloudUUID", UserTypeAttribute: "ownCloudUserType", UserEnabledAttribute: "ownCloudUserEnabled", ExternalIDAttribute: "owncloudExternalID", @@ -117,7 +117,7 @@ func DefaultConfig() *config.Config { GroupObjectClass: "groupOfNames", GroupNameAttribute: "cn", GroupMemberAttribute: "member", - GroupIDAttribute: "owncloudUUID", + GroupIDAttribute: "ownCloudUUID", EducationResourcesEnabled: false, // 1 minute InstanceMapperCacheTTL: 60, diff --git a/services/graph/pkg/identity/ldap_education_school.go b/services/graph/pkg/identity/ldap_education_school.go index 2a96d5b7a85..f5134f21ebf 100644 --- a/services/graph/pkg/identity/ldap_education_school.go +++ b/services/graph/pkg/identity/ldap_education_school.go @@ -105,7 +105,7 @@ func newSchoolAttributeMap() schoolAttributeMap { return schoolAttributeMap{ displayName: "ou", schoolNumber: "ocEducationSchoolNumber", - id: "owncloudUUID", + id: "ownCloudUUID", terminationDate: "ocEducationSchoolTerminationTimestamp", } } diff --git a/services/graph/pkg/identity/ldap_education_school_test.go b/services/graph/pkg/identity/ldap_education_school_test.go index 5367094b37e..74df774540e 100644 --- a/services/graph/pkg/identity/ldap_education_school_test.go +++ b/services/graph/pkg/identity/ldap_education_school_test.go @@ -45,21 +45,21 @@ var schoolEntry = ldap.NewEntry("ou=Test School", map[string][]string{ "ou": {"Test School"}, "ocEducationSchoolNumber": {"0123"}, - "owncloudUUID": {"abcd-defg"}, + "ownCloudUUID": {"abcd-defg"}, }) var schoolEntry1 = ldap.NewEntry("ou=Test School1", map[string][]string{ "ou": {"Test School1"}, "ocEducationSchoolNumber": {"0042"}, - "owncloudUUID": {"hijk-defg"}, + "ownCloudUUID": {"hijk-defg"}, }) var ( - filterSchoolSearchByIdExisting = "(&(objectClass=ocEducationSchool)(|(owncloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))" - filterSchoolSearchByIdNonexistant = "(&(objectClass=ocEducationSchool)(|(owncloudUUID=xxxx-xxxx)(ocEducationSchoolNumber=xxxx-xxxx)))" - filterSchoolSearchByNumberExisting = "(&(objectClass=ocEducationSchool)(|(owncloudUUID=0123)(ocEducationSchoolNumber=0123)))" - filterSchoolSearchByNumberNonexistant = "(&(objectClass=ocEducationSchool)(|(owncloudUUID=3210)(ocEducationSchoolNumber=3210)))" + filterSchoolSearchByIdExisting = "(&(objectClass=ocEducationSchool)(|(ownCloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))" + filterSchoolSearchByIdNonexistant = "(&(objectClass=ocEducationSchool)(|(ownCloudUUID=xxxx-xxxx)(ocEducationSchoolNumber=xxxx-xxxx)))" + filterSchoolSearchByNumberExisting = "(&(objectClass=ocEducationSchool)(|(ownCloudUUID=0123)(ocEducationSchoolNumber=0123)))" + filterSchoolSearchByNumberNonexistant = "(&(objectClass=ocEducationSchool)(|(ownCloudUUID=3210)(ocEducationSchoolNumber=3210)))" ) func TestCreateEducationSchool(t *testing.T) { @@ -119,7 +119,7 @@ func TestCreateEducationSchool(t *testing.T) { Scope: 2, SizeLimit: 1, Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=0123))", - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } lm.On("Search", schoolNumberSearchRequest). @@ -133,7 +133,7 @@ func TestCreateEducationSchool(t *testing.T) { Scope: 2, SizeLimit: 1, Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=0666))", - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } lm.On("Search", existingSchoolNumberSearchRequest). @@ -147,7 +147,7 @@ func TestCreateEducationSchool(t *testing.T) { Scope: 2, SizeLimit: 1, Filter: "(&(objectClass=ocEducationSchool)(ocEducationSchoolNumber=1111))", - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } lm.On("Search", schoolNumberSearchRequestError). @@ -161,7 +161,7 @@ func TestCreateEducationSchool(t *testing.T) { Scope: 0, SizeLimit: 1, Filter: "(objectClass=ocEducationSchool)", - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } lm.On("Search", schoolLookupAfterCreate). @@ -347,7 +347,7 @@ func TestDeleteEducationSchool(t *testing.T) { Scope: 2, SizeLimit: 1, Filter: tt.filter, - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } if tt.expectedItemNotFound { @@ -416,7 +416,7 @@ func TestGetEducationSchool(t *testing.T) { Scope: 2, SizeLimit: 1, Filter: tt.filter, - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } if tt.expectedItemNotFound { @@ -450,7 +450,7 @@ func TestGetEducationSchools(t *testing.T) { Scope: 2, SizeLimit: 0, Filter: "(objectClass=ocEducationSchool)", - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } lm.On("Search", sr1).Return(&ldap.SearchResult{Entries: []*ldap.Entry{schoolEntry, schoolEntry1}}, nil) @@ -467,7 +467,7 @@ var schoolByIDSearch1 *ldap.SearchRequest = &ldap.SearchRequest{ Scope: 2, SizeLimit: 1, Filter: filterSchoolSearchByIdExisting, - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } @@ -476,7 +476,7 @@ var schoolByNumberSearch *ldap.SearchRequest = &ldap.SearchRequest{ Scope: 2, SizeLimit: 1, Filter: filterSchoolSearchByNumberExisting, - Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, + Attributes: []string{"ou", "ownCloudUUID", "ocEducationSchoolNumber", "ocEducationSchoolTerminationTimestamp"}, Controls: []ldap.Control(nil), } diff --git a/services/graph/pkg/identity/ldap_writeback_test.go b/services/graph/pkg/identity/ldap_writeback_test.go index 91711b5aeb9..a150c7055dc 100644 --- a/services/graph/pkg/identity/ldap_writeback_test.go +++ b/services/graph/pkg/identity/ldap_writeback_test.go @@ -377,7 +377,7 @@ func TestCreateGroupSynthesizesWhenNotServerUUID(t *testing.T) { // synthesized entry must carry the id under that attribute for the model builder. c := lconfig c.UseServerUUID = false - c.GroupIDAttribute = "owncloudUUID" + c.GroupIDAttribute = "ownCloudUUID" var written *ldap.AddRequest l := &mocks.Client{} @@ -446,7 +446,7 @@ func TestCreateEducationClassSynthesizesWhenNotServerUUID(t *testing.T) { c := eduConfig c.UseServerUUID = false - c.GroupIDAttribute = "owncloudUUID" + c.GroupIDAttribute = "ownCloudUUID" var written *ldap.AddRequest l := &mocks.Client{} @@ -603,7 +603,7 @@ func TestUpdateEducationSchoolFoldsNoReadBack(t *testing.T) { preRead := ldap.NewEntry("ou=Test School", map[string][]string{ "ou": {"Test School"}, "ocEducationSchoolNumber": {"0123"}, - "owncloudUUID": {"abcd-defg"}, + "ownCloudUUID": {"abcd-defg"}, }) l := &mocks.Client{} @@ -668,7 +668,7 @@ func TestUpdateEducationClassFoldPreservesClassificationAndExternalID(t *testing } // TestCreateGroupSynthesizesWithNonDefaultIDAttribute guards the fix for the -// hardcoded "owncloudUUID" id write: the generated id must be stored under the +// hardcoded "ownCloudUUID" id write: the generated id must be stored under the // configured GroupIDAttribute, otherwise the synthesized model has no id and // createGroupModelFromLDAP returns nil (CreateGroup would return (nil, nil)). func TestCreateGroupSynthesizesWithNonDefaultIDAttribute(t *testing.T) { @@ -676,7 +676,7 @@ func TestCreateGroupSynthesizesWithNonDefaultIDAttribute(t *testing.T) { c := lconfig c.UseServerUUID = false - c.GroupIDAttribute = "entryUUID" // non-default: previously the id was written to owncloudUUID only + c.GroupIDAttribute = "entryUUID" // non-default: previously the id was written to ownCloudUUID only var written *ldap.AddRequest l := &mocks.Client{} @@ -697,7 +697,7 @@ func TestCreateGroupSynthesizesWithNonDefaultIDAttribute(t *testing.T) { // the id was written under the configured attribute and survives synthesis assert.NotEmpty(t, newGroup.GetId()) assert.NotEmpty(t, written.Attributes) - // the AddRequest carries the id under the configured attribute, not "owncloudUUID" + // the AddRequest carries the id under the configured attribute, not "ownCloudUUID" var idFromConfigured, idFromHardcoded string for _, a := range written.Attributes { switch a.Type { @@ -705,14 +705,14 @@ func TestCreateGroupSynthesizesWithNonDefaultIDAttribute(t *testing.T) { if len(a.Vals) > 0 { idFromConfigured = a.Vals[0] } - case "owncloudUUID": + case "ownCloudUUID": if len(a.Vals) > 0 { idFromHardcoded = a.Vals[0] } } } assert.NotEmpty(t, idFromConfigured, "id must be written under the configured GroupIDAttribute") - assert.Empty(t, idFromHardcoded, "id must not be written under a hardcoded owncloudUUID") + assert.Empty(t, idFromHardcoded, "id must not be written under a hardcoded ownCloudUUID") assert.Equal(t, idFromConfigured, newGroup.GetId()) l.AssertNotCalled(t, "Search", mock.Anything) } diff --git a/services/graph/pkg/service/v0/password_test.go b/services/graph/pkg/service/v0/password_test.go index 523db9c4f07..7b03f2fca6d 100644 --- a/services/graph/pkg/service/v0/password_test.go +++ b/services/graph/pkg/service/v0/password_test.go @@ -68,10 +68,10 @@ var _ = Describe("Users changing their own password", func() { UserDisplayNameAttribute: "displayName", UserNameAttribute: "uid", UserEmailAttribute: "mail", - UserIDAttribute: "ownclouduuid", + UserIDAttribute: "ownCloudUUID", UserSearchScope: "sub", GroupNameAttribute: "cn", - GroupIDAttribute: "ownclouduuid", + GroupIDAttribute: "ownCloudUUID", GroupSearchScope: "sub", } loggger := log.NewLogger() diff --git a/services/groups/pkg/config/defaults/defaultconfig.go b/services/groups/pkg/config/defaults/defaultconfig.go index 6a80472c244..f40ef3b3345 100644 --- a/services/groups/pkg/config/defaults/defaultconfig.go +++ b/services/groups/pkg/config/defaults/defaultconfig.go @@ -59,13 +59,13 @@ func DefaultConfig() *config.Config { PoolSize: 5, PoolCheckoutTimeout: 30 * time.Second, UserSchema: config.LDAPUserSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", - DisplayName: "displayname", + DisplayName: "displayName", Username: "uid", }, GroupSchema: config.LDAPGroupSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", DisplayName: "cn", Groupname: "cn", diff --git a/services/idp/pkg/backends/cs3/identifier/cs3.go b/services/idp/pkg/backends/cs3/identifier/cs3.go index 88116126fc6..2453af4861f 100644 --- a/services/idp/pkg/backends/cs3/identifier/cs3.go +++ b/services/idp/pkg/backends/cs3/identifier/cs3.go @@ -210,7 +210,7 @@ func (b *CS3Backend) DestroySession(_ context.Context, sessionRef *string) error // for the user specified by the userID. func (b *CS3Backend) UserClaims(_ string, _ map[string]bool) map[string]interface{} { return nil - // TODO should we return the "ownclouduuid" as a claim? there is also "LibgreGraph.UUID" / lico.ScopeUniqueUserID + // TODO should we return the "ownCloudUUID" as a claim? there is also "LibgreGraph.UUID" / lico.ScopeUniqueUserID } // ScopesSupported implements the Backend interface, providing supported scopes diff --git a/services/users/pkg/config/defaults/defaultconfig.go b/services/users/pkg/config/defaults/defaultconfig.go index ed459a0d191..28933e2ad3a 100644 --- a/services/users/pkg/config/defaults/defaultconfig.go +++ b/services/users/pkg/config/defaults/defaultconfig.go @@ -62,14 +62,14 @@ func DefaultConfig() *config.Config { PoolSize: 5, PoolCheckoutTimeout: 30 * time.Second, UserSchema: config.LDAPUserSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", - DisplayName: "displayname", + DisplayName: "displayName", Username: "uid", Enabled: "ownCloudUserEnabled", }, GroupSchema: config.LDAPGroupSchema{ - ID: "ownclouduuid", + ID: "ownCloudUUID", Mail: "mail", DisplayName: "cn", Groupname: "cn",