Skip to content

Commit

Permalink
OpenFileInAppProvider enhancements (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Jul 30, 2020
1 parent 9dc7f2a commit bde32fc
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 42 deletions.
32 changes: 15 additions & 17 deletions cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import "cs3/types/v1beta1/types.proto";
// Any method MAY return UNKNOWN.
// Any method MAY return UNAUTHENTICATED.
service ProviderAPI {
// Returns the iframe url
// Returns the App provider URL
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenFileInAppProvider(OpenFileInAppProviderRequest) returns (OpenFileInAppProviderResponse);
}
Expand All @@ -62,19 +62,8 @@ message OpenFileInAppProviderRequest {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The resource reference. If a path is given, it will be resolved via Stat() to a ResourceId
// when a call to the WOPI server is to be issued.
storage.provider.v1beta1.Reference ref = 2;
// REQUIRED.
// The access token this application provider will use when contacting
// the storage provider to read and write.
// Service implementors MUST make sure that the access token only grants
// access to the requested resource.
// Service implementors should use a ResourceId rather than a filename to grant access, as
// ResourceIds MUST NOT change when a resource is renamed.
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 3;
// The resourceInfo to be opened. The gateway grpc message has a ref instead.
storage.provider.v1beta1.ResourceInfo resource_info = 2;
// REQUIRED.
// View mode.
enum ViewMode {
Expand All @@ -86,7 +75,17 @@ message OpenFileInAppProviderRequest {
// The file can be downloaded and updated.
VIEW_MODE_READ_WRITE = 3;
}
ViewMode view_mode = 4;
ViewMode view_mode = 3;
// REQUIRED.
// The access token this application provider will use when contacting
// the storage provider to read and write.
// Service implementors MUST make sure that the access token only grants
// access to the requested resource.
// Service implementors should use a ResourceId rather than a filename to grant access, as
// ResourceIds MUST NOT change when a resource is renamed.
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 4;
}

message OpenFileInAppProviderResponse {
Expand All @@ -98,7 +97,6 @@ message OpenFileInAppProviderResponse {
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The url that user agents will render to clients.
// Usually the rendering happens by using HTML iframes,
// at least, Office 365, Collabora, OnlyOffice do like that.
// Usually the rendering happens by using HTML iframes or in separate browser tabs.
string app_provider_url = 3;
}
26 changes: 24 additions & 2 deletions cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ service GatewayAPI {
// ************************ APP PROVIDER ********************/
// *****************************************************************/

// Returns the iframe url from the WOPI server. The iframe url will let you open the document in the correct online document editor.
rpc OpenFileInAppProvider(cs3.app.provider.v1beta1.OpenFileInAppProviderRequest) returns (cs3.app.provider.v1beta1.OpenFileInAppProviderResponse);
// Returns the App provider URL, which lets the user open a file in the correct online document editor.
rpc OpenFileInAppProvider(OpenFileInAppProviderRequest) returns (cs3.app.provider.v1beta1.OpenFileInAppProviderResponse);
// *****************************************************************/
// ************************ USER SHARE PROVIDER ********************/
// *****************************************************************/
Expand Down Expand Up @@ -488,3 +488,25 @@ message ListAuthProvidersResponse {
// TODO(labkode): maybe add description?
repeated string types = 3;
}

message OpenFileInAppProviderRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The resource reference. If a path is given, it will be resolved via Stat() to a ResourceInfo
// when a call to the WOPI server is to be issued (cf. the provider grpc message)
storage.provider.v1beta1.Reference ref = 2;
// REQUIRED.
// View mode.
enum ViewMode {
VIEW_MODE_INVALID = 0;
// The file can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The file can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The file can be downloaded and updated.
VIEW_MODE_READ_WRITE = 3;
}
ViewMode view_mode = 3;
}
114 changes: 98 additions & 16 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ <h2>Table of Contents</h2>
<a href="#cs3.gateway.v1beta1.ListRecycleStreamRequest"><span class="badge">M</span>ListRecycleStreamRequest</a>
</li>

<li>
<a href="#cs3.gateway.v1beta1.OpenFileInAppProviderRequest"><span class="badge">M</span>OpenFileInAppProviderRequest</a>
</li>

<li>
<a href="#cs3.gateway.v1beta1.PurgeRecycleRequest"><span class="badge">M</span>PurgeRecycleRequest</a>
</li>
Expand All @@ -223,6 +227,10 @@ <h2>Table of Contents</h2>
</li>


<li>
<a href="#cs3.gateway.v1beta1.OpenFileInAppProviderRequest.ViewMode"><span class="badge">E</span>OpenFileInAppProviderRequest.ViewMode</a>
</li>



<li>
Expand Down Expand Up @@ -1860,6 +1868,47 @@ <h3 id="cs3.gateway.v1beta1.ListRecycleStreamRequest">ListRecycleStreamRequest</



<h3 id="cs3.gateway.v1beta1.OpenFileInAppProviderRequest">OpenFileInAppProviderRequest</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>ref</td>
<td><a href="#cs3.storage.provider.v1beta1.Reference">cs3.storage.provider.v1beta1.Reference</a></td>
<td></td>
<td><p>REQUIRED.
The resource reference. If a path is given, it will be resolved via Stat() to a ResourceInfo
when a call to the WOPI server is to be issued (cf. the provider grpc message) </p></td>
</tr>

<tr>
<td>view_mode</td>
<td><a href="#cs3.gateway.v1beta1.OpenFileInAppProviderRequest.ViewMode">OpenFileInAppProviderRequest.ViewMode</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.gateway.v1beta1.PurgeRecycleRequest">PurgeRecycleRequest</h3>
<p></p>

Expand Down Expand Up @@ -1969,6 +2018,41 @@ <h3 id="cs3.gateway.v1beta1.WhoAmIResponse">WhoAmIResponse</h3>



<h3 id="cs3.gateway.v1beta1.OpenFileInAppProviderRequest.ViewMode">OpenFileInAppProviderRequest.ViewMode</h3>
<p>REQUIRED.</p><p>View mode.</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>VIEW_MODE_INVALID</td>
<td>0</td>
<td><p></p></td>
</tr>

<tr>
<td>VIEW_MODE_VIEW_ONLY</td>
<td>1</td>
<td><p>The file can be opened but not downloaded.</p></td>
</tr>

<tr>
<td>VIEW_MODE_READ_ONLY</td>
<td>2</td>
<td><p>The file can be downloaded.</p></td>
</tr>

<tr>
<td>VIEW_MODE_READ_WRITE</td>
<td>3</td>
<td><p>The file can be downloaded and updated.</p></td>
</tr>

</tbody>
</table>




Expand Down Expand Up @@ -2173,9 +2257,9 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>

<tr>
<td>OpenFileInAppProvider</td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderRequest">.cs3.app.provider.v1beta1.OpenFileInAppProviderRequest</a></td>
<td><a href="#cs3.gateway.v1beta1.OpenFileInAppProviderRequest">OpenFileInAppProviderRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderResponse">.cs3.app.provider.v1beta1.OpenFileInAppProviderResponse</a></td>
<td><p>Returns the iframe url from the WOPI server. The iframe url will let you open the document in the correct online document editor.
<td><p>Returns the App provider URL, which lets the user open a file in the correct online document editor.

*****************************************************************/
************************ USER SHARE PROVIDER ********************/
Expand Down Expand Up @@ -3184,12 +3268,18 @@ <h3 id="cs3.app.provider.v1beta1.OpenFileInAppProviderRequest">OpenFileInAppProv
</tr>

<tr>
<td>ref</td>
<td><a href="#cs3.storage.provider.v1beta1.Reference">cs3.storage.provider.v1beta1.Reference</a></td>
<td>resource_info</td>
<td><a href="#cs3.storage.provider.v1beta1.ResourceInfo">cs3.storage.provider.v1beta1.ResourceInfo</a></td>
<td></td>
<td><p>REQUIRED.
The resource reference. If a path is given, it will be resolved via Stat() to a ResourceId
when a call to the WOPI server is to be issued. </p></td>
The resourceInfo to be opened. The gateway grpc message has a ref instead. </p></td>
</tr>

<tr>
<td>view_mode</td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderRequest.ViewMode">OpenFileInAppProviderRequest.ViewMode</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
Expand All @@ -3207,13 +3297,6 @@ <h3 id="cs3.app.provider.v1beta1.OpenFileInAppProviderRequest">OpenFileInAppProv
TODO(labkode): investigate token derivation techniques. </p></td>
</tr>

<tr>
<td>view_mode</td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderRequest.ViewMode">OpenFileInAppProviderRequest.ViewMode</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -3253,8 +3336,7 @@ <h3 id="cs3.app.provider.v1beta1.OpenFileInAppProviderResponse">OpenFileInAppPro
<td></td>
<td><p>REQUIRED.
The url that user agents will render to clients.
Usually the rendering happens by using HTML iframes,
at least, Office 365, Collabora, OnlyOffice do like that. </p></td>
Usually the rendering happens by using HTML iframes or in separate browser tabs. </p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -3317,7 +3399,7 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>
<td>OpenFileInAppProvider</td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderRequest">OpenFileInAppProviderRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenFileInAppProviderResponse">OpenFileInAppProviderResponse</a></td>
<td><p>Returns the iframe url
<td><p>Returns the App provider URL
MUST return CODE_NOT_FOUND if the resource does not exist.</p></td>
</tr>

Expand Down
Loading

0 comments on commit bde32fc

Please sign in to comment.