publicshare

package
v1.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSignature added in v0.0.2

func AddSignature(share *link.PublicShare, pw string) error

AddSignature augments a public share with a signature. The signature has a validity of 30 minutes.

func CreateSignature added in v0.0.2

func CreateSignature(token, pw string, expiration time.Time) (string, error)

CreateSignature calculates a signature for a public share.

func GroupFiltersByType added in v0.0.2

GroupFiltersByType groups the given filters and returns a map using the filter type as the key.

func IsExpired added in v0.0.2

func IsExpired(s *link.PublicShare) bool

IsExpired tests whether a public share is expired.

func MatchesAnyFilter added in v0.0.2

func MatchesAnyFilter(share *link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool

MatchesAnyFilter checks if the share passes at least one of the given filters.

func MatchesFilter added in v0.0.2

func MatchesFilter(share *link.PublicShare, filter *link.ListPublicSharesRequest_Filter) bool

MatchesFilter tests if the share passes the filter.

func MatchesFilters added in v0.0.2

func MatchesFilters(share *link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool

MatchesFilters checks if the share passes the given filters. Filters of the same type form a disjuntion, a logical OR. Filters of separate type form a conjunction, a logical AND. Here is an example: (resource_id=1 OR resource_id=2) AND (grantee_type=USER OR grantee_type=GROUP).

func ResourceIDFilter added in v0.0.2

ResourceIDFilter is an abstraction for creating filter by resource id.

Types

type Manager

type Manager interface {
	CreatePublicShare(ctx context.Context, u *user.User, md *provider.ResourceInfo, g *link.Grant, description string, internal bool, notifyUploads bool, notifyUploadsExtraRecipients string) (*link.PublicShare, error)
	UpdatePublicShare(ctx context.Context, u *user.User, req *link.UpdatePublicShareRequest, g *link.Grant) (*link.PublicShare, error)
	GetPublicShare(ctx context.Context, u *user.User, ref *link.PublicShareReference, sign bool) (*link.PublicShare, error)
	ListPublicShares(ctx context.Context, u *user.User, filters []*link.ListPublicSharesRequest_Filter, md *provider.ResourceInfo, sign bool) ([]*link.PublicShare, error)
	RevokePublicShare(ctx context.Context, u *user.User, ref *link.PublicShareReference) error
	GetPublicShareByToken(ctx context.Context, token string, auth *link.PublicShareAuthentication, sign bool) (*link.PublicShare, error)
}

Manager manipulates public shares.

Directories

Path Synopsis
manager
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL