sharings

package
v0.0.0-...-3f4c8ed Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 25 Imported by: 1

Documentation

Overview

Package sharings is the HTTP routes for the sharing. We have two types of routes, some routes are used by the clients to create, list, revoke sharings and add/remove recipients, and other routes are reserved for an internal usage, mostly to synchronize the documents between the Cozys of the members of the sharings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInvitationDelegated

func AddInvitationDelegated(c echo.Context) error

AddInvitationDelegated is when a member has been added to a sharing via a group, but is invited only later (no email or Cozy instance known when they was added).

func AddReadOnly

func AddReadOnly(c echo.Context) error

AddReadOnly is used to downgrade a read-write member to read-only

func AddRecipients

func AddRecipients(c echo.Context) error

AddRecipients is used to add a member to a sharing

func AddRecipientsDelegated

func AddRecipientsDelegated(c echo.Context) error

AddRecipientsDelegated is used to add members and groups to a sharing on the owner's cozy when it's the recipient's cozy that sends the mail invitation.

func AnswerSharing

func AnswerSharing(c echo.Context) error

AnswerSharing is used to exchange credentials between 2 cozys, after the recipient has accepted a sharing.

func BulkDocs

func BulkDocs(c echo.Context) error

BulkDocs is part of the replicator

func ChangeCozyAddress

func ChangeCozyAddress(c echo.Context) error

ChangeCozyAddress is called when a Cozy has been moved to a new address.

func ClearAppInURL

func ClearAppInURL(cozyURL string) string

ClearAppInURL will remove the app slug from the URL of a Cozy. Example: https://john-drive.mycozy.cloud/ -> https://john.mycozy.cloud/

func CountNewShortcuts

func CountNewShortcuts(c echo.Context) error

CountNewShortcuts returns the number of shortcuts to a sharing that have not been seen.

func CreateSharing

func CreateSharing(c echo.Context) error

CreateSharing initializes a new sharing (on the sharer)

func DowngradeToReadOnly

func DowngradeToReadOnly(c echo.Context) error

DowngradeToReadOnly is used to receive the credentials for pushing last changes on an instance of a recipient before going to read-only mode

func EndInitial

func EndInitial(c echo.Context) error

EndInitial is used for ending the initial sync phase of a sharing

func FileHandler

func FileHandler(c echo.Context) error

FileHandler is used to receive a file upload

func GetAvatar

func GetAvatar(c echo.Context) error

GetAvatar returns the avatar of the given member of the sharing.

func GetDiscovery

func GetDiscovery(c echo.Context) error

GetDiscovery displays a form where a recipient can give the address of their cozy instance

func GetFolder

func GetFolder(c echo.Context) error

GetFolder returns informations about a folder

func GetPreviewURL

func GetPreviewURL(c echo.Context) error

GetPreviewURL returns the preview URL for the member identified by their state parameter.

func GetSharing

func GetSharing(c echo.Context) error

GetSharing returns the sharing document associated to the given sharingID and which documents have been shared. The requester must have the permission on at least one doctype declared in the sharing document.

func GetSharingsInfoByDocType

func GetSharingsInfoByDocType(c echo.Context) error

GetSharingsInfoByDocType returns, for a given doctype, all the sharing information, i.e. the involved sharings and the shared documents

func PostDiscovery

func PostDiscovery(c echo.Context) error

PostDiscovery is called when the recipient has given its Cozy URL. Either an error is returned or the recipient will be redirected to their cozy.

Note: we don't have an anti-CSRF system, we rely on shareCode being secret.

func PutRecipients

func PutRecipients(c echo.Context) error

PutRecipients is used to update the members list on the recipients cozy

func PutSharing

func PutSharing(c echo.Context) error

PutSharing creates a sharing request (on the recipient's cozy)

func ReceivePublicKey

func ReceivePublicKey(c echo.Context) error

ReceivePublicKey is used to receive the public key of a sharing member. It can be used when the member has delegated authentication, and didn't have a password when they accepted the sharing: this route is called when the user choose a password a bit later in cozy pass web.

func RemoveMemberFromGroup

func RemoveMemberFromGroup(c echo.Context) error

RemoveMemberFromGroup is used to remove a member from a group (delegated).

func RemoveReadOnly

func RemoveReadOnly(c echo.Context) error

RemoveReadOnly is used to give read-write to a member that had the read-only flag

func ReuploadHandler

func ReuploadHandler(c echo.Context) error

ReuploadHandler is used to try sending again files

func RevocationOwnerNotif

func RevocationOwnerNotif(c echo.Context) error

RevocationOwnerNotif is used to inform the owner that a recipient has revoked himself/herself from the sharing

func RevocationRecipientNotif

func RevocationRecipientNotif(c echo.Context) error

RevocationRecipientNotif is used to inform a recipient that the sharing is revoked

func RevokeGroup

func RevokeGroup(c echo.Context) error

RevokeGroup is used by the owner to revoke a group

func RevokeRecipient

func RevokeRecipient(c echo.Context) error

RevokeRecipient is used by the owner to revoke a recipient

func RevokeRecipientBySelf

func RevokeRecipientBySelf(c echo.Context) error

RevokeRecipientBySelf is used by a recipient to revoke himself/herself from the sharing

func RevokeSharing

func RevokeSharing(c echo.Context) error

RevokeSharing is used to revoke a sharing by the sharer, for all recipients

func RevsDiff

func RevsDiff(c echo.Context) error

RevsDiff is part of the replicator

func Routes

func Routes(router *echo.Group)

Routes sets the routing for the sharing service

func SyncFile

func SyncFile(c echo.Context) error

SyncFile will try to synchronize a file from just its metadata. If it's not possible, it will respond with a key that allow to send the content to finish the synchronization.

func UpgradeToReadWrite

func UpgradeToReadWrite(c echo.Context) error

UpgradeToReadWrite is used to receive the credentials for pushing updates on an instance of a recipient that was in read-only mode

Types

This section is empty.

Jump to

Keyboard shortcuts

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