-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: disable security on /api/v2/ when running insecure #86417
server: disable security on /api/v2/ when running insecure #86417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
pkg/server/api_v2_auth.go
Outdated
} | ||
|
||
return username, sessionCookie, nil | ||
return username, sessionCookie, 200, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http.StatusOK?
Previously, the session validation log in `/api/v2/` would still run even when the cluster was running in "insecure" mode. This made it cumbersome to test new features while developing, and also caused new challenges when developing DB Console features that use `/api/v2/` endpoints. Now, when the cluster has the insecure flag set to true, web session check failures won't cause failures on endpoints and the session username will be set to "root" automatically in the context. Release note (security update): HTTP API endpoints under the `/api/v2/` prefix, will allow requests through when the cluster is running in "insecure" mode. When the cluster is running in "insecure" mode requests to these endpoints will have the username set to "root". Release justification: low-risk high-benefit change to existing functionality.
c9e7d1d
to
109aac2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz and @xinhaoz)
pkg/server/api_v2_auth.go
line 351 at r1 (raw file):
Previously, knz (kena) wrote…
http.StatusOK?
Done.
TFTR bors r=knz |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 109aac2 to blathers/backport-release-22.1-86417: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Previously, the session validation log in
/api/v2/
would still run even whenthe cluster was running in "insecure" mode. This made it cumbersome to test new
features while developing, and also caused new challenges when developing DB
Console features that use
/api/v2/
endpoints.Now, when the cluster has the insecure flag set to true, web session check
failures won't cause failures on endpoints and the session username will be set
to "root" automatically in the context.
Release note (security update): HTTP API endpoints under the
/api/v2/
prefix,will allow requests through when the cluster is running in "insecure" mode.
When the cluster is running in "insecure" mode requests to these endpoints will
have the username set to "root".
Release justification: low-risk high-benefit change to existing functionality.