Skip to content

Commit 5a39fd7

Browse files
fix(monitoring): add specific paths to Enforced map (#247)
The m-lab/access v0.0.11+ TokenController uses exact path matching for the Enforced paths, not prefix matching. This caused 400 errors on /v2/platform/monitoring/{ndt/ndt7,wehe/replay} endpoints because only '/v2/platform/monitoring/' was in the Enforced map. Add the specific monitoring paths that are actually used.
1 parent a216f42 commit 5a39fd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

locate.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,11 @@ func main() {
242242

243243
// The /v2/platform/monitoring endpoint requires a token that is only
244244
// available to the monitoring tools. TokenController validates this token.
245+
// TODO: update m-lab/access to support prefix matching, then simplify to
246+
// just "/v2/platform/monitoring/".
245247
tc, err := controller.NewTokenController(verifier, true, exp, controller.Paths{
246-
"/v2/platform/monitoring/": true,
248+
"/v2/platform/monitoring/ndt/ndt7": true,
249+
"/v2/platform/monitoring/wehe/replay": true,
247250
})
248251
rtx.Must(err, "Failed to create token controller")
249252
monitoringChain := alice.New(tc.Limit).Then(http.HandlerFunc(c.Monitoring))

0 commit comments

Comments
 (0)