Skip to content

[16.0][FIX] auth_api_key: Use 401 for unauthorized user#738

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
PyTech-SRL:16.0-fix-server_auth_wrong_code
Jun 16, 2025
Merged

[16.0][FIX] auth_api_key: Use 401 for unauthorized user#738
OCA-git-bot merged 1 commit intoOCA:16.0from
PyTech-SRL:16.0-fix-server_auth_wrong_code

Conversation

@anusriNPS
Copy link
Contributor

As per documentation, using 401 as status code seems valid for a user who is not able to be authorized. However, 403 is used for scenario where user is forbidden to access a resource. So, returning 401 instead of 403.

Copy link

@HekkiMelody HekkiMelody left a comment

Choose a reason for hiding this comment

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

This is the same change as #629 , I think it makes sense here as it did there.

LGTM

@github-actions
Copy link

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 May 11, 2025
@github-actions github-actions bot closed this Jun 15, 2025
@HekkiMelody
Copy link

@OCA/tools-maintainers Hello, this is a tiny fix to be more compliant with expectations of a REST architecture, we've been using it in production for a few months now, can it be merged? Thanks

Copy link

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

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

LGTM

@LoisRForgeFlow
Copy link

There is no declared maintainer of the module so I'm merging...

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-738-by-LoisRForgeFlow-bump-patch, awaiting test results.

@HekkiMelody
Copy link

Thank you @LoisRForgeFlow !

@OCA-git-bot OCA-git-bot merged commit 5ae3322 into OCA:16.0 Jun 16, 2025
8 of 10 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at cfb1526. Thanks a lot for contributing to OCA. ❤️

@LoisRForgeFlow
Copy link

@aleuffre no problem! Could you take care of fwporting the fix to 17 and 18? ping me on the PR and we can quickly merge

@simahawk
Copy link
Contributor

@anusriNPS @aleuffre thanks for your contrib!
Next time please, respect commit convention by removing the odoo version.
I see that in the fwd ports, the commit msg has been rewritten to match the odoo version: we shouldn't do it.
If you drop the version in the original commit, there's nothing to fix afterwards 😉

@HekkiMelody
Copy link

@anusriNPS @aleuffre thanks for your contrib! Next time please, respect commit convention by removing the odoo version. I see that in the fwd ports, the commit msg has been rewritten to match the odoo version: we shouldn't do it. If you drop the version in the original commit, there's nothing to fix afterwards 😉

You're right, I missed it when reviewing, apologies

@anusriNPS
Copy link
Contributor Author

@anusriNPS @aleuffre thanks for your contrib! Next time please, respect commit convention by removing the odoo version. I see that in the fwd ports, the commit msg has been rewritten to match the odoo version: we shouldn't do it. If you drop the version in the original commit, there's nothing to fix afterwards 😉

Sure, will take care to align with Odoo convention in upcoming commits.

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

Labels

approved merged 🎉 stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants