Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always allow users to create internal links, add public share tests #4633

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

micbar
Copy link
Member

@micbar micbar commented Apr 15, 2024

Description

Allow All users to create internal links.

Fixes owncloud/ocis#8960

For reviewers

This is the real code change

Tests

Running Suite: PublicShareProvider Suite - /../Development/ocis-project/reva/internal/grpc/services/publicshareprovider
================================================================================================================================
Random Seed: 1720531962

Will run 50 of 50 specs
------------------------------
PublicShareProvider Creating a PublicShare creates a public share with password
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:188
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.008 seconds]
------------------------------
PublicShareProvider Creating a PublicShare has no user permission to create public share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:215
  PASS: Stat(string,string)
  PASS: CheckPermission(string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare has permission to create internal link
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:235
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Creating a PublicShare has no share permission on the resource, can create internal link
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:265
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare fails to check create public share user permission
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:299
  PASS: Stat(string,string)
  PASS: CheckPermission(string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare has no share permission on the resource
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:313
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.004 seconds]
------------------------------
PublicShareProvider Creating a PublicShare tries to share with higher permissions than granted on the resource
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:324
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare tries to share inside a path which is not allowed
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:341
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Creating a PublicShare tries to share personal space root
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:361
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare tries to share a project space root
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:387
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Creating a PublicShare creates a new quicklink
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:418
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
  PASS: ListPublicShares(string,string,string,string)
• [0.004 seconds]
------------------------------
PublicShareProvider Creating a PublicShare creates a quicklink which already exists
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:450
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: ListPublicShares(string,string,mock.argumentMatcher,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare create public share with expiration date in the past
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:512
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare create public share with valid expiration date
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:534
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare creates a public share without a password
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:565
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.004 seconds]
------------------------------
PublicShareProvider Creating a PublicShare creates a viewable public share without a password
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:585
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare creates an editable public share without a password
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:624
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Creating a PublicShare applies the password policy even if no enforcement is configured
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:667
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Creating a PublicShare returns internal server error when share manager not functional
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:706
  PASS: CheckPermission(string,string)
  PASS: Stat(string,string)
  PASS: CreatePublicShare(string,string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Removing a PublicShare cannot load existing share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:739
  PASS: GetPublicShare(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Removing a PublicShare can remove an existing share as a creator
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:759
  PASS: GetPublicShare(string,string,string,string)
  PASS: RevokePublicShare(string,mock.argumentMatcher,mock.argumentMatcher)
• [0.002 seconds]
------------------------------
PublicShareProvider Removing a PublicShare can remove an existing share as a space manager
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:792
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
  PASS: RevokePublicShare(string,mock.argumentMatcher,mock.argumentMatcher)
• [0.002 seconds]
------------------------------
PublicShareProvider Removing a PublicShare when the user is not the owner or creator cannot remove an existing share as a space editor
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:844
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Removing a PublicShare when the user is not the owner or creator triggers an internal server error when the share manager is not available
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:869
  STEP: experiencing a share delete error in the persistence layer @ 07/09/24 15:32:48.392
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
  PASS: RevokePublicShare(string,string,string)
• [0.005 seconds]
------------------------------
PublicShareProvider Removing a PublicShare when the user is not the owner or creator triggers an internal server error when the storage provider is not functional
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:894
  STEP: experiencing a transport error when trying to stat the shared resource @ 07/09/24 15:32:48.397
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when it cannot load the existing share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:966
  PASS: GetPublicShare(string,string,string,string)
• [0.005 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when it cannot connect to the storage provider
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:992
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when it cannot find the shared resource
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1022
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when it cannot store share information
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1055
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
  PASS: UpdatePublicShare(string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when the user is neither the creator nor the owner of the share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1082
  PASS: CheckPermission(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal fails when user is neither the resource owner nor the share creator
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1126
  PASS: CheckPermission(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal succeeds
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1171
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
  PASS: UpdatePublicShare(string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare succeeds when the user downgrades a public link to internal succeeds even if the user is no manager or owner on the resource
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1206
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
  PASS: UpdatePublicShare(string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the user has not enough permissions on the resource
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1273
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the permissions client is not responding
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1292
  PASS: Stat(string,string)
  PASS: CheckPermission(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the user has no permission to write public shares and is not the creator
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1314
  PASS: CheckPermission(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the user is not the creator and has no manager or owner permissions
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1345
  PASS: Stat(string,string)
  PASS: CheckPermission(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the expiration date is in the past
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1373
  PASS: Stat(string,string)
  PASS: GetPublicShare(string,string,string,string)
• [0.005 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the password is changed to on a writable share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1389
  PASS: Stat(string,string)
  PASS: CheckPermission(string,mock.argumentMatcher)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the password is already empty on a writable share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1416
  PASS: Stat(string,string)
  PASS: CheckPermission(string,mock.argumentMatcher)
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions succeeds when the password is empty on a readable share with opt out permission
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1450
  PASS: Stat(string,string)
  PASS: CheckPermission(string,mock.argumentMatcher)
  PASS: GetPublicShare(string,string,string,string)
  PASS: UpdatePublicShare(string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user changes permissions fails when the updated password doesn't fulfil the policy
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1488
  PASS: Stat(string,string)
  PASS: CheckPermission(string,mock.argumentMatcher)
  PASS: GetPublicShare(string,string,string,string)
• [0.003 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share succeeds
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1525
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share fails when it finds no share
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1538
  PASS: GetPublicShare(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share fails when it finds no share due to internal error
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1557
  PASS: GetPublicShare(string,string,string,string)
• [0.002 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share fails when the share manager response is empty
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1576
  PASS: GetPublicShare(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share by token succeeds
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1605
  PASS: GetPublicShareByToken(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share by token fails with invalid credentials
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1617
  PASS: GetPublicShareByToken(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share by token fails with an unknown token
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1636
  PASS: GetPublicShareByToken(string,string,string,string)
• [0.001 seconds]
------------------------------
PublicShareProvider Updating a PublicShare when the user gets a public share by token fails with an unknown error
/../Development/ocis-project/reva/internal/grpc/services/publicshareprovider/publicshareprovider_test.go:1655
  PASS: GetPublicShareByToken(string,string,string,string)
• [0.001 seconds]
------------------------------

Ran 50 of 50 Specs in 0.136 seconds
SUCCESS! -- 50 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Ginkgo ran 1 suite in 6.209859979s
Test Suite Passed

Copy link

update-docs bot commented Apr 15, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@micbar micbar force-pushed the public-share-tests branch 5 times, most recently from 8a84f8b to dc8e143 Compare April 24, 2024 14:46
@micbar micbar force-pushed the public-share-tests branch 2 times, most recently from 03f6fc1 to cf2cfd7 Compare April 29, 2024 12:41
@micbar micbar force-pushed the public-share-tests branch 2 times, most recently from 65fa69a to 7ba2c3f Compare May 13, 2024 10:24
@micbar micbar force-pushed the public-share-tests branch 3 times, most recently from 558d9fb to 1225e68 Compare July 9, 2024 13:28
@micbar micbar changed the title Public share tests Always allow users to create internal links, add public share tests Jul 9, 2024
@micbar micbar marked this pull request as ready for review July 9, 2024 13:40
@micbar micbar requested review from labkode, glpatcern and a team as code owners July 9, 2024 13:40
@micbar micbar force-pushed the public-share-tests branch 3 times, most recently from e3efef7 to 5270bd3 Compare July 9, 2024 13:51
@micbar micbar force-pushed the public-share-tests branch 2 times, most recently from d421d5d to e5aca7b Compare July 29, 2024 12:42
@micbar micbar merged commit 56e15d7 into cs3org:edge Jul 29, 2024
9 of 10 checks passed
@micbar micbar deleted the public-share-tests branch July 29, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants