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:
parent
6c135e03ce
commit
badd8c49b6
6 changed files with 18 additions and 7 deletions
|
@ -588,7 +588,7 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler {
|
|||
}
|
||||
|
||||
// Add username to request logging
|
||||
context.Context = ctxu.WithLogger(context.Context, ctxu.GetLogger(context.Context, "auth.user.name"))
|
||||
context.Context = ctxu.WithLogger(context.Context, ctxu.GetLogger(context.Context, auth.UserNameKey))
|
||||
|
||||
if app.nameRequired(r) {
|
||||
nameRef, err := reference.ParseNamed(getName(context))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue