-
Notifications
You must be signed in to change notification settings - Fork 640
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
Description
So there's this concept of "browser-based uploads" which basically is the following process:
- Client sends the server an (untrusted) policy document (basically says "I'm going to upload
filewhich is10mband has metadata ={...}). - Server gets this request, validates it, and if it likes it, sends back a signature (basically says "SGTM, here's my stamp of approval").
- Client is able to upload exactly that data directly to Cloud Storage, it's "credentials" for this single request being the policy document (and the signature).
So... a couple of questions:
- Can we even use gcloud-node in the client-side of a web-app?
- If so, we need a simple way of creating typical policy documents (as well as weird ones).
- Then we need a way of generating a signature (server-side) for a policy document.
Note that we're not wiring together any RPCs or anything. Just providing a method that takes a policy and spits back a signature for the user to serialize and send around however they want. - Then we need a way of calling
upload(or similar) using the policy document and signature.
The code I'm expecting here would look like...
Server-side:
bucket.signPolicy(policy, function(signature) {
// The signature can be serialized or whatever else we want now.
});Client-side:
var policy = bucket.policy({ /* Lots of configuration here... */ });
$.post({ /* Send the policy up to the method above */ }, function(response) {
// Create an HTML form (?) that has a field called signature = response.data ?
});/cc @Capstan
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.