Skip to content

Conversation

@Timshel
Copy link
Contributor

@Timshel Timshel commented Dec 2, 2025

With web-v2025.11.3 the policy type is not sent in the request body anymore.

@stefan0xC
Copy link
Contributor

If I try to check organization policies I get logged out due to a request to /api/organizations/undefined/policies. I don't think it's necessarily related to your issue but at least that's what keeps me from checking your PR. (I have not found the time to check why this happens yet.)

[2025-12-02 17:54:42.757][request][INFO] GET /api/organizations/undefined/policies
[2025-12-02 17:54:42.761][auth][ERROR] Unauthorized Error: Error getting the organization id
[2025-12-02 17:54:42.761][vaultwarden::api::core::organizations::_][WARN] Request guard `AdminHeaders` failed: "Error getting the organization id".

@Timshel
Copy link
Contributor Author

Timshel commented Dec 2, 2025

@stefan0xC a yes had the same issue with latest client, had to add Timshel/oidc_web_vault@36436c4 :(.

Might try to open an issue directly on Bitwarden client repository but always hesitant 😅

@stefan0xC
Copy link
Contributor

stefan0xC commented Dec 2, 2025

We could also ignore requests to that specific endpoint, so the AdminHeaders guard is not triggered. I just would not sure if it's better to return nothing or a 404 error message. (Looks like the next web-vault might have a refactored policy component bitwarden/clients#17636, so it might not be an issue then. But I have not checked if this fixes the issue.)

@Timshel
Copy link
Contributor Author

Timshel commented Dec 2, 2025

Had a quick look, I would expect the refactor to fix the issue.

@stefan0xC
Copy link
Contributor

Had a quick look, I would expect the refactor to fix the issue.

Indeed it does. Tested if that PR can be backported and while it will call the endpoint twice at least it doesn't request an undefined organization anymore.

Copy link
Contributor

@stefan0xC stefan0xC left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes an issue with saving policies.

[2025-12-02 22:50:33.518][request][INFO] PUT /api/organizations/aa21cc7e-2ddb-4792-b336-58c6f64f0213/policies/0
[2025-12-02 22:50:33.533][vaultwarden::api::core::organizations::_][WARN] Data guard `Json < PolicyData >` failed: Parse("{\"enabled\":false,\"data\":null}", Error("missing field `type`", line: 1, column: 29)).
[2025-12-02 22:50:33.534][response][INFO] (put_policy) PUT /api/organizations/<org_id>/policies/<pol_type> => 422 Unprocessable Entity

@BlackDex BlackDex requested a review from dani-garcia December 6, 2025 14:50
@dani-garcia dani-garcia merged commit 76d0856 into dani-garcia:main Dec 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants