-
Notifications
You must be signed in to change notification settings - Fork 113
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
TUS upload support through datagateway #878
Conversation
@kulmann how was this tested? please list scenarios (ex phoenix, cli, etc) |
Together with this PR in ocis-reva which changes default configs to run uploads through the proxy and PR in ocis-proxy which shows the required
|
@@ -238,3 +248,69 @@ func (s *svc) doPut(w http.ResponseWriter, r *http.Request) { | |||
log.Err(err).Msg("error writing body after header were set") | |||
} | |||
} | |||
|
|||
// TODO: put and post code is pretty much the same. Should be solved in a nicer way in the long run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've tested TUS upload with Phoenix and it worked fine 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to allow self signed certs ...
2020-06-25T10:23:39+02:00 ERR Could not start TUS upload error="Patch \"https://localhost:9200/data\": x509: certificate signed by unknown authority" pkg=rhttp service=reva traceid=a29cb66d20fc4f6bf38eea42edff4d25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowing self signed certificates in #880
No-go to have a config variable and then render it useless by hardcoding it to true.
Since TUS clients don't understand the reva transfer token, we need to make sure that the upload endpoint comes out as a URL that encodes the full endpoint path, not only the data gateway path.
33775ca
to
8d0105c
Compare
rebasing fixed config issues. good to merge! |
In oCIS we want to be able to upload data through one single entrypoint and let the datagateway take care of dispatching the request to the respective
storagedata server. Reva already supports this by encoding the upload endpoint in anX-Reva-Transfer
token.This PR is about four things:
storagesdata servers are not exposed (i.e. as soon as a transfer token exists). Of course we want reva to still continue to work with the token. To achieve this, the datagateway now checks if a transfer token is present in the token verification step. If it's not present, we use the last segment of the request path as the transfer token.put.go
.ExposeDataServer = true
.Also one small change: I've changed the datagateway to expose the
X-Reva-Transfer
constant and used it in all places where the string was hardcoded before. Makes it easier to find code fragments where the transfer token is used.Happy to hear feedback on this.