Documentation ¶
Index ¶
- Constants
- func AddSignature(share *link.PublicShare, pw string) error
- func Authenticate(share *link.PublicShare, pw string, auth *link.PublicShareAuthentication) bool
- func CreateSignature(token, pw string, expiration time.Time) (string, error)
- func GroupFiltersByType(filters []*link.ListPublicSharesRequest_Filter) ...
- func IsCreatedByUser(share link.PublicShare, user *user.User) bool
- func IsExpired(s link.PublicShare) bool
- func IsWriteable(perm *link.PublicSharePermissions) bool
- func MatchesAnyFilter(share link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool
- func MatchesFilter(share link.PublicShare, filter *link.ListPublicSharesRequest_Filter) bool
- func MatchesFilters(share link.PublicShare, filters []*link.ListPublicSharesRequest_Filter) bool
- func ResourceIDFilter(id *provider.ResourceId) *link.ListPublicSharesRequest_Filter
- func StorageIDFilter(id string) *link.ListPublicSharesRequest_Filter
- type DumpableManager
- type LoadableManager
- type Manager
- type WithPassword
Constants ¶
const ( // StorageIDFilterType defines a new filter type for storage id. // TODO: Remove this once the filter type is in the CS3 API. StorageIDFilterType link.ListPublicSharesRequest_Filter_Type = 4 )
Variables ¶
This section is empty.
Functions ¶
func AddSignature ¶
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 Authenticate ¶ added in v2.1.0
func Authenticate(share *link.PublicShare, pw string, auth *link.PublicShareAuthentication) bool
Authenticate checks the signature or password authentication for a public share
func CreateSignature ¶
CreateSignature calculates a signature for a public share.
func GroupFiltersByType ¶
func GroupFiltersByType(filters []*link.ListPublicSharesRequest_Filter) map[link.ListPublicSharesRequest_Filter_Type][]*link.ListPublicSharesRequest_Filter
GroupFiltersByType groups the given filters and returns a map using the filter type as the key.
func IsCreatedByUser ¶ added in v2.2.0
func IsCreatedByUser(share link.PublicShare, user *user.User) bool
IsCreatedByUser checks if a share was created by the user.
func IsExpired ¶
func IsExpired(s link.PublicShare) bool
IsExpired tests whether a public share is expired
func IsWriteable ¶ added in v2.13.0
func IsWriteable(perm *link.PublicSharePermissions) bool
IsWriteable checks if the grant for a publicshare allows writes or uploads.
func MatchesAnyFilter ¶
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 ¶
func MatchesFilter(share link.PublicShare, filter *link.ListPublicSharesRequest_Filter) bool
MatchesFilter tests if the share passes the filter.
func MatchesFilters ¶
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 ¶
func ResourceIDFilter(id *provider.ResourceId) *link.ListPublicSharesRequest_Filter
ResourceIDFilter is an abstraction for creating filter by resource id.
func StorageIDFilter ¶
func StorageIDFilter(id string) *link.ListPublicSharesRequest_Filter
StorageIDFilter is an abstraction for creating filter by storage id.
Types ¶
type DumpableManager ¶ added in v2.6.0
type DumpableManager interface {
Dump(ctx context.Context, shareChan chan<- *WithPassword) error
}
DumpableManager defines a share manager which supports dumping its contents
type LoadableManager ¶ added in v2.6.0
type LoadableManager interface {
Load(ctx context.Context, shareChan <-chan *WithPassword) error
}
LoadableManager defines a share manager which supports loading contents from a dump
type WithPassword ¶ added in v2.6.0
type WithPassword struct { Password string `json:"password"` }
WithPassword holds the relevant information for representing a public share
Directories ¶
Path | Synopsis |
---|---|
manager
|
|
owncloudsql
Package owncloudsql implements a publiclink share manager backed by an existing ownCloud 10 database
|
Package owncloudsql implements a publiclink share manager backed by an existing ownCloud 10 database |