Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a URL object in OpenInAppResponse #139

Merged
merged 3 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option java_package = "com.cs3.app.provider.v1beta1";
option objc_class_prefix = "CAP";
option php_namespace = "Cs3\\App\\Provider\\V1Beta1";

import "cs3/app/provider/v1beta1/resources.proto";
import "cs3/rpc/v1beta1/status.proto";
import "cs3/storage/provider/v1beta1/resources.proto";
import "cs3/types/v1beta1/types.proto";
Expand Down Expand Up @@ -98,5 +99,5 @@ message OpenInAppResponse {
// REQUIRED.
// The url that user agents will render to clients.
// Usually the rendering happens by using HTML iframes or in separate browser tabs.
string app_url = 3;
OpenInAppURL app_url = 3;
}
47 changes: 47 additions & 0 deletions cs3/app/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2018-2019 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

syntax = "proto3";

package cs3.app.provider.v1beta1;

option csharp_namespace = "Cs3.App.Provider.V1Beta1";
option go_package = "providerv1beta1";
option java_multiple_files = true;
option java_outer_classname = "ResourcesProto";
option java_package = "com.cs3.app.provider.v1beta1";
option objc_class_prefix = "CAP";
option php_namespace = "Cs3\\App\\Provider\\V1Beta1";

// Represents the information for the app URL to be called by the clients.
message OpenInAppURL {
// REQUIRED.
// The URL that clients will perform requests to.
string app_url = 1;
// REQUIRED.
// The method for the request to be made.
// Only GET and POST are supported.
string method = 2;
ishank011 marked this conversation as resolved.
Show resolved Hide resolved
// OPTIONAL.
// The form parameters which have to be passed along with the request.
// These are sent only if the method is 'POST'.
map<string, string> form_parameters = 3;
// OPTIONAL.
// The headers to be added to the request.
map<string, string> headers = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read up on forms a little bit. The GET method on a form submit will add the form fields to the query parameters in the URL whereas the POST method will put them in the body (https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending_and_retrieving_form_data).

But in neither case there is an explicit option to set Headers. How would it be used then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to pass headers to iframes, albeit not in a straightforward manner https://stackoverflow.com/a/60571237. The apps which we're considering don't need any to be set but it would be a good functionality to have IMO.

}
2 changes: 1 addition & 1 deletion cs3/app/registry/v1beta1/registry_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ message ListSupportedMimeTypesResponse {
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The list of supported mime types with the apps which they can be opened with.
map<string, AppProviderNameList> mime_types = 3;
map<string, AppProviderList> mime_types = 3;
}

message GetDefaultAppProviderForMimeTypeRequest {
Expand Down
12 changes: 9 additions & 3 deletions cs3/app/registry/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ message ProviderInfo {
// offered by the app provider. Meant to be read
// by humans.
string description = 5;
// OPTIONAL.
// A URI to a static asset which represents the app icon.
string icon = 6;
// OPTIONAL.
// Whether the app can be opened only on desktop
bool desktop_only = 7;
}

// Holds a list of app names which can open a particular mime type.
message AppProviderNameList {
repeated string app_provider_name = 1;
// Holds a list of app providers which can open a particular mime type.
message AppProviderList {
repeated ProviderInfo app_providers = 1;
}
180 changes: 173 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,29 @@ <h2>Table of Contents</h2>
</li>


<li>
<a href="#cs3%2fapp%2fprovider%2fv1beta1%2fresources.proto">cs3/app/provider/v1beta1/resources.proto</a>
<ul>

<li>
<a href="#cs3.app.provider.v1beta1.OpenInAppURL"><span class="badge">M</span>OpenInAppURL</a>
</li>

<li>
<a href="#cs3.app.provider.v1beta1.OpenInAppURL.FormParametersEntry"><span class="badge">M</span>OpenInAppURL.FormParametersEntry</a>
</li>

<li>
<a href="#cs3.app.provider.v1beta1.OpenInAppURL.HeadersEntry"><span class="badge">M</span>OpenInAppURL.HeadersEntry</a>
</li>




</ul>
</li>


<li>
<a href="#cs3%2fapp%2fregistry%2fv1beta1%2fregistry_api.proto">cs3/app/registry/v1beta1/registry_api.proto</a>
<ul>
Expand Down Expand Up @@ -587,7 +610,7 @@ <h2>Table of Contents</h2>
<ul>

<li>
<a href="#cs3.app.registry.v1beta1.AppProviderNameList"><span class="badge">M</span>AppProviderNameList</a>
<a href="#cs3.app.registry.v1beta1.AppProviderList"><span class="badge">M</span>AppProviderList</a>
</li>

<li>
Expand Down Expand Up @@ -5055,7 +5078,7 @@ <h3 id="cs3.app.provider.v1beta1.OpenInAppResponse">OpenInAppResponse</h3>

<tr>
<td>app_url</td>
<td><a href="#string">string</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppURL">OpenInAppURL</a></td>
<td></td>
<td><p>REQUIRED.
The url that user agents will render to clients.
Expand Down Expand Up @@ -5132,6 +5155,133 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>



<div class="file-heading">
<h2 id="cs3/app/provider/v1beta1/resources.proto">cs3/app/provider/v1beta1/resources.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="cs3.app.provider.v1beta1.OpenInAppURL">OpenInAppURL</h3>
<p>Represents the information for the app URL to be called by the clients.</p>


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

<tr>
<td>app_url</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The URL that clients will perform requests to. </p></td>
</tr>

<tr>
<td>method</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The method for the request to be made.
Only GET and POST are supported. </p></td>
</tr>

<tr>
<td>form_parameters</td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppURL.FormParametersEntry">OpenInAppURL.FormParametersEntry</a></td>
<td>repeated</td>
<td><p>OPTIONAL.
The form parameters which have to be passed along with the request.
These are sent only if the method is &#39;POST&#39;. </p></td>
</tr>

<tr>
<td>headers</td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppURL.HeadersEntry">OpenInAppURL.HeadersEntry</a></td>
<td>repeated</td>
<td><p>OPTIONAL.
The headers to be added to the request. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.provider.v1beta1.OpenInAppURL.FormParametersEntry">OpenInAppURL.FormParametersEntry</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>key</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.provider.v1beta1.OpenInAppURL.HeadersEntry">OpenInAppURL.HeadersEntry</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>key</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>value</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>













<div class="file-heading">
<h2 id="cs3/app/registry/v1beta1/registry_api.proto">cs3/app/registry/v1beta1/registry_api.proto</h2><a href="#title">Top</a>
</div>
Expand Down Expand Up @@ -5503,7 +5653,7 @@ <h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">

<tr>
<td>value</td>
<td><a href="#cs3.app.registry.v1beta1.AppProviderNameList">AppProviderNameList</a></td>
<td><a href="#cs3.app.registry.v1beta1.AppProviderList">AppProviderList</a></td>
<td></td>
<td><p> </p></td>
</tr>
Expand Down Expand Up @@ -5658,8 +5808,8 @@ <h2 id="cs3/app/registry/v1beta1/resources.proto">cs3/app/registry/v1beta1/resou
<p></p>


<h3 id="cs3.app.registry.v1beta1.AppProviderNameList">AppProviderNameList</h3>
<p>Holds a list of app names which can open a particular mime type.</p>
<h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
<p>Holds a list of app providers which can open a particular mime type.</p>


<table class="field-table">
Expand All @@ -5669,8 +5819,8 @@ <h3 id="cs3.app.registry.v1beta1.AppProviderNameList">AppProviderNameList</h3>
<tbody>

<tr>
<td>app_provider_name</td>
<td><a href="#string">string</a></td>
<td>app_providers</td>
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
Expand Down Expand Up @@ -5735,6 +5885,22 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
by humans. </p></td>
</tr>

<tr>
<td>icon</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A URI to a static asset which represents the app icon. </p></td>
</tr>

<tr>
<td>desktop_only</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p>OPTIONAL.
Whether the app can be opened only on desktop </p></td>
</tr>

</tbody>
</table>

Expand Down
Loading