Update auth context keys to use constant

Prevent using strings throughout the code to reference a string key defined in the auth package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan
2016-01-28 17:02:09 -08:00
parent 74c4a0e3e3
commit 648a1343db
6 changed files with 18 additions and 7 deletions

View File

@@ -375,7 +375,7 @@ func TestAccessController(t *testing.T) {
t.Fatalf("accessController returned unexpected error: %s", err)
}
userInfo, ok := authCtx.Value("auth.user").(auth.UserInfo)
userInfo, ok := authCtx.Value(auth.UserKey).(auth.UserInfo)
if !ok {
t.Fatal("token accessController did not set auth.user context")
}