kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #926 from moonstream-to/access-id-in-path
Access id could be set in URL pathpull/927/head
commit
a8c96e4ca7
|
@ -305,9 +305,13 @@ func fetchClientAccessFromResources(accessID, authorizationToken string, tsNow i
|
|||
func extractAccessID(r *http.Request) string {
|
||||
var accessID string
|
||||
|
||||
accessIDHeaders := r.Header[strings.Title(NB_ACCESS_ID_HEADER)]
|
||||
for _, h := range accessIDHeaders {
|
||||
accessID = h
|
||||
urlPathSlice := strings.Split(r.URL.Path, "/")
|
||||
if len(urlPathSlice) == 5 {
|
||||
potentialUuid := urlPathSlice[4]
|
||||
_, uuidParseErr := uuid.Parse(potentialUuid)
|
||||
if uuidParseErr == nil {
|
||||
accessID = potentialUuid
|
||||
}
|
||||
}
|
||||
|
||||
queries := r.URL.Query()
|
||||
|
@ -317,6 +321,11 @@ func extractAccessID(r *http.Request) string {
|
|||
}
|
||||
}
|
||||
|
||||
accessIDHeaders := r.Header[strings.Title(NB_ACCESS_ID_HEADER)]
|
||||
for _, h := range accessIDHeaders {
|
||||
accessID = h
|
||||
}
|
||||
|
||||
return accessID
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
package main
|
||||
|
||||
var NB_VERSION = "0.2.3"
|
||||
var NB_VERSION = "0.2.4"
|
||||
|
|
|
@ -15,8 +15,8 @@ PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
|
|||
|
||||
# Main
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
|
||||
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
|
||||
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
|
||||
APP_DIR="${APP_DIR:-/home/ubuntu/api}"
|
||||
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/nodebalancer-secrets}"
|
||||
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
|
||||
SCRIPT_DIR="$(realpath $(dirname $0))"
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/home/ubuntu/moonstream/nodebalancer
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
WorkingDirectory=/home/ubuntu/api/nodebalancer
|
||||
EnvironmentFile=/home/ubuntu/nodebalancer-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
ExecStart=/home/ubuntu/moonstream/nodebalancer/nodebalancer server \
|
||||
ExecStart=/home/ubuntu/api/nodebalancer/nodebalancer server \
|
||||
-host "${AWS_LOCAL_IPV4}" \
|
||||
-port 8544 \
|
||||
-healthcheck \
|
||||
|
|
Ładowanie…
Reference in New Issue