fix tests

This commit is contained in:
Roman Perekhod
2023-05-05 12:39:25 +02:00
parent d69decdafe
commit 5fbee63f09
6 changed files with 18 additions and 14 deletions

2
go.sum
View File

@@ -629,8 +629,6 @@ 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.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 h1:KJHTdnQpEB3hcOSNXtMFedAvplpNRepo3RPArWFiSYo=
github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=

View File

@@ -51,7 +51,7 @@ Feature: Change data of space
Scenario Outline: user other than space manager role can't change the name of a Space via the Graph API
When user "<user>" changes the name of the "Project Jupiter" space to "Project Jupiter"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Examples:
| user |
| Brian |
@@ -90,7 +90,7 @@ Feature: Change data of space
Scenario Outline: viewer and editor cannot change the description(subtitle) of a space via the Graph API
When user "<user>" changes the description of the "Project Jupiter" space to "The Death Star is a fictional mobile space station"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Examples:
| user |
| Brian |
@@ -334,7 +334,7 @@ Feature: Change data of space
Given user "Alice" has created a folder ".space" in space "Project Jupiter"
And user "Alice" has uploaded a file inside space "Project Jupiter" with content "" to ".space/someImageFile.jpg"
When user "Bob" sets the file ".space/someImageFile.jpg" as a space image in a special section of the "Project Jupiter" space
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Scenario Outline: user set new readme file as description of the space via the graph API

View File

@@ -41,7 +41,7 @@ Feature: Disabling and deleting space
Scenario Outline: user with role user and guest cannot disable other space via the Graph API
Given the administrator has given "Carol" the role "<role>" using the settings api
When user "Carol" tries to disable a space "Project Moon" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
And the user "Brian" should have a space called "Project Moon"
And the user "Bob" should have a space called "Project Moon"
Examples:
@@ -115,7 +115,7 @@ Feature: Disabling and deleting space
Given the administrator has given "Carol" the role "<role>" using the settings api
And user "Alice" has disabled a space "Project Moon"
When user "Carol" tries to delete a space "Project Moon" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Examples:
| role |
| User |

View File

@@ -113,7 +113,7 @@ Feature: Space management
Scenario: user without space admin permission tries to change the name of the project space
When user "Carol" tries to change the name of the "Project" space to "New Name" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
And the user "Alice" should have a space called "Project"
@skipOnStable2.0
@@ -140,7 +140,7 @@ Feature: Space management
Scenario: user without space admin permission tries to change the description of the project space
Given user "Alice" has changed the description of the "Project" space to "old description"
When user "Carol" tries to change the description of the "Project" space to "New description" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
@skipOnStable2.0
Scenario: space admin user disables the project space
@@ -151,12 +151,12 @@ Feature: Space management
Scenario: user without space admin permission tries to disable the project space
When user "Carol" tries to disable a space "Project" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Scenario Outline: space admin user tries to disable the personal space
When user "<user>" disables a space "Alice Hansen" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
Examples:
| user |
| Brian |
@@ -173,7 +173,7 @@ Feature: Space management
Scenario: user without space admin permission tries to delete the project space
Given user "Alice" has disabled a space "Project"
When user "Carol" tries to delete a space "Project" owned by user "Alice"
Then the HTTP status code should be "403"
Then the HTTP status code should be "404"
@skipOnStable2.0
Scenario: space admin user enables the project space

View File

@@ -599,13 +599,18 @@ func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteSt
if err != nil || len(spaces) != 1 {
var st *rpc.Status
switch err.(type) {
case errtypes.IsNotFound, errtypes.PermissionDenied:
case errtypes.IsNotFound:
st = status.NewNotFound(ctx, "not found when deleting space")
case errtypes.PermissionDenied:
st = status.NewPermissionDenied(ctx, err, "permission denied")
case errtypes.BadRequest:
st = status.NewInvalid(ctx, err.Error())
default:
st = status.NewInternal(ctx, "error deleting space: "+req.Id.String())
}
if len(spaces) == 0 {
st = status.NewNotFound(ctx, "not found when deleting space")
}
return &provider.DeleteStorageSpaceResponse{
Status: st,
}, nil

3
vendor/modules.txt vendored
View File

@@ -349,7 +349,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0
# github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885
## explicit; go 1.19
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime
@@ -2124,3 +2124,4 @@ stash.kopano.io/kgol/oidc-go
## explicit; go 1.13
stash.kopano.io/kgol/rndm
# github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35
# github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885