Skip to content

Commit

Permalink
fix(blob): remove auth for using upload and download url
Browse files Browse the repository at this point in the history
  • Loading branch information
Yougigun committed Nov 25, 2024
1 parent 01453a4 commit 940a52c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion config/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{{ template "influxdb_metrics.tmpl" . }},
{{ template "cors.tmpl" . }},
"plugin/http-server": {
"name": ["blob","sse-streaming", "multi-auth", "grpc-proxy-server", "registry"],
"name": ["sse-streaming", "multi-auth", "grpc-proxy-server", "registry","blob"],
"multi-auth":{
"grpc_server": "{{ .plugins.mgmt_public_hostport }}"
},
Expand Down
11 changes: 0 additions & 11 deletions plugins/blob/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@ func (rh *blobHandler) handler(ctx context.Context) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
Info(req.Method+" "+req.URL.Path, " start relaying request to blob backend")

userUID := req.Header.Get("Instill-User-Uid")

// check if the userUID is a valid uuid
if _, err := uuid.FromString(userUID); err != nil {
Error(req.URL.Path, " authorization failed. ", err)
rh.handleError(req, w, err)
return
}

// TODO: check if user uuid is member of the namespace or user self

// NOTE: the object url uid is the last part of the request path
parts := strings.Split(req.URL.Path, "/")
objectURLUID := parts[len(parts)-1]
Expand Down

0 comments on commit 940a52c

Please sign in to comment.