Documentation ¶
Overview ¶
Package nextcloud verifies a clientID and clientSecret against a Nextcloud backend.
Index ¶
- func GetNextcloudServerMock(called *[]string) http.Handler
- func New(m map[string]interface{}) (share.Manager, error)
- func TestingHTTPClient(handler http.Handler) (*http.Client, func())
- type Action
- type GranteeAltMap
- type Manager
- func (sm *Manager) GetReceivedShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.ReceivedShare, error)
- func (sm *Manager) GetShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.Share, error)
- func (sm *Manager) ListReceivedShares(ctx context.Context) ([]*ocm.ReceivedShare, error)
- func (sm *Manager) ListShares(ctx context.Context, filters []*ocm.ListOCMSharesRequest_Filter) ([]*ocm.Share, error)
- func (sm *Manager) SetHTTPClient(c *http.Client)
- func (sm *Manager) Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGrant, name string, ...) (*ocm.Share, error)
- func (sm *Manager) Unshare(ctx context.Context, ref *ocm.ShareReference) error
- func (sm Manager) UpdateReceivedShare(ctx context.Context, receivedShare *ocm.ReceivedShare, ...) (*ocm.ReceivedShare, error)
- func (sm *Manager) UpdateShare(ctx context.Context, ref *ocm.ShareReference, p *ocm.SharePermissions) (*ocm.Share, error)
- type ReceivedShareAltMap
- type Response
- type ShareAltMap
- type ShareManagerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNextcloudServerMock ¶
GetNextcloudServerMock returns a handler that pretends to be a remote Nextcloud server
func TestingHTTPClient ¶
TestingHTTPClient thanks to https://itnext.io/how-to-stub-requests-to-remote-hosts-with-go-6c2c1db32bf2 Ideally, this function would live in tests/helpers, but if we put it there, it gets excluded by .dockerignore, and the Docker build fails (see https://github.com/cs3org/reva/issues/1999) So putting it here for now - open to suggestions if someone knows a better way to inject this.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action describes a REST request to forward to the Nextcloud backend
type GranteeAltMap ¶
type GranteeAltMap struct {
ID *provider.Grantee_UserId `json:"id"`
}
GranteeAltMap is an alternative map to JSON-unmarshal a Grantee Grantees are hard to unmarshal, so unmarshalling into a map[string]interface{} first, see also https://github.com/pondersource/sciencemesh-nextcloud/issues/27
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the Nextcloud-based implementation of the share.Manager interface see https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func NewShareManager ¶
func NewShareManager(c *ShareManagerConfig) (*Manager, error)
NewShareManager returns a new Nextcloud-based ShareManager
func (*Manager) GetReceivedShare ¶
func (sm *Manager) GetReceivedShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.ReceivedShare, error)
GetReceivedShare as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L29-L54
func (*Manager) GetShare ¶
GetShare as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func (*Manager) ListReceivedShares ¶
ListReceivedShares as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func (*Manager) ListShares ¶
func (sm *Manager) ListShares(ctx context.Context, filters []*ocm.ListOCMSharesRequest_Filter) ([]*ocm.Share, error)
ListShares as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func (*Manager) SetHTTPClient ¶
SetHTTPClient sets the HTTP client
func (*Manager) Share ¶
func (sm *Manager) Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGrant, name string, pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string, st ocm.Share_ShareType) (*ocm.Share, error)
Share is called from both grpc CreateOCMShare for outgoing and http /ocm/shares for incoming pi is provider info pm is permissions
func (*Manager) Unshare ¶
Unshare as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func (Manager) UpdateReceivedShare ¶
func (sm Manager) UpdateReceivedShare(ctx context.Context, receivedShare *ocm.ReceivedShare, fieldMask *field_mask.FieldMask) (*ocm.ReceivedShare, error)
UpdateReceivedShare as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
func (*Manager) UpdateShare ¶
func (sm *Manager) UpdateShare(ctx context.Context, ref *ocm.ShareReference, p *ocm.SharePermissions) (*ocm.Share, error)
UpdateShare as defined in the ocm.share.Manager interface https://github.com/cs3org/reva/blob/v1.13.0/pkg/ocm/share/share.go#L30-L57
type ReceivedShareAltMap ¶
type ReceivedShareAltMap struct {}
ReceivedShareAltMap is an alternative map to JSON-unmarshal a ReceivedShare
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response contains data for the Nextcloud mock server to respond and to switch to a new server state
type ShareAltMap ¶
type ShareAltMap struct {}
ShareAltMap is an alternative map to JSON-unmarshal a Share
type ShareManagerConfig ¶
type ShareManagerConfig struct {}
ShareManagerConfig contains config for a Nextcloud-based ShareManager