kopia lustrzana https://github.com/bugout-dev/moonstream
Application id check in auth middleware
rodzic
3405f6746f
commit
ca5bca10ae
|
@ -19,6 +19,7 @@ type NodeStatusResponse struct {
|
||||||
|
|
||||||
type BugoutUserResponse struct {
|
type BugoutUserResponse struct {
|
||||||
ID string `json:"user_id"`
|
ID string `json:"user_id"`
|
||||||
|
ApplicationID string `json:"application_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node - which one node client worked with
|
// Node - which one node client worked with
|
||||||
|
|
|
@ -104,6 +104,10 @@ func authMiddleware(next http.Handler) http.Handler {
|
||||||
http.Error(w, "Wrong authorization header", http.StatusForbidden)
|
http.Error(w, "Wrong authorization header", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if userResponse.ApplicationID != configs.BUGOUT_NODE_BALANCER_APPLICATION_ID {
|
||||||
|
http.Error(w, "Wrong authorization header", http.StatusForbidden)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue