Skip to content

Commit

Permalink
WIP sharing NG links
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Nov 8, 2023
1 parent 715bd78 commit 7a0869a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ import (

rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/v2/pkg/appctx"
ctxpkg "github.com/cs3org/reva/v2/pkg/ctx"
"github.com/cs3org/reva/v2/pkg/errtypes"
"github.com/cs3org/reva/v2/pkg/publicshare"
"github.com/cs3org/reva/v2/pkg/publicshare/manager/registry"
"github.com/cs3org/reva/v2/pkg/rgrpc"
"github.com/cs3org/reva/v2/pkg/rgrpc/status"
"github.com/cs3org/reva/v2/pkg/utils"
"github.com/mitchellh/mapstructure"
graph "github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/errorcode"
"github.com/pkg/errors"
"google.golang.org/grpc"
)
Expand All @@ -44,6 +47,7 @@ type config struct {
Driver string `mapstructure:"driver"`
Drivers map[string]map[string]interface{} `mapstructure:"drivers"`
AllowedPathsForShares []string `mapstructure:"allowed_paths_for_shares"`
EnableExpiredSharesCleanup bool `mapstructure:"enable_expired_shares_cleanup"`
WriteableShareMustHavePassword bool `mapstructure:"writeable_share_must_have_password"`
}

Expand Down Expand Up @@ -159,10 +163,12 @@ func (s *service) CreatePublicShare(ctx context.Context, req *link.CreatePublicS
if err != nil {
log.Debug().Err(err).Str("createShare", "shares").Msg("error connecting to storage provider")
}

opaque := &typesv1beta1.Opaque{Map: map[string]*typesv1beta1.OpaqueEntry{}}
opaque = utils.AppendJSONToOpaque(opaque, "errorcode", graph.New(graph.InvalidAuthenticationToken, "test"))
res := &link.CreatePublicShareResponse{
Status: status.NewOK(ctx),
Share: share,
Opaque: opaque,
}
return res, nil
}
Expand Down

0 comments on commit 7a0869a

Please sign in to comment.