Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions auth_oidc_environment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"name": "Auth Oidc Environment",
"summary": """
This module allows to use server env for OIDC configuration""",
"version": "18.0.1.0.0",
"version": "18.0.1.1.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-auth",
"depends": [
"auth_oidc",
"server_environment",
"server_environment>18.0.1.0.6",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sbidoul pre-commit doesn't like that. What would be the right syntax ?

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.

Ah yes, Odoo would not support that either.

So the trick is to do that with a new section in pyproject.toml:

[tool.whool]
depends_override = { "server_environment": "odoo-addon-server_environment ==18.0.*, >18.0.1.0.6" }

],
"data": [],
"demo": [],
Expand Down
11 changes: 11 additions & 0 deletions auth_oidc_environment/migrations/18.0.1.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
env["auth.oauth.provider"]._preserve_not_env_managed_data(
["auth_endpoint", "token_endpoint", "jwks_uri"]
)
3 changes: 3 additions & 0 deletions auth_oidc_environment/models/auth_oauth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def _server_env_fields(self):
auth_fields = {
"client_id": {},
"client_secret": {},
"auth_endpoint": {},
"token_endpoint": {},
"jwks_uri": {},
}
auth_fields.update(base_fields)
return auth_fields
Expand Down
10 changes: 9 additions & 1 deletion auth_oidc_environment/tests/test_auth_oidc_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
class TestEnvironmentVariables(ServerEnvironmentCase):
def test_env_variables(self):
env_var = (
"[auth_oauth_provider.sample]\n" "client_id=foo\n" "client_secret=bar\n"
"[auth_oauth_provider.sample]\n"
"client_id=foo\n"
"client_secret=bar\n"
"auth_endpoint=https://test/auth/endpoint\n"
"token_endpoint=https://test/token/endpoint\n"
"jwks_uri=https://test/jwks/uri\n"
)
with self.set_config_dir(None), self.set_env_variables(env_var):
parser = server_env._load_config()
Expand All @@ -25,5 +30,8 @@ def test_env_variables(self):
{
"client_id": "foo",
"client_secret": "bar",
"auth_endpoint": "https://test/auth/endpoint",
"token_endpoint": "https://test/token/endpoint",
"jwks_uri": "https://test/jwks/uri",
},
)
Loading