-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
[17.0][MIG] auth_oauth_multi_token: Migration to 17.0 #742
[17.0][MIG] auth_oauth_multi_token: Migration to 17.0 #742
Conversation
Allow multiple oauth login at the same time.
* cleanup, improve, docstrings * add tests
Nothing special. Just making linters happy and splitting the readme. @Tecnativa TT25619
Otherwise lookup is slow when there are many users.
Otherwise you can't delete a user.
This is cosmetic only, because this field is not used when auth_oauth_multi_token is installed.
Hi @CRogos could this PR merged? |
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.
Could you have a look on your commits? Some of them should be squashed, and the last commit should be splitted into:
[IMP] auth_oauth_multi_token: pre-commit auto fixes
[MIG] auth_oauth_multi_token: Migration to 17.0
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0
Code LGTM, but havn't tested yet.
Do you use odoo.sh? The last time I've tested this module it was not compatible with the login-as function of odoo.sh
Hi @kobros-tech Could you have a look on your commits? |
3aed0b7
to
6182408
Compare
Hi all, I improved the PR more, and all contributions logs are mentioned. To have all log preserved here, there was a conflict arised and I guess the first PR was not made correctly as I had to resolve a conflict in another module which is out of scope. If I git rid of there commits and start on top of last merged commit in version 16.0 or to keep it as it is |
eda2f56
to
497efa2
Compare
@kobros-tech can you squash these commits as well: also some of your content in the migration commit should be in the "[IMP] auth_oauth_multi_token: pre-commit auto fixes" commit as it was done in the original PR (but without the deb file) |
please, make sure that the commit you mentioned that has pandoc file is not there, only the [MIG] commit which is clean as I guess. I don't understand why should I squash commits done for 16.0 and not for 17.0, could you explain? |
@kobros-tech In #694 the Commit history is according to the migration guide. Nevertheless, the "[IMP] auth_oauth_multi_token: pre-commit auto fixes" commit of #694 is correct beside of the *.deb file and should also exist in this PR. |
I need you to look at the log of commits, because the commit you are talking about is squashed already and pandoc file is not mentioned or tracked in the migration commit and you can review, thanks! |
@CRogos |
There is no commit with pandoc file, but there is also no commit "[IMP] auth_oauth_multi_token: pre-commit auto fixes" which should be there. |
thanks, now I understand what you mean. In fact I am not used to make two commits for migration, I have a point of view that I add it in a single commit, I don't mind you if you see it necessary here. |
@CRogos |
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.
I've now also tested this PR and it is working fine.
Nevertheless I think a found another issue in this module in the _check_credentials method.
I also found out, why this module is not working with odoo.sh "login as". I was also able to change this module to make it compatible with odoo.sh by reusing "oauth_access_token" instead of adding "oauth_master_uuid". Neverthless I am not sure if refactoring this module or adding a new module "auth_oauth_multi_token_odoosh" is the right way, because the original solution is cleaner as the patched version?
res = self.multi_token_model.sudo().search( | ||
[("user_id", "=", self.env.uid), ("oauth_access_token", "=", password)] | ||
) | ||
if not res: | ||
raise |
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.
I think we should add an additional check like in the link below.
passwd_allowed = env['interactive'] or not self.env.user._rpc_api_keys_only()
if passwd_allowed and self.env.user.active:
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.
I will add your commit right now the this PR
Any time if you can have access of time, I don't mind if you use and append to our wok.
It is a community and our prior interest is to get something effective.
thanks
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.
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.
I will review it
@kobros-tech
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.
this is to allow admin to impersonate? I really like that to verify access.
I was going to ask about making the provider a one2many too.
I think would need to be in this module as you might have 2 tokens with 2 providers. the user case would be a multi-company / multi-website each with their own branded oauth login page to match the website / company. if you where to show on each website the sign in for that company. then it needs its only client id and redirect.
if you have your B2B customers each on their own user no issue. but then the internal users cold not login in anything but one domain/company.
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.
No this is an addon, which i found at a similar case in another documentation (see the link).
The picked commit after the migration makes it compatible with the Odoo.sh implementation which does the "login as".
7c80540
to
e6c6427
Compare
@kobros-tech could you rename the migration commit and squash the yellow marked commits? |
e6c6427
to
e305183
Compare
@CRogos |
@pedrobaeza could you have a look and merge if you agree with the changes. Regarding the changes related to odoo.sh, I also opened a ticket at Odoo, but they are not willing to change anything on their implementation. |
This PR has the |
string="Master UUID", | ||
copy=False, |
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.
Why are you removing these attributes?
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.
You are right. I thought False is the default, but it is not. @kobros-tech could you please readd the copy=False?
e305183
to
27e0d91
Compare
I need more explanation of the latest commit, and I think it should be out of the migration itself in a separate PR, so we can merge as is the migration, and then discuss about that changes, with steps to reproduce the problem, etc, etc. |
ok give me one hour and I will remove the commit |
27e0d91
to
7abc6d4
Compare
@pedrobaeza |
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.
/ocabot migration auth_oauth_multi_token
/ocabot merge nobump
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at f5a8de0. Thanks a lot for contributing to OCA. ❤️ |
Added a new PR regarding the odoo.sh issue #764 |
fixing git commits log history with keeping the changes the same for PR #694 this will enable me to migrate to 18.0