Skip to content

[17.0][MIG] auth_oauth_environment: Migration to 17.0 - #254

Open
vvrossem wants to merge 5 commits into
OCA:17.0from
camptocamp:17.0-mig-auth_oauth_environment
Open

vvrossem wants to merge 5 commits into
OCA:17.0from
camptocamp:17.0-mig-auth_oauth_environment

Conversation

@vvrossem

@vvrossem vvrossem commented Nov 19, 2025 •

Copy link
Copy Markdown

Migrates auth_oauth_environment to 17.0: OAuth providers read client_id and enabled from server_environment files, in a [auth_oauth.<tech_name>] section.

Supersedes #253.

Note

Changed since the merge attempt
Renaming a provider no longer breaks its config. Say the server env file has:

[auth_oauth.provider_google]
client_id = 123-abc
enabled = True

If someone renamed "Google OAuth2" to "Google" in the UI, its tech_name became google, so this section no longer applied: the client ID came back empty and the Google button disappeared from the login page. Now the provider keeps provider_google. I also added tech_name to the provider form so you can see which section a provider reads.

Installing the module also kept nothing from before: a provider missing from the config came out disabled with an empty client ID, and the ones added by hand had no tech_name, so they couldn't be configured either. A post-init hook now keeps their client ID and Allowed values and gives them a tech_name from their name.

Provider tech_name
Google, Odoo.com, Facebook (from auth_oauth) provider_google, provider_openerp, provider_facebook (same as their XML ids)
New provider its name at creation, slugified: My Corp SSO → my_corp_sso
Renamed provider unchanged

Tests cover reading the config, searching on enabled (used by the login page), and renaming.

To configure this module, you need to add a section
``[auth_oauth.provider_simple_name]`` to you server_environment_files
configurations, where 'provider_simple_name' match the simplified name field on
``[auth_oauth.provider_name]`` to you server_environment_files

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

to your server_environment_files

@yankinmax yankinmax left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for adding the test. As we're migrationg form v11 probably it worth it to rename openerp to odoo?

@vvrossem

Copy link
Copy Markdown
Author

Thanks for adding the test. As we're migrationg form v11 probably it worth it to rename openerp to odoo?

I used for the tech_name the same value as the XML ID auth_oauth.provider_openerp, mainly for consistency

@gurneyalex

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-254-by-gurneyalex-bump-nobump, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@gurneyalex The merge process could not be finalized, because command twine upload --disable-progress-bar --non-interactive --repository-url https://upload.pypi.org/legacy/ -u __token__ odoo_addon_auth_oauth_environment-17.0.1.0.0.2-py3-none-any.whl failed with output:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading odoo_addon_auth_oauth_environment-17.0.1.0.0.2-py3-none-any.whl
�[33mWARNING �[0m Error during upload. Retry with the --verbose option for more details. 
�[31mERROR   �[0m HTTPError: 429 Too Many Requests from https://upload.pypi.org/legacy/  
         Too Many Requests                                                      

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 25, 2026
@vvrossem
vvrossem force-pushed the 17.0-mig-auth_oauth_environment branch from dd7e861 to 498e0a3 Compare October 26, 2026 07:46
@OCA-git-bot OCA-git-bot added series:17.0 mod:auth_oauth_environment Module auth_oauth_environment labels Oct 26, 2026
@vvrossem
vvrossem force-pushed the 17.0-mig-auth_oauth_environment branch from 498e0a3 to a143eca Compare October 26, 2026 08:00
@vvrossem
vvrossem force-pushed the 17.0-mig-auth_oauth_environment branch from a143eca to 15ab6bb Compare October 26, 2026 08:19
@vvrossem

Copy link
Copy Markdown
Author

Note

Changed since the merge attempt
Renaming a provider no longer breaks its config. Say the server env file has:

[auth_oauth.provider_google]
client_id = 123-abc
enabled = True

If someone renamed "Google OAuth2" to "Google" in the UI, its tech_name became google, so this section no longer applied: the client ID came back empty and the Google button disappeared from the login page. Now the provider keeps provider_google. I also added tech_name to the provider form so you can see which section a provider reads.

Installing the module also kept nothing from before: a provider missing from the config came out disabled with an empty client ID, and the ones added by hand had no tech_name, so they couldn't be configured either. A post-init hook now keeps their client ID and Allowed values and gives them a tech_name from their name.

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants