Skip to content

Add support for mail grantees#2717

Draft
aduffeck wants to merge 1 commit intoopencloud-eu:feature/guest-linksfrom
aduffeck:persist-guest-shares
Draft

Add support for mail grantees#2717
aduffeck wants to merge 1 commit intoopencloud-eu:feature/guest-linksfrom
aduffeck:persist-guest-shares

Conversation

@aduffeck
Copy link
Copy Markdown
Member

@aduffeck aduffeck commented May 5, 2026

This PR implements sharing with email addresses as per #2516

Depends on opencloud-eu/reva#616

httpyacs for testing:

###
// @title initiate first upload
// @name upload1
{{
  $global.filename=new Buffer($random.alphabetic(50)+'.txt', 'utf-8').toString('base64')
  console.log("Generating new filename: " + $global.filename);
}}

### get personal drive
# @name personaldrive
GET {{host}}/graph/v1.0/me/drive?$select=id
Authorization: Basic {{username}}:{{password}}

### Upload file
PUT {{host}}/remote.php/dav/spaces/{{personaldrive.id}}/{{$global.filename}}
Authorization: Basic {{username}}:{{password}}
X-OC-Mtime: 1565233093
Content-Type: text/plain

uploaded content

?? status == 201

### Get file id
PROPFIND {{host}}/remote.php/dav/spaces/{{personaldrive.id}}/{{$global.filename}}
Authorization: Basic {{username}}:{{password}}
?? status == 207
{{

    const {select} = require("xpath");
    try{
        $global.fileid = select("//*[local-name(.)='id']/text()", response.parsedBody)[0].nodeValue;
    }catch(err){
        console.error(err);
    }
    console.log("id:", $global.fileid)    ;
}}

### Get viewer role
# @name roles
GET {{host}}/graph/v1beta1/roleManagement/permissions/roleDefinitions
Authorization: Basic {{username}}:{{password}}
?? status == 200


### Invite a single guest using an email address
POST {{host}}/graph/v1beta1/drives/{{personaldrive.id}}/items/{{$global.fileid}}/invite
Authorization: Basic {{username}}:{{password}}
Content-Type: application/json

{
    "recipients": [
        {
            "objectId": "some.guest@example.com",
            "@libre.graph.recipient.type": "mail"
        }
    ],
    "roles": ["{{roles[0].id}}"]
}


### List existing shares
# @name listshares
GET {{host}}/graph/v1beta1/drives/{{personaldrive.id}}/items/{{$global.fileid}}/permissions
Authorization: Basic {{username}}:{{password}}
?? status == 200
{{
    const shares = response.parsedBody.value;
    $global.shareId = shares[0].id;
}}

### Update permission role
PATCH {{host}}/graph/v1beta1/drives/{{personaldrive.id}}/items/{{$global.fileid}}/permissions/{{$global.shareId}}
Authorization: Basic {{username}}:{{password}}
Content-Type: application/json

{
    "roles": ["{{roles[0].id}}"]
}
?? status == 200


@aduffeck aduffeck changed the base branch from main to feature/guest-links May 6, 2026 06:27
@aduffeck aduffeck force-pushed the persist-guest-shares branch from 523e1e9 to 7c862e4 Compare May 6, 2026 07:07
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
13.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant