diff --git a/pkg/app/auth/middleware.go b/pkg/app/auth/middleware.go index a6fd9558..9931d34e 100644 --- a/pkg/app/auth/middleware.go +++ b/pkg/app/auth/middleware.go @@ -128,7 +128,7 @@ func parseAuthHeader(val, expectedScheme string) (string, error) { return "", aerr.ErrAuthenticationFailed.Msg("Bad authorization string") } if !strings.EqualFold(splits[0], expectedScheme) { - return "", aerr.ErrAuthenticationFailed.Str("expected-scheme", expectedScheme).Msg("Request unauthenticated with expected scheme") + return "", aerr.ErrAuthenticationFailed.Msgf("Request unauthenticated with expected scheme, expected: %s", expectedScheme) } return splits[1], nil } diff --git a/pkg/app/impl/authz.go b/pkg/app/impl/authz.go index 902ba9dd..7df8e7ec 100644 --- a/pkg/app/impl/authz.go +++ b/pkg/app/impl/authz.go @@ -146,14 +146,14 @@ func (s *AuthorizerServer) DecisionTree(ctx context.Context, req *authorizer.Dec ).PrepareForEval(ctx) if err != nil { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt.String()) + return resp, aerr.ErrBadQuery.Err(err).Msg(queryStmt.String()) } queryResults, err := qry.Eval(ctx, rego.EvalInput(input)) if err != nil { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt.String()).Msg("query evaluation failed") + return resp, aerr.ErrBadQuery.Err(err).Msgf("query evaluation failed: %s", queryStmt.String()) } else if len(queryResults) == 0 { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt.String()).Msg("undefined results") + return resp, aerr.ErrBadQuery.Err(err).Msgf("undefined results: %s", queryStmt.String()) } for _, expression := range queryResults[0].Expressions { @@ -257,15 +257,15 @@ func (s *AuthorizerServer) Is(ctx context.Context, req *authorizer.IsRequest) (* ).PrepareForEval(ctx) if err != nil { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt) + return resp, aerr.ErrBadQuery.Err(err).Msg(queryStmt) } results, err := query.Eval(ctx, rego.EvalInput(input)) if err != nil { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt).Msg("query evaluation failed") + return resp, aerr.ErrBadQuery.Err(err).Msgf("query evaluation failed: %s", queryStmt) } else if len(results) == 0 { - return resp, aerr.ErrBadQuery.Err(err).Str("query", queryStmt).Msg("undefined results") + return resp, aerr.ErrBadQuery.Err(err).Msgf("undefined results: %s", queryStmt) } v := results[0].Bindings["x"]