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

Sharestorageprovider oc10 sm #2023

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f1ed2e4
Add a sharesstorageprovider
aduffeck Aug 3, 2021
1a6b767
Refactor LDAP driver in userprovider
rhafer Oct 5, 2021
2a8affc
Fix the templating when resolving dav URLs
aduffeck Oct 7, 2021
774ce44
Fix listing shares using the SQL manager
aduffeck Oct 7, 2021
277332c
Fix gateway drone config
aduffeck Oct 7, 2021
98f7aec
Adapt ldap config in drone
aduffeck Oct 8, 2021
550c937
Add changelog
aduffeck Oct 8, 2021
245281e
Remove now passing tests from the expected failure file
aduffeck Oct 8, 2021
e02af92
ocdav: Use GetUserByClaim to lookup user by name
rhafer Oct 7, 2021
683f68f
Accept all shares to the same resource when accepting one of them
aduffeck Oct 14, 2021
37e4944
Auto-accept a share if there already is an accepted one to that resource
aduffeck Oct 15, 2021
a9bb9fa
Make hound happy
aduffeck Oct 15, 2021
ed66df4
Make a "machine" type authprovider available in the acceptance tests
aduffeck Oct 22, 2021
3402798
Accept user shares if there's another accepted share to this resource
aduffeck Oct 22, 2021
33fcecf
Fix starting all services
aduffeck Oct 25, 2021
39126a5
Make sure to always send a proper response when creating public shares
aduffeck Oct 25, 2021
1cdc183
Fix s3ng acceptance tests
aduffeck Oct 25, 2021
7881205
Adapt expected failures
aduffeck Oct 25, 2021
5f8edba
Do not allow cross-storage restores
aduffeck Oct 26, 2021
958f9b2
Fix expected failures for s3ng
aduffeck Oct 26, 2021
028b279
Be more robust when handling error cases
aduffeck Oct 27, 2021
4f0949d
WIP: Fix restoring recycle items
aduffeck Oct 27, 2021
a5ca0f3
Fix unit tests
aduffeck Oct 27, 2021
df6021e
Fix license headers
aduffeck Oct 27, 2021
a00d562
Fix linter issues
aduffeck Oct 27, 2021
606bfc4
Merge branch 'master' into sharestorageprovider-oc10-sm
butonic Nov 4, 2021
38d8d72
add missing go.sum entry
butonic Nov 4, 2021
e5bcf1e
fix import
butonic Nov 4, 2021
5b5f8ed
add embedded mounts when listing /home
butonic Nov 4, 2021
4e257e8
remove unexpected passes
butonic Nov 4, 2021
d615470
add old logic as comment as we want to bring parts of it back for OCM
butonic Nov 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@ def ocisIntegrationTests(parallelRuns, skipExceptParts = []):
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-oc-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink-ocis.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
"/drone/src/cmd/revad/revad -c storage-shares.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml &",
"/drone/src/cmd/revad/revad -c machine-auth.toml",
],
},
cloneOc10TestReposStep(),
Expand Down Expand Up @@ -821,7 +823,9 @@ def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):
"/drone/src/cmd/revad/revad -c storage-home-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-oc-s3ng.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink-s3ng.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
"/drone/src/cmd/revad/revad -c storage-shares.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml &",
"/drone/src/cmd/revad/revad -c machine-auth.toml",
],
},
cloneOc10TestReposStep(),
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/sharestorageprovider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: Add a sharestorageprovider

This PR adds a ShareStorageProvider which enables us to get rid of a lot of special casing in other parts of the code. It also fixes several issues regarding shares and group shares.

https://github.com/cs3org/reva/pull/2023
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/go-openapi/errors v0.20.1 // indirect
github.com/go-openapi/strfmt v0.20.2 // indirect
github.com/go-sql-driver/mysql v1.6.0
github.com/gogo/protobuf v1.3.2
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.2
github.com/gomodule/redigo v1.8.5
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
Expand Down
10 changes: 0 additions & 10 deletions internal/grpc/services/gateway/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@ func (s *svc) OpenInApp(ctx context.Context, req *gateway.OpenInAppRequest) (*pr
}, nil
}

if s.isSharedFolder(ctx, p) {
return &providerpb.OpenInAppResponse{
Status: status.NewInvalid(ctx, "gateway: can't open shares folder"),
}, nil
}

resName, resChild := p, ""
if s.isShareChild(ctx, p) {
resName, resChild = s.splitShare(ctx, p)
}

statRes, err := s.stat(ctx, &storageprovider.StatRequest{
Ref: &storageprovider.Reference{Path: resName},
})
Expand Down
43 changes: 22 additions & 21 deletions internal/grpc/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,28 @@ func init() {
}

type config struct {
AuthRegistryEndpoint string `mapstructure:"authregistrysvc"`
ApplicationAuthEndpoint string `mapstructure:"applicationauthsvc"`
StorageRegistryEndpoint string `mapstructure:"storageregistrysvc"`
AppRegistryEndpoint string `mapstructure:"appregistrysvc"`
PreferencesEndpoint string `mapstructure:"preferencessvc"`
UserShareProviderEndpoint string `mapstructure:"usershareprovidersvc"`
PublicShareProviderEndpoint string `mapstructure:"publicshareprovidersvc"`
OCMShareProviderEndpoint string `mapstructure:"ocmshareprovidersvc"`
OCMInviteManagerEndpoint string `mapstructure:"ocminvitemanagersvc"`
OCMProviderAuthorizerEndpoint string `mapstructure:"ocmproviderauthorizersvc"`
OCMCoreEndpoint string `mapstructure:"ocmcoresvc"`
UserProviderEndpoint string `mapstructure:"userprovidersvc"`
GroupProviderEndpoint string `mapstructure:"groupprovidersvc"`
DataTxEndpoint string `mapstructure:"datatx"`
DataGatewayEndpoint string `mapstructure:"datagateway"`
CommitShareToStorageGrant bool `mapstructure:"commit_share_to_storage_grant"`
CommitShareToStorageRef bool `mapstructure:"commit_share_to_storage_ref"`
DisableHomeCreationOnLogin bool `mapstructure:"disable_home_creation_on_login"`
TransferSharedSecret string `mapstructure:"transfer_shared_secret"`
TransferExpires int64 `mapstructure:"transfer_expires"`
TokenManager string `mapstructure:"token_manager"`
StorageRules map[string]map[string]interface{} `mapstructure:"storage_rules"`
AuthRegistryEndpoint string `mapstructure:"authregistrysvc"`
ApplicationAuthEndpoint string `mapstructure:"applicationauthsvc"`
StorageRegistryEndpoint string `mapstructure:"storageregistrysvc"`
AppRegistryEndpoint string `mapstructure:"appregistrysvc"`
PreferencesEndpoint string `mapstructure:"preferencessvc"`
UserShareProviderEndpoint string `mapstructure:"usershareprovidersvc"`
PublicShareProviderEndpoint string `mapstructure:"publicshareprovidersvc"`
OCMShareProviderEndpoint string `mapstructure:"ocmshareprovidersvc"`
OCMInviteManagerEndpoint string `mapstructure:"ocminvitemanagersvc"`
OCMProviderAuthorizerEndpoint string `mapstructure:"ocmproviderauthorizersvc"`
OCMCoreEndpoint string `mapstructure:"ocmcoresvc"`
UserProviderEndpoint string `mapstructure:"userprovidersvc"`
GroupProviderEndpoint string `mapstructure:"groupprovidersvc"`
DataTxEndpoint string `mapstructure:"datatx"`
DataGatewayEndpoint string `mapstructure:"datagateway"`
CommitShareToStorageGrant bool `mapstructure:"commit_share_to_storage_grant"`
CommitShareToStorageRef bool `mapstructure:"commit_share_to_storage_ref"`
DisableHomeCreationOnLogin bool `mapstructure:"disable_home_creation_on_login"`
TransferSharedSecret string `mapstructure:"transfer_shared_secret"`
TransferExpires int64 `mapstructure:"transfer_expires"`
TokenManager string `mapstructure:"token_manager"`
// ShareFolder is the location where to create shares in the recipient's storage provider.
ShareFolder string `mapstructure:"share_folder"`
DataTransfersFolder string `mapstructure:"data_transfers_folder"`
Expand Down
5 changes: 0 additions & 5 deletions internal/grpc/services/gateway/publicshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ import (
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/errtypes"
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
"github.com/pkg/errors"
)

func (s *svc) CreatePublicShare(ctx context.Context, req *link.CreatePublicShareRequest) (*link.CreatePublicShareResponse, error) {
if s.isSharedFolder(ctx, req.ResourceInfo.GetPath()) {
return nil, errtypes.AlreadyExists("gateway: can't create a public share of the share folder itself")
}

log := appctx.GetLogger(ctx)
log.Info().Msg("create public share")

Expand Down
Loading