-
Notifications
You must be signed in to change notification settings - Fork 30.2k
[IMP] account_peppol: Send & Receive onboarding revamp #197353
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
[IMP] account_peppol: Send & Receive onboarding revamp #197353
Conversation
4b01ad2 to
17a1053
Compare
0774a6d to
eab2da6
Compare
eb6aeb6 to
0a2579f
Compare
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.
@aboo-odoo Regarding the security warning on the call above moved in a separate method, I'm afraid we can't avoid it...
The href contains the URL. We retrieve it from the call done to
smp_url = f"http://B-{hash_participant}.iso6523-actorid-upis.{sml_zone}.tech.ec.europa.eu/{endpoint_participant}" above. This domain is handled by Peppol who certifies Access Points that are registered on the network. The href content is built by those Access Points so I think it can be considered safe-ish by design.
Here is what those urls could look like:
First call that list services accepted by the user (which we can't know in advance):
http://b-b7a1e8b32951d519bbef26d9ac24804c.iso6523-actorid-upis.edelivery.tech.ec.europa.eu/iso6523-actorid-upis::0208:0246697724
Second (problematic) call done on the first href found above (in this case the Access Point is Odoo, but could be any Access Point validated by Open Peppol):
https://iap-services.odoo.com/iso6523-actorid-upis%3A%3A0208%3A0246697724/services/busdox-docid-qns%3A%3Aurn%3Aoasis%3Anames%3Aspecification%3Aubl%3Aschema%3Axsd%3AInvoice-2%3A%3AInvoice%23%23urn%3Acen.eu%3Aen16931%3A2017%23compliant%23urn%3Afdc%3Apeppol.eu%3A2017%3Apoacc%3Abilling%3A3.0%3A%3A2.1
|
Hello @odoo/rd-security , Could we have your opinion on this ? The method requests a URL that is given through an LXML etree element. The problem is see is if a user manages to find a way to generate any etree element elsewhere in Odoo, he can create a demo db on Odoo (he'll be admin), create a server action and use both the etree generator and this method to call any service through us. What would be the best way to deal with that ? URLs in the etree element have no common part and can be anything returned to us by the PEPPOL service, so there is no way to make sure the URLs has a certain format. We could always make the method standalone. What do you think ? |
b4f9854 to
635d10d
Compare
Why is it a separate method on a separate model in a separate file? It's called from just one location, and doesn't even use Even better would be to have a separate object which is never returned from any method, and mediates all peppol interactions. |
61c9d7b to
efeebbc
Compare
|
Hello, thank you for the review @xmo-odoo Well in theory we could want to get that information for any partner, not just the company but you're right, for the moment we only use it in the context of the company, so why not encapsulate it.
I don't get a clear idea of what you mean here. Do you suggest to move this kind of call in a separate Python (not Odoo model) class ? We could but that would only work for this call and the precedent call, which are the only two calls made to Peppol Network directly. The rest of the Peppol traffic happens trough the Can you please check again if the change is correct ? This task should be in the freeze 🙂 |
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.
@robodoo override=ci/security
efeebbc to
3203ff3
Compare
Yes. IIRC the payment modules do that sort of things.
Maybe it should not do that, and while that model can be used to store configuration it should not mediate the interactions themselves? Generally speaking, the issue is that models can be called directly from server actions or even over RPC, so there's not much separating the untrusted user from calls through. Free functions or non-model objects still require significant care in their use, but they can encapsulate and abstract the calls and provide less opportunity to leak out capabilities. |
|
I see, thank you for the insight. I was considering removing/decoupling that model for other good reasons, that's one more "pro" 👍 |
Remove the Sender/Receiver checkbox. This checkbox is useless, it can be computed by checking the Peppol network. There are two possible flows: - Either the company is already receiver on Peppol through another access point than Odoo -> we need to register him as a sender. - Either the company is not registered anywhere -> we must register him as a receiver on Odoo. task-4394408
3203ff3 to
6f8961d
Compare
|
@robodoo r+ |
Remove the Sender/Receiver checkbox. This checkbox is useless, it can be computed by checking the Peppol network. There are two possible flows: - Either the company is already receiver on Peppol through another access point than Odoo -> we need to register him as a sender. - Either the company is not registered anywhere -> we must register him as a receiver on Odoo. task-4394408 closes #197353 Related: odoo/enterprise#79088 Related: odoo/upgrade#7206 Signed-off-by: Laurent Smet (las) <las@odoo.com>

Remove the Sender/Receiver checkbox. This checkbox is useless, it can be computed by checking the Peppol network.
There are two possible flows:
task-4394408