aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/api.go
diff options
context:
space:
mode:
authorGreg Steuck <greg@nest.cx>2021-07-12 20:49:17 -0700
committerDmitry Vyukov <dvyukov@google.com>2021-07-14 07:16:41 +0200
commitc668d6f957a724b4a3a79a84dd9d6600a2a911c7 (patch)
tree515609c5ccdf98fc048b311ccc83447326d61a3e /dashboard/app/api.go
parente30a17b1f2c21263222201cb95ae0ef043c89f15 (diff)
dashboard/app: control time externally from api.go
This way the tested code is independent of the time passage and the tests are reliable.
Diffstat (limited to 'dashboard/app/api.go')
-rw-r--r--dashboard/app/api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index 8ce6658cf..dad31c3df 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -105,7 +105,7 @@ func handleAPI(c context.Context, r *http.Request) (reply interface{}, err error
method := r.PostFormValue("method")
log.Infof(c, "api %q from %q", method, client)
auth := makeAuthEndpoint(googleTokenInfoEndpoint)
- subj, err := auth.determineAuthSubj(r.Header["Authorization"])
+ subj, err := auth.determineAuthSubj(timeNow(c), r.Header["Authorization"])
if err != nil {
return nil, err
}