Skip to content

fix: improve bearerinjector logging for missing credentials#3957

Merged
MustafaSaber merged 2 commits into
zalando:masterfrom
mvanhorn:osc/3507-bearerinjector-logging
Apr 13, 2026
Merged

fix: improve bearerinjector logging for missing credentials#3957
MustafaSaber merged 2 commits into
zalando:masterfrom
mvanhorn:osc/3507-bearerinjector-logging

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

When the bearerinjector filter can't find a secret, the error message now mentions the -credentials-paths flag. Previously it just said "Secret not found" with no hint about what to configure.

Also updates the bearerinjector docs to link to the egress reference and note the -credentials-paths requirement.

Changes

  • filters/auth/bearer.go: Improved error message at line 56 to mention -credentials-paths.
  • docs/reference/filters.md: Added note about -credentials-paths and link to the egress reference with a complete configuration example.

Testing

  • go build ./filters/auth/... passes

Fixes #3507

This contribution was developed with AI assistance (Claude Code).

@zalando-robot

Copy link
Copy Markdown

Cannot start a pipeline due to:

No accountable user for this pipeline: no Zalando employee associated to this GitHub username

Click on pipeline status check Details link below for more information.

Comment thread docs/reference/filters.md Outdated
`"Bearer "` prefix and empty suffix.

The token file must be located in a directory passed via the `-credentials-paths` flag.
See the [egress reference](https://opensource.zalando.com/skipper/reference/egress/#example-bearer-injection)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use relative markdown links

Comment thread filters/auth/bearer.go Outdated
b, ok := f.secretsReader.GetSecret(f.secretName)
if !ok {
log.Errorf("Secret %q not found for bearerinjector filter", f.secretName)
log.Errorf("Secret %q not found for bearerinjector filter. Make sure the file exists in a directory passed via -credentials-paths flag.", f.secretName)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to have the link to docs here

@zalando-robot

Copy link
Copy Markdown

Cannot start a pipeline due to:

No accountable user for this pipeline: no Zalando employee associated to this GitHub username

Click on pipeline status check Details link below for more information.

@mvanhorn

mvanhorn commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both - switched to relative markdown link in filters.md and added the docs URL to the error message in bearer.go. Pushed in 6f19f0b.

@MustafaSaber

Copy link
Copy Markdown
Contributor

Please fix DCO

mvanhorn and others added 2 commits April 10, 2026 10:23
When GetSecret fails, the error message now mentions the
-credentials-paths flag so users know how to configure the secret source.

Also updates the bearerinjector documentation to link to the egress
reference and note the -credentials-paths requirement.

Fixes zalando#3507

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
- Use relative markdown link for egress reference in filters.md
- Include docs URL in bearerinjector error log for easier debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
@mvanhorn
mvanhorn force-pushed the osc/3507-bearerinjector-logging branch from 6f19f0b to 72388f8 Compare April 10, 2026 17:24
@zalando-robot

Copy link
Copy Markdown

Cannot start a pipeline due to:

No accountable user for this pipeline: no Zalando employee associated to this GitHub username

Click on pipeline status check Details link below for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bearerinjector/setRequestHeaderFromSecret: better logging for misconfigured filters

4 participants