Skip to content

Fix API authentication being broken with clients that send an unauthenticated request first#10862

Open
jschmidt-icinga wants to merge 1 commit into
masterfrom
fix-api-authentication
Open

Fix API authentication being broken with clients that send an unauthenticated request first#10862
jschmidt-icinga wants to merge 1 commit into
masterfrom
fix-api-authentication

Conversation

@jschmidt-icinga

Copy link
Copy Markdown
Contributor

The single commit just moves setting the www_authenticate header field to after SendJsonError() has initialized the message. The respective unit-test now also checks for the header in the response and I've added some documentation on this potentially unexpected behavior of SendJsonError().

We should maybe consider some minor refactoring of these SendJson(Error|Body) functions to make clearer if they (re-initialize) the message or potentially do or don't send on their own.

Fixes #10836.

@jschmidt-icinga jschmidt-icinga added this to the 2.17.0 milestone May 28, 2026
@jschmidt-icinga jschmidt-icinga added bug Something isn't working area/api REST API backport-to-support/2.16 PRs with this label will automatically be backported to the v2.16 support branch. labels May 28, 2026
@cla-bot cla-bot Bot added the cla/signed label May 28, 2026
This is necessary, since `SendJsonError()` also clears the entire
response and possible because it doesn't on its own *send* the message
yet.
@jschmidt-icinga jschmidt-icinga force-pushed the fix-api-authentication branch from dbf97cc to 4939c53 Compare May 28, 2026 12:15
@rotanid

rotanid commented Jun 19, 2026

Copy link
Copy Markdown

@jschmidt-icinga would be nice if we get a bugfix release with this soon, thanks in advance!

@jschmidt-icinga

Copy link
Copy Markdown
Contributor Author

@rotanid We're currently preparing a security release to be released on Monday. After that we'll prioritize a bugfix release that'll incorporate this fix among others, but I can't give you a timeline at this point.

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

Labels

area/api REST API backport-to-support/2.16 PRs with this label will automatically be backported to the v2.16 support branch. bug Something isn't working cla/signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to authenticate on API

2 participants