Repository: owncloud/ocis
Pull request #5331 (2023-01-05 05:25:11)

Bump github.com/crewjam/saml from 0.4.6 to 0.4.9
Bumps [github.com/crewjam/saml](https://github.com/crewjam/saml) from 0.4.6 to 0.4.9.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/crewjam/saml/commit/aee3fb1edeeaf1088fcb458727e0fd863d277f8b"><code>aee3fb1</code></a> Merge pull request from GHSA-j2jp-wvqg-wc2g</li>
<li><a href="https://github.com/crewjam/saml/commit/5e0ffd290abf0be7dfd4f8279e03a963071544eb"><code>5e0ffd2</code></a> minimum go version is 1.16</li>
<li><a href="https://github.com/crewjam/saml/commit/f5193739b56955ab0d87a20ad09a2f2d584a401d"><code>f519373</code></a> CI: invoke tests correctly (?)</li>
<li><a href="https://github.com/crewjam/saml/commit/d74fd352075ee3860fa0bd8daef192e5a3b25f1c"><code>d74fd35</code></a> fix test matrixing in CI</li>
<li><a href="https://github.com/crewjam/saml/commit/a54444557d39de0f05a41a4569f87752c3a4c78a"><code>a544445</code></a> update go.{mod,sum} files</li>
<li><a href="https://github.com/crewjam/saml/commit/1a0d2f4ba048791f57ca343ff1a5dc35dd38dc4f"><code>1a0d2f4</code></a> Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 (<a href="https://github-redirect.dependabot.com/crewjam/saml/issues/435">#435</a>)</li>
<li><a href="https://github.com/crewjam/saml/commit/e87e8389d0279cdeedaae5d533a8750f4e864f38"><code>e87e838</code></a> Support configuring binding for SP SLO endpoints (<a href="https://github-redirect.dependabot.com/crewjam/saml/issues/444">#444</a>)</li>
<li><a href="https://github.com/crewjam/saml/commit/702b90c6842e3beeac122011f37a1825962917e6"><code>702b90c</code></a> Revert &quot;Bump github.com/russellhaering/goxmldsig from 1.1.1 to 1.2.0 (<a href="https://github-redirect.dependabot.com/crewjam/saml/issues/426">#426</a>)&quot;</li>
<li><a href="https://github.com/crewjam/saml/commit/824f7933cc194b57f1a371691bfc561116ef43c3"><code>824f793</code></a> remove maint.yaml from CI; use dependabot instead</li>
<li><a href="https://github.com/crewjam/saml/commit/a3bdfa1a94e77b64aa8cf3a6e079b16f69628b4f"><code>a3bdfa1</code></a> bump golangci-lint in ci to 1.46.2</li>
<li>Additional commits viewable in <a href="https://github.com/crewjam/saml/compare/v0.4.6...v0.4.9">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/crewjam/saml&package-manager=go_modules&previous-version=0.4.6&new-version=0.4.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/owncloud/ocis/network/alerts).

</details>

update-docs[bot]: Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis/blob/master/changelog/README.md) item based on your changes.

sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=5331)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=5331&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=5331&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=5331&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=5331&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=5331&metric=coverage&view=list) No Coverage information  
[![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=5331&metric=duplicated_lines_density&view=list) No Duplication information



Patch:
diff --git a/go.mod b/go.mod
index 4d9dd7207bf..ec918f169b2 100644
--- a/go.mod
+++ b/go.mod
@@ -138,7 +138,7 @@ require (
 	github.com/coreos/go-systemd/v22 v22.4.0 // indirect
 	github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
 	github.com/crewjam/httperr v0.2.0 // indirect
-	github.com/crewjam/saml v0.4.6 // indirect
+	github.com/crewjam/saml v0.4.9 // indirect
 	github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/deckarep/golang-set v1.8.0 // indirect
diff --git a/go.sum b/go.sum
index edd4637b03a..20e1e776c6d 100644
--- a/go.sum
+++ b/go.sum
@@ -339,8 +339,9 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo=
 github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
-github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4=
 github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A=
+github.com/crewjam/saml v0.4.9 h1:X2jDv4dv3IvfT9t+RhADavzNFAcq3fVxzTCIH3G605U=
+github.com/crewjam/saml v0.4.9/go.mod h1:9Zh6dWPtB3MSzTRt8fIFH60Z351QQ+s7hCU3J/tTlA4=
 github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 h1:y4n2j68LLnvac+zw/al8MfPgO5aQiIwLmHM/JzYN8AM=
 github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
 github.com/cs3org/reva/v2 v2.12.1-0.20221230073811-e52401790323 h1:zkyBR7O5NjyEdI71AhGyHMq3+EL2rlJmR3QnR2oS+OE=
@@ -1390,6 +1391,7 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
 golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
diff --git a/services/graph/pkg/identity/ldap_school.go b/services/graph/pkg/identity/ldap_school.go
index f344a8d0431..3119d3854c5 100644
--- a/services/graph/pkg/identity/ldap_school.go
+++ b/services/graph/pkg/identity/ldap_school.go
@@ -135,7 +135,7 @@ func (i *LDAP) DeleteEducationSchool(ctx context.Context, id string) error {
 	if !i.writeEnabled {
 		return errReadOnly
 	}
-	e, err := i.getSchoolByID(id)
+	e, err := i.getSchoolByNumberOrID(id)
 	if err != nil {
 		return err
 	}
@@ -150,10 +150,10 @@ func (i *LDAP) DeleteEducationSchool(ctx context.Context, id string) error {
 }
 
 // GetEducationSchool implements the EducationBackend interface for the LDAP backend.
-func (i *LDAP) GetEducationSchool(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.EducationSchool, error) {
+func (i *LDAP) GetEducationSchool(ctx context.Context, numberOrID string, queryParam url.Values) (*libregraph.EducationSchool, error) {
 	logger := i.logger.SubloggerWithRequestID(ctx)
 	logger.Debug().Str("backend", "ldap").Msg("GetEducationSchool")
-	e, err := i.getSchoolByID(nameOrID)
+	e, err := i.getSchoolByNumberOrID(numberOrID)
 	if err != nil {
 		return nil, err
 	}
@@ -211,7 +211,7 @@ func (i *LDAP) GetEducationSchoolUsers(ctx context.Context, id string) ([]*libre
 	logger := i.logger.SubloggerWithRequestID(ctx)
 	logger.Debug().Str("backend", "ldap").Msg("GetEducationSchoolUsers")
 
-	schoolEntry, err := i.getSchoolByID(id)
+	schoolEntry, err := i.getSchoolByNumberOrID(id)
 	if err != nil {
 		return nil, err
 	}
@@ -261,7 +261,7 @@ func (i *LDAP) AddUsersToEducationSchool(ctx context.Context, schoolID string, m
 	logger := i.logger.SubloggerWithRequestID(ctx)
 	logger.Debug().Str("backend", "ldap").Msg("AddUsersToEducationSchool")
 
-	schoolEntry, err := i.getSchoolByID(schoolID)
+	schoolEntry, err := i.getSchoolByNumberOrID(schoolID)
 	if err != nil {
 		return err
 	}
@@ -306,7 +306,7 @@ func (i *LDAP) RemoveUserFromEducationSchool(ctx context.Context, schoolID strin
 	logger := i.logger.SubloggerWithRequestID(ctx)
 	logger.Debug().Str("backend", "ldap").Msg("RemoveUserFromEducationSchool")
 
-	schoolEntry, err := i.getSchoolByID(schoolID)
+	schoolEntry, err := i.getSchoolByNumberOrID(schoolID)
 	if err != nil {
 		return err
 	}
@@ -347,9 +347,15 @@ func (i *LDAP) getSchoolByDN(dn string) (*ldap.Entry, error) {
 	return i.getEntryByDN(dn, attrs, filter)
 }
 
-func (i *LDAP) getSchoolByID(id string) (*ldap.Entry, error) {
-	id = ldap.EscapeFilter(id)
-	filter := fmt.Sprintf("(%s=%s)", i.educationConfig.schoolAttributeMap.id, id)
+func (i *LDAP) getSchoolByNumberOrID(numberOrID string) (*ldap.Entry, error) {
+	numberOrID = ldap.EscapeFilter(numberOrID)
+	filter := fmt.Sprintf(
+		"(|(%s=%s)(%s=%s))",
+		i.educationConfig.schoolAttributeMap.id,
+		numberOrID,
+		i.educationConfig.schoolAttributeMap.schoolNumber,
+		numberOrID,
+	)
 	return i.getSchoolByFilter(filter)
 }
 


Test patch:
diff --git a/services/graph/pkg/identity/ldap_school_test.go b/services/graph/pkg/identity/ldap_school_test.go
index 0f1b980b248..953c92c1ee0 100644
--- a/services/graph/pkg/identity/ldap_school_test.go
+++ b/services/graph/pkg/identity/ldap_school_test.go
@@ -76,77 +76,139 @@ func TestCreateEducationSchool(t *testing.T) {
 }
 
 func TestDeleteEducationSchool(t *testing.T) {
-	lm := &mocks.Client{}
-	sr1 := &ldap.SearchRequest{
-		BaseDN:     "",
-		Scope:      2,
-		SizeLimit:  1,
-		Filter:     "(&(objectClass=ocEducationSchool)(owncloudUUID=abcd-defg))",
-		Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
-		Controls:   []ldap.Control(nil),
-	}
-	sr2 := &ldap.SearchRequest{
-		BaseDN:     "",
-		Scope:      2,
-		SizeLimit:  1,
-		Filter:     "(&(objectClass=ocEducationSchool)(owncloudUUID=xxxx-xxxx))",
-		Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
-		Controls:   []ldap.Control(nil),
+	tests := []struct {
+		name                 string
+		numberOrId           string
+		filter               string
+		expectedItemNotFound bool
+	}{
+		{
+			name:                 "Test delete school using schoolId",
+			numberOrId:           "abcd-defg",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))",
+			expectedItemNotFound: false,
+		},
+		{
+			name:                 "Test delete school using unknown schoolId",
+			numberOrId:           "xxxx-xxxx",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=xxxx-xxxx)(ocEducationSchoolNumber=xxxx-xxxx)))",
+			expectedItemNotFound: true,
+		},
+		{
+			name:                 "Test delete school using schoolNumber",
+			numberOrId:           "0123",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=0123)(ocEducationSchoolNumber=0123)))",
+			expectedItemNotFound: false,
+		},
+		{
+			name:                 "Test delete school using unknown schoolNumber",
+			numberOrId:           "3210",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=3210)(ocEducationSchoolNumber=3210)))",
+			expectedItemNotFound: true,
+		},
 	}
-	lm.On("Search", sr1).Return(&ldap.SearchResult{Entries: []*ldap.Entry{schoolEntry}}, nil)
-	lm.On("Search", sr2).Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
-	dr1 := &ldap.DelRequest{
-		DN: "ou=Test School",
-	}
-	lm.On("Del", dr1).Return(nil)
-	b, err := getMockedBackend(lm, eduConfig, &logger)
-	assert.Nil(t, err)
 
-	err = b.DeleteEducationSchool(context.Background(), "abcd-defg")
-	lm.AssertNumberOfCalls(t, "Search", 1)
-	lm.AssertNumberOfCalls(t, "Del", 1)
-	assert.Nil(t, err)
+	for _, tt := range tests {
+		lm := &mocks.Client{}
+		sr := &ldap.SearchRequest{
+			BaseDN:     "",
+			Scope:      2,
+			SizeLimit:  1,
+			Filter:     tt.filter,
+			Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
+			Controls:   []ldap.Control(nil),
+		}
+		if tt.expectedItemNotFound {
+			lm.On("Search", sr).Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
+		} else {
+			lm.On("Search", sr).Return(&ldap.SearchResult{Entries: []*ldap.Entry{schoolEntry}}, nil)
+		}
+		dr := &ldap.DelRequest{
+			DN: "ou=Test School",
+		}
+		lm.On("Del", dr).Return(nil)
 
-	err = b.DeleteEducationSchool(context.Background(), "xxxx-xxxx")
-	lm.AssertNumberOfCalls(t, "Search", 2)
-	lm.AssertNumberOfCalls(t, "Del", 1)
-	assert.NotNil(t, err)
-	assert.Equal(t, "itemNotFound", err.Error())
+		b, err := getMockedBackend(lm, eduConfig, &logger)
+		assert.Nil(t, err)
+
+		err = b.DeleteEducationSchool(context.Background(), tt.numberOrId)
+		lm.AssertNumberOfCalls(t, "Search", 1)
+
+		if tt.expectedItemNotFound {
+			lm.AssertNumberOfCalls(t, "Del", 0)
+			assert.NotNil(t, err)
+			assert.Equal(t, "itemNotFound", err.Error())
+		} else {
+			assert.Nil(t, err)
+		}
+	}
 }
 
 func TestGetEducationSchool(t *testing.T) {
-	lm := &mocks.Client{}
-	sr1 := &ldap.SearchRequest{
-		BaseDN:     "",
-		Scope:      2,
-		SizeLimit:  1,
-		Filter:     "(&(objectClass=ocEducationSchool)(owncloudUUID=abcd-defg))",
-		Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
-		Controls:   []ldap.Control(nil),
-	}
-	sr2 := &ldap.SearchRequest{
-		BaseDN:     "",
-		Scope:      2,
-		SizeLimit:  1,
-		Filter:     "(&(objectClass=ocEducationSchool)(owncloudUUID=xxxx-xxxx))",
-		Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
-		Controls:   []ldap.Control(nil),
+	tests := []struct {
+		name                 string
+		numberOrId           string
+		filter               string
+		expectedItemNotFound bool
+	}{
+		{
+			name:                 "Test search school using schoolId",
+			numberOrId:           "abcd-defg",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))",
+			expectedItemNotFound: false,
+		},
+		{
+			name:                 "Test search school using unknown schoolId",
+			numberOrId:           "xxxx-xxxx",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=xxxx-xxxx)(ocEducationSchoolNumber=xxxx-xxxx)))",
+			expectedItemNotFound: true,
+		},
+		{
+			name:                 "Test search school using schoolNumber",
+			numberOrId:           "0123",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=0123)(ocEducationSchoolNumber=0123)))",
+			expectedItemNotFound: false,
+		},
+		{
+			name:                 "Test search school using unknown schoolNumber",
+			numberOrId:           "3210",
+			filter:               "(&(objectClass=ocEducationSchool)(|(owncloudUUID=3210)(ocEducationSchoolNumber=3210)))",
+			expectedItemNotFound: true,
+		},
 	}
-	lm.On("Search", sr1).Return(&ldap.SearchResult{Entries: []*ldap.Entry{schoolEntry}}, nil)
-	lm.On("Search", sr2).Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
-	b, err := getMockedBackend(lm, eduConfig, &logger)
-	assert.Nil(t, err)
-	school, err := b.GetEducationSchool(context.Background(), "abcd-defg", nil)
-	lm.AssertNumberOfCalls(t, "Search", 1)
-	assert.Nil(t, err)
-	assert.Equal(t, "Test School", school.GetDisplayName())
-	assert.Equal(t, "abcd-defg", school.GetId())
-	assert.Equal(t, "0123", school.GetSchoolNumber())
 
-	school, err = b.GetEducationSchool(context.Background(), "xxxx-xxxx", nil)
-	lm.AssertNumberOfCalls(t, "Search", 2)
-	assert.NotNil(t, err)
-	assert.Equal(t, "itemNotFound", err.Error())
+	for _, tt := range tests {
+		lm := &mocks.Client{}
+		sr := &ldap.SearchRequest{
+			BaseDN:     "",
+			Scope:      2,
+			SizeLimit:  1,
+			Filter:     tt.filter,
+			Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
+			Controls:   []ldap.Control(nil),
+		}
+		if tt.expectedItemNotFound {
+			lm.On("Search", sr).Return(&ldap.SearchResult{Entries: []*ldap.Entry{}}, nil)
+		} else {
+			lm.On("Search", sr).Return(&ldap.SearchResult{Entries: []*ldap.Entry{schoolEntry}}, nil)
+		}
+
+		b, err := getMockedBackend(lm, eduConfig, &logger)
+		assert.Nil(t, err)
+
+		school, err := b.GetEducationSchool(context.Background(), tt.numberOrId, nil)
+		lm.AssertNumberOfCalls(t, "Search", 1)
+
+		if tt.expectedItemNotFound {
+			assert.NotNil(t, err)
+			assert.Equal(t, "itemNotFound", err.Error())
+		} else {
+			assert.Nil(t, err)
+			assert.Equal(t, "Test School", school.GetDisplayName())
+			assert.Equal(t, "abcd-defg", school.GetId())
+			assert.Equal(t, "0123", school.GetSchoolNumber())
+		}
+	}
 }
 
 func TestGetEducationSchools(t *testing.T) {
@@ -172,7 +234,7 @@ var schoolByIDSearch1 *ldap.SearchRequest = &ldap.SearchRequest{
 	BaseDN:     "",
 	Scope:      2,
 	SizeLimit:  1,
-	Filter:     "(&(objectClass=ocEducationSchool)(owncloudUUID=abcd-defg))",
+	Filter:     "(&(objectClass=ocEducationSchool)(|(owncloudUUID=abcd-defg)(ocEducationSchoolNumber=abcd-defg)))",
 	Attributes: []string{"ou", "owncloudUUID", "ocEducationSchoolNumber"},
 	Controls:   []ldap.Control(nil),
 }
diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml
index 4c83ec68595..3a9fc844274 100644
--- a/tests/acceptance/config/behat.yml
+++ b/tests/acceptance/config/behat.yml
@@ -73,6 +73,7 @@ default:
         - WebDavPropertiesContext:
         - TUSContext:
         - SpacesTUSContext:
+        - ArchiverContext:
 
     apiContract:
       paths:
diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md
index 4073214d052..4ac319d5da8 100644
--- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md
+++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md
@@ -79,5 +79,17 @@ The expected failures in this file are from features in the owncloud/ocis repo.
 - [apiCors/cors.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L67)
 - [apiCors/cors.feature:68](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L68)
 
+#### [POST response does not return correct path when creating public link](https://github.com/owncloud/ocis/issues/5139)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L62)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L63)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L64)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L90)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L160)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L161)
+- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L162)
+
+#### [Public cannot download folder via the public link of the folder inside the project space](https://github.com/owncloud/ocis/issues/5229)
+- [apiSpacesShares/publicLinkDownload.feature:30](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature#L30)
+
 #### [A User can get information of another user with Graph API](https://github.com/owncloud/ocis/issues/5125)
 - [apiGraph/getUser.feature:23](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L23)
diff --git a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md
index a71f3b2644f..790e2a8a476 100644
--- a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md
+++ b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md
@@ -80,10 +80,10 @@ Other free text and markdown formatting can be used elsewhere in the document if
 -   [webUILogin/openidLogin.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L60)
 
 ### [Comments in sidebar](https://github.com/owncloud/web/issues/1158)
--   [webUIFilesDetails/fileDetails.feature:84](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L90)
--   [webUIFilesDetails/fileDetails.feature:98](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L106)
--   [webUIFilesDetails/fileDetails.feature:113](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L123)
--   [webUIFilesDetails/fileDetails.feature:128](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L140)
+-   [webUIFilesDetails/fileDetails.feature:84](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L84)
+-   [webUIFilesDetails/fileDetails.feature:98](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L98)
+-   [webUIFilesDetails/fileDetails.feature:113](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L113)
+-   [webUIFilesDetails/fileDetails.feature:128](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L128)
 
 ### [Deletion of a recursive folder from trashbin is not possible](https://github.com/owncloud/product/issues/188)
 -   [webUITrashbinDelete/trashbinDelete.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L51)
@@ -120,8 +120,8 @@ Other free text and markdown formatting can be used elsewhere in the document if
 -   [webUIUpload/upload.feature:43](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L43)
 
 ### [Favorites deactivated in ocis temporarily](https://github.com/owncloud/ocis/issues/1228)
--   [webUIFilesDetails/fileDetails.feature:47](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L50)
--   [webUIFilesDetails/fileDetails.feature:67](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L70)
+-   [webUIFilesDetails/fileDetails.feature:47](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L47)
+-   [webUIFilesDetails/fileDetails.feature:67](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L67)
 -   [webUIRenameFiles/renameFiles.feature:249](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIRenameFiles/renameFiles.feature#L249)
 
 ### [PROPFIND to sub-folder of a shared resources with same name gives 404](https://github.com/owncloud/ocis/issues/3859)
diff --git a/tests/acceptance/features/apiContract/copy.feature b/tests/acceptance/features/apiContract/copy.feature
new file mode 100644
index 00000000000..984812a61a9
--- /dev/null
+++ b/tests/acceptance/features/apiContract/copy.feature
@@ -0,0 +1,21 @@
+@api @skipOnOcV10
+Feature: Copy test
+  check that the Copy response contains all the relevant values
+
+  Background:
+    Given these users have been created with default attributes and without skeleton files:
+      | username |
+      | Alice    |
+    And using spaces DAV path
+    And the administrator has given "Alice" the role "Space Admin" using the settings api
+    And user "Alice" has created a space "new-space" with the default quota using the GraphApi
+
+
+  Scenario: check the COPY response headers
+    Given user "Alice" has uploaded a file inside space "new-space" with content "some content" to "testfile.txt"
+    And user "Alice" has created a folder "new" in space "new-space"
+    When user "Alice" copies file "testfile.txt" from space "new-space" to "/new/testfile.txt" inside space "new-space" using the WebDAV API
+    Then the HTTP status code should be "201"
+    And the following headers should match these regular expressions
+      | Oc-Fileid                   | /^[a-f0-9!\$\-]{110}$/ |
+      | Access-Control-Allow-Origin | /^[*]{1}$/             |
diff --git a/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature b/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature
new file mode 100644
index 00000000000..588550aadc4
--- /dev/null
+++ b/tests/acceptance/features/apiSpacesShares/publicLinkDownload.feature
@@ -0,0 +1,43 @@
+@api @skipOnOcV10
+Feature: Public can download folders from project space public link
+  As a public
+  I want to be able to download folder from public link
+  So that I can gain access to it's contents
+
+  Background:
+    Given these users have been created with default attributes and without skeleton files:
+      | username |
+      | Alice    |
+      | Brian    |
+    And using spaces DAV path
+    And the administrator has given "Alice" the role "Space Admin" using the settings api
+    And user "Alice" has created a space "new-space" with the default quota using the GraphApi
+
+
+  Scenario: download a folder from public link of a space
+    Given user "Alice" has created a folder "NewFolder" in space "new-space"
+    And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "NewFolder/test.txt"
+    And user "Alice" has created a public link share of the space "new-space" with settings:
+      | permissions | 1        |
+      | name        | someName |
+    When public downloads the folder "NewFolder" from the last created public link using the public files API
+    Then the HTTP status code should be "200"
+    And the downloaded tar archive should contain these files:
+      | name               | content      |
+      | NewFolder/test.txt | some content |
+
+  @issue-5229
+  Scenario: download a folder from public link of a folder inside a space
+    Given user "Alice" has created a folder "NewFolder" in space "new-space"
+    And user "Alice" has created a folder "NewFolder/folder" in space "new-space"
+    And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "NewFolder/folder/test.txt"
+    And user "Alice" has created a public link share inside of space "new-space" with settings:
+      | path        | NewFolder   |
+      | shareType   | 3           |
+      | permissions | 1           |
+      | name        | public link |
+    When public downloads the folder "folder" from the last created public link using the public files API
+    Then the HTTP status code should be "200"
+    And the downloaded tar archive should contain these files:
+      | name            | content      |
+      | folder/test.txt | some content |
diff --git a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature
index 0160617a7c0..7104ba45c11 100644
--- a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature
+++ b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature
@@ -1,103 +1,103 @@
 @api @skipOnOcV10
 Feature: Share spaces via link
-    As the manager of a space
-    I want to be able to share a space via public link
+  As the manager of a space
+  I want to be able to share a space via public link
 
-    Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
-    See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
+  Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
+  See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
 
-    Background:
-        Given these users have been created with default attributes and without skeleton files:
-            | username |
-            | Alice    |
-            | Brian    |
-        And using spaces DAV path
-        And the administrator has given "Alice" the role "Space Admin" using the settings api
-        And user "Alice" has created a space "share space" with the default quota using the GraphApi
-        And user "Alice" has uploaded a file inside space "share space" with content "some content" to "test.txt"
+  Background:
+    Given these users have been created with default attributes and without skeleton files:
+      | username |
+      | Alice    |
+      | Brian    |
+    And using spaces DAV path
+    And the administrator has given "Alice" the role "Space Admin" using the settings api
+    And user "Alice" has created a space "share space" with the default quota using the GraphApi
+    And user "Alice" has uploaded a file inside space "share space" with content "some content" to "test.txt"
 
 
-    Scenario Outline: A manager can share a space to public via link with different permissions
-        When user "Alice" creates a public link share of the space "share space" with settings:
-            | permissions | <permissions> |
-            | password    | <password>    |
-            | name        | <linkName>    |
-            | expireDate  | <expireDate>  |
-        Then the HTTP status code should be "200"
-        And the OCS status code should be "200"
-        And the OCS status message should be "OK"
-        And the fields of the last response to user "Alice" should include
-            | item_type              | folder                |
-            | mimetype               | httpd/unix-directory  |
-            | file_target            | /                     |
-            | path                   | /                     |
-            | permissions            | <expectedPermissions> |
-            | share_type             | public_link           |
-            | displayname_owner      | %displayname%         |
-            | uid_owner              | %username%            |
-            | name                   | <linkName>            |
-        And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "<password>"
-        And the downloaded content should be "some content"
-        But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass"
-        Examples:
-            | permissions | expectedPermissions       | password       | linkName | expireDate               |
-            | 1           | read                      | 123234         | link     | 2042-03-25T23:59:59+0100 |
-            | 5           | read,create               | qwerty 123     |          | 2042-03-25T23:59:59+0100 |
-            | 15          | read,update,create,delete | d*V^o*Y03R9n8Z | link     |                          |
+  Scenario Outline: A manager can share a space to public via link with different permissions
+    When user "Alice" creates a public link share of the space "share space" with settings:
+      | permissions | <permissions> |
+      | password    | <password>    |
+      | name        | <linkName>    |
+      | expireDate  | <expireDate>  |
+    Then the HTTP status code should be "200"
+    And the OCS status code should be "200"
+    And the OCS status message should be "OK"
+    And the fields of the last response to user "Alice" should include
+      | item_type         | folder                |
+      | mimetype          | httpd/unix-directory  |
+      | file_target       | /                     |
+      | path              | /                     |
+      | permissions       | <expectedPermissions> |
+      | share_type        | public_link           |
+      | displayname_owner | %displayname%         |
+      | uid_owner         | %username%            |
+      | name              | <linkName>            |
+    And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "<password>"
+    And the downloaded content should be "some content"
+    But the public should not be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "wrong pass"
+    Examples:
+      | permissions | expectedPermissions       | password       | linkName | expireDate               |
+      | 1           | read                      | 123234         | link     | 2042-03-25T23:59:59+0100 |
+      | 5           | read,create               | qwerty 123     |          | 2042-03-25T23:59:59+0100 |
+      | 15          | read,update,create,delete | d*V^o*Y03R9n8Z | link     |                          |
 
 
-    Scenario: An uploader should be able to upload a file
-        When user "Alice" creates a public link share of the space "share space" with settings:
-            | permissions | 4                        |
-            | password    | 123                      |
-            | name        | forUpload                |
-            | expireDate  | 2042-03-25T23:59:59+0100 |
-        Then the HTTP status code should be "200"
-        And the OCS status code should be "200"
-        And the OCS status message should be "OK"
-        And the fields of the last response to user "Alice" should include
-            | item_type         | folder               |
-            | mimetype          | httpd/unix-directory |
-            | file_target       | /                    |
-            | path              | /                    |
-            | permissions       | create               |
-            | share_type        | public_link          |
-            | displayname_owner | %displayname%        |
-            | uid_owner         | %username%           |
-            | name              | forUpload            |
-        And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "123"
-        And for user "Alice" the space "share space" should contain these entries:
-            | lorem.txt |
+  Scenario: An uploader should be able to upload a file
+    When user "Alice" creates a public link share of the space "share space" with settings:
+      | permissions | 4                        |
+      | password    | 123                      |
+      | name        | forUpload                |
+      | expireDate  | 2042-03-25T23:59:59+0100 |
+    Then the HTTP status code should be "200"
+    And the OCS status code should be "200"
+    And the OCS status message should be "OK"
+    And the fields of the last response to user "Alice" should include
+      | item_type         | folder               |
+      | mimetype          | httpd/unix-directory |
+      | file_target       | /                    |
+      | path              | /                    |
+      | permissions       | create               |
+      | share_type        | public_link          |
+      | displayname_owner | %displayname%        |
+      | uid_owner         | %username%           |
+      | name              | forUpload            |
+    And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "123"
+    And for user "Alice" the space "share space" should contain these entries:
+      | lorem.txt |
 
 
-    Scenario Outline: An user without manager role cannot share a space to public via link
-        Given user "Alice" has shared a space "share space" to user "Brian" with role "<role>"
-        When user "Brian" creates a public link share of the space "share space" with settings:
-            | permissions | 1 |
-        Then the HTTP status code should be "404"
-        And the OCS status code should be "404"
-        And the OCS status message should be "No share permission"
-        And for user "Alice" the space "share space" should not contain the last created public link
-        Examples:
-            | role   |
-            | viewer |
-            | editor |
+  Scenario Outline: An user without manager role cannot share a space to public via link
+    Given user "Alice" has shared a space "share space" to user "Brian" with role "<role>"
+    When user "Brian" creates a public link share of the space "share space" with settings:
+      | permissions | 1 |
+    Then the HTTP status code should be "404"
+    And the OCS status code should be "404"
+    And the OCS status message should be "No share permission"
+    And for user "Alice" the space "share space" should not contain the last created public link
+    Examples:
+      | role   |
+      | viewer |
+      | editor |
 
 
-    Scenario: An user with manager role can share a space to public via link
-        Given user "Alice" has shared a space "share space" to user "Brian" with role "manager"
-        When user "Brian" creates a public link share of the space "share space" with settings:
-            | permissions | 1 |
-        Then the HTTP status code should be "200"
-        And the OCS status code should be "200"
-        And for user "Alice" the space "share space" should contain the last created public link
+  Scenario: An user with manager role can share a space to public via link
+    Given user "Alice" has shared a space "share space" to user "Brian" with role "manager"
+    When user "Brian" creates a public link share of the space "share space" with settings:
+      | permissions | 1 |
+    Then the HTTP status code should be "200"
+    And the OCS status code should be "200"
+    And for user "Alice" the space "share space" should contain the last created public link
 
 
-    Scenario: A user cannot share a disabled space to public via link
-        Given user "Alice" has disabled a space "share space"
-        When user "Alice" creates a public link share of the space "share space" with settings:
-            | permissions | 1 |
-        Then the HTTP status code should be "404"
-        And the OCS status code should be "404"
-        And the OCS status message should be "Wrong path, file/folder doesn't exist"
-        And for user "Alice" the space "share space" should not contain the last created public link
+  Scenario: A user cannot share a disabled space to public via link
+    Given user "Alice" has disabled a space "share space"
+    When user "Alice" creates a public link share of the space "share space" with settings:
+      | permissions | 1 |
+    Then the HTTP status code should be "404"
+    And the OCS status code should be "404"
+    And the OCS status message should be "Wrong path, file/folder doesn't exist"
+    And for user "Alice" the space "share space" should not contain the last created public link
diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature
index 42fc6734ae6..cc62dcc820b 100644
--- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature
+++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature
@@ -1,21 +1,21 @@
 @api @skipOnOcV10
 Feature: Share a file or folder that is inside a space via public link
-      As an user with manager space role
-      I want to be able to share the data inside the space via public link
+  As an user with manager space role
+  I want to be able to share the data inside the space via public link
 
-      folder permissions:
-      | role        | permissions |
-      | internal    | 0           |
-      | viewer      | 1           |
-      | uploader    | 4           |
-      | contributor | 5           |
-      | editor      | 15          |
+  folder permissions:
+  | role        | permissions |
+  | internal    | 0           |
+  | viewer      | 1           |
+  | uploader    | 4           |
+  | contributor | 5           |
+  | editor      | 15          |
 
-      file permissions:
-      | role     | permissions |
-      | internal | 0           |
-      | viewer   | 1           |
-      | editor   | 3           |
+  file permissions:
+  | role     | permissions |
+  | internal | 0           |
+  | viewer   | 1           |
+  | editor   | 3           |
 
   Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
   See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
@@ -44,17 +44,24 @@ Feature: Share a file or folder that is inside a space via public link
     And the OCS status code should be "200"
     And the OCS status message should be "OK"
     And the fields of the last response to user "Alice" should include
-      | path | <path> |
+      | item_type         | <item_type>   |
+      | mimetype          | <mimetype>    |
+      | file_target       | <file_target> |
+      | path              | /<entity>     |
+      | permissions       | <permissions> |
+      | share_type        | public_link   |
+      | displayname_owner | %displayname% |
+      | name              | <name>        |
     Examples:
-      | entity          | path     | permissions | password | name | expireDate               |
-      | folder          | /folder   |0           |          | link |                          |
-      | folder          | /folder   |1           | 123      | link | 2042-03-25T23:59:59+0100 |
-      | folder          | /folder   |4           |          |      |                          |
-      | folder          | /folder   |5           | 200      |      | 2042-03-25T23:59:59+0100 |
-      | folder          | /folder   |15          |          | link |                          |
-      | folder/file.txt | /file.txt |0           | 123      | link | 2042-03-25T23:59:59+0100 |
-      | folder/file.txt | /file.txt |1           | 123      | link | 2042-03-25T23:59:59+0100 |
-      | folder/file.txt | /file.txt |3           | 123      | link | 2042-03-25T23:59:59+0100 |
+      | entity          | file_target | permissions | password | name | expireDate               | item_type | mimetype             |
+      | folder          | /folder     | 0           |          | link |                          | folder    | httpd/unix-directory |
+      | folder          | /folder     | 1           | 123      | link | 2042-03-25T23:59:59+0100 | folder    | httpd/unix-directory |
+      | folder          | /folder     | 4           |          |      |                          | folder    | httpd/unix-directory |
+      | folder          | /folder     | 5           | 200      |      | 2042-03-25T23:59:59+0100 | folder    | httpd/unix-directory |
+      | folder          | /folder     | 15          |          | link |                          | folder    | httpd/unix-directory |
+      | folder/file.txt | /file.txt   | 0           | 123      | link | 2042-03-25T23:59:59+0100 | file      | text/plain           |
+      | folder/file.txt | /file.txt   | 1           | 123      | link | 2042-03-25T23:59:59+0100 | file      | text/plain           |
+      | folder/file.txt | /file.txt   | 3           | 123      | link | 2042-03-25T23:59:59+0100 | file      | text/plain           |
 
 
   Scenario Outline: An user participant of the project space with space manager role can share an entity inside project space via public link
@@ -69,12 +76,18 @@ Feature: Share a file or folder that is inside a space via public link
     Then the HTTP status code should be "200"
     And the OCS status code should be "200"
     And the OCS status message should be "OK"
-    And the fields of the last response to user "Alice" should include
-      | path | <path> |
+    And the fields of the last response to user "Brian" should include
+      | item_type         | <item_type>   |
+      | mimetype          | <mimetype>    |
+      | file_target       | <file_target> |
+      | path              | /<entity>     |
+      | share_type        | public_link   |
+      | displayname_owner | %displayname% |
+      | name              | public link   |
     Examples:
-      | entity          | path      |
-      | folder          | /folder   |
-      | folder/file.txt | /file.txt |
+      | entity          | file_target | item_type | mimetype             |
+      | folder          | /folder     | folder    | httpd/unix-directory |
+      | folder/file.txt | /file.txt   | file      | text/plain           |
 
 
   Scenario Outline: An user participant of the project space without space manager role cannot share an entity inside project space via public link
@@ -130,7 +143,18 @@ Feature: Share a file or folder that is inside a space via public link
       | path        | folder/file.txt |
       | shareType   | 3               |
       | permissions | 1               |
-    Then for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt"
+    Then the fields of the last response to user "Alice" should include
+      | item_type              | file            |
+      | mimetype               | text/plain      |
+      | file_target            | /file.txt       |
+      | path                   | folder/file.txt |
+      | permissions            | 1               |
+      | share_type             | public_link     |
+      | displayname_file_owner | %displayname%   |
+      | displayname_owner      | %displayname%   |
+      | uid_file_owner         | %username%      |
+      | uid_owner              | %username%      |
+    And for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt"
     Examples:
       | spaceRole |
       | editor    |
diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php
index 7a57335933f..c4d77784ee7 100644
--- a/tests/acceptance/features/bootstrap/SpacesContext.php
+++ b/tests/acceptance/features/bootstrap/SpacesContext.php
@@ -73,6 +73,7 @@ class SpacesContext implements Context {
 	 * @var FilesVersionsContext
 	 */
 	private FilesVersionsContext $filesVersionsContext;
+
 	/**
 	 * @var string
 	 */
@@ -3088,4 +3089,33 @@ class SpacesContext implements Context {
 			}
 		}
 	}
+
+	/**
+	 * @When /^public downloads the folder "([^"]*)" from the last created public link using the public files API$/
+	 *
+	 * @param string $resource
+	 *
+	 * @return void
+	 * @throws GuzzleException|JsonException
+	 */
+	public function publicDownloadsTheFolderFromTheLastCreatedPublicLink(string $resource) {
+		$token = $this->featureContext->getLastPublicShareToken();
+		$response = $this->featureContext->listFolderAndReturnResponseXml(
+			$token,
+			$resource,
+			'0',
+			['oc:fileid'],
+			$this->featureContext->getDavPathVersion() === 1 ? "public-files" : "public-files-new"
+		);
+		$resourceId = json_decode(json_encode($response->xpath("//d:response/d:propstat/d:prop/oc:fileid")), true, 512, JSON_THROW_ON_ERROR);
+		$queryString = 'public-token=' . $token . '&id=' . $resourceId[0][0];
+		$this->featureContext->setResponse(
+			HttpRequestHelper::get(
+				$this->featureContext->getBaseUrl() . '/archiver?' . $queryString,
+				'',
+				'',
+				'',
+			)
+		);
+	}
 }