non authenticated end point

48 views
Skip to first unread message

Vincent Bastos

unread,
Nov 24, 2016, 7:11:27 AM11/24/16
to tryton-dev
Is it possible to create an end point on the server that does not require authentication?

I would like to implement a queue to send SMS's using the Twilio API. When you send a request to send a message, it is possible to set a callback url [1] with a parameter in the domain rather than as a parameter.

Sergi Almacellas Abellana

unread,
Nov 24, 2016, 7:17:33 AM11/24/16
to tryto...@googlegroups.com
Hi Vincent,

El 24/11/16 a les 13:11, Vincent Bastos ha escrit:
> Is it possible to create an end point on the server that does not
> require authentication?
>
> I would like to implement a queue to send SMS's using the Twilio API.
> When you send a request to send a message, it is possible to set a
> callback url [1] with a parameter in the domain rather than as a parameter.
>

You can use flask_tryton [1] to create a custom endpoint that conects to
the database and processes the requests. This request won't require any
authentication.

Hope it helps,

[1] https://pypi.python.org/pypi/flask_tryton/0.6
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Vincent Bastos

unread,
Nov 24, 2016, 7:22:35 AM11/24/16
to tryto...@googlegroups.com
ok thanks. I had not thought of this.

I'm not sure how to actually implement this in terms of putting it together in a module - if that even makes sense. Can I simple create a flask application in my module?
 
--
Vincent Bastos
Lava Lab Software

Sergi Almacellas Abellana

unread,
Nov 24, 2016, 7:30:17 AM11/24/16
to tryto...@googlegroups.com
El 24/11/16 a les 13:22, Vincent Bastos ha escrit:
> ok thanks. I had not thought of this.
>
> I'm not sure how to actually implement this in terms of putting it
> together in a module - if that even makes sense. Can I simple create a
> flask application in my module?
Of course, but you should take care to run this application as a
separate process, as the tryton server will not run it for you.

Cédric Krier

unread,
Nov 24, 2016, 7:35:03 AM11/24/16
to tryto...@googlegroups.com
Indeed I think it will be better in 4.2 to use a route without the
user_application decorator but of course you must be careful about the
process because your endpoint will be exposed to anyone.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Vincent Bastos

unread,
Nov 24, 2016, 7:44:28 AM11/24/16
to tryto...@googlegroups.com
 ok, so for now I can create an sms_queue module but without updating the status of an sms.

Oscar Alvarez

unread,
Nov 24, 2016, 8:05:38 AM11/24/16
to tryto...@googlegroups.com
We are created a twilio (can be added another plattforms as Clickatell) send messsages module in Tryton, maybe help it, you can see here:

https://bitbucket.org/presik/trytonpsk_sms


--
Vincent Bastos
Lava Lab Software
--
You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/CACLX58BXWxUbcRmp9O%3DZRtmD4xYf_KKitpAEmw7MSLK%2B1wcWUA%40mail.gmail.com.

Cédric Krier

unread,
Nov 24, 2016, 8:20:02 AM11/24/16
to tryto...@googlegroups.com
On 2016-11-24 22:44, Vincent Bastos wrote:
> ok, so for now I can create an sms_queue module but without updating the
> status of an sms.

I do not think you need a queue [1]. You can also use the 2 phase commit
like the sendmail_transactional does.

[1] https://mikehadlow.blogspot.nl/2012/04/database-as-queue-anti-pattern.html

Vincent Bastos

unread,
Nov 28, 2016, 5:38:34 AM11/28/16
to tryton-dev


On Thursday, November 24, 2016 at 11:20:02 PM UTC+10, Cédric Krier wrote:
On 2016-11-24 22:44, Vincent Bastos wrote:
>  ok, so for now I can create an sms_queue module but without updating the
> status of an sms.

I do not think you need a queue [1]. You can also use the 2 phase commit
like the sendmail_transactional does.

[1] https://mikehadlow.blogspot.nl/2012/04/database-as-queue-anti-pattern.html

Yeah, I meant to follow this pattern rather than a queue, but then shouldn't I handle the case where Twilio is not reachable?

Btw Twilio provides a way to validate their requrests [1]

Reply all
Reply to author
Forward
0 new messages