The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2018-01-15

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 Leffe joined #mojo
00:24 kiwiroy joined #mojo
00:36 kiwiroy joined #mojo
00:48 kiwiroy joined #mojo
01:06 aborazmeh joined #mojo
01:06 kiwiroy joined #mojo
01:18 kiwiroy joined #mojo
02:01 Leffe joined #mojo
02:01 simcop2387 joined #mojo
02:58 ghenry joined #mojo
03:50 klapperl joined #mojo
04:16 plicease joined #mojo
04:26 ghenry joined #mojo
04:54 ghenry joined #mojo
05:00 orev joined #mojo
05:04 dboehmer_ joined #mojo
05:22 inokenty-w joined #mojo
05:39 anon_ joined #mojo
06:26 dod joined #mojo
06:32 dod joined #mojo
06:45 kiwiroy joined #mojo
07:03 McA joined #mojo
07:34 Vandal joined #mojo
07:44 karjala_ joined #mojo
07:50 dod joined #mojo
07:52 AndrewIsh joined #mojo
07:56 FROGGS joined #mojo
08:15 trone joined #mojo
09:04 ashimema joined #mojo
09:27 tyldis What does poeple use for authentication and authorization with Mojo? Thinking mainly APIs.
09:33 tyldis Evaluating possible backends as well, so KeyCloak is on the table. Does SAML and OpenIDconnect .
09:34 marcus tyldis: basic auth? ;-)
09:34 marcus or oauth2
09:35 tyldis OAuth2 is basically OpenID Connect, if I'm not mistaken
09:35 marcus basic auth over https with an api token is at least extremely simple for api consumers.
09:35 tyldis Agreed, but how do you manage them? :)
09:36 marcus tyldis: openid connect is a layer on top of oauth2
09:36 marcus create table api_tokens ( ... ); :)
09:37 tyldis I need an internal oauth2 service
09:39 tyldis I started with the roll-your-own API key service, but it involves a lot of work. Like key management, and issuing keys
09:40 tyldis Key rotation...
09:40 purl key rotation is, like, a bit out of reach for me I think, at least not "runtime in the application code itself" - will try something, no promise
09:45 pirateFinn joined #mojo
09:57 Gedge_ joined #mojo
10:13 Gedge joined #mojo
10:55 tchaves joined #mojo
12:09 trone joined #mojo
12:27 karjala_ joined #mojo
13:02 Afristar joined #mojo
13:31 Dandre joined #mojo
13:35 nic joined #mojo
14:01 Pyritic joined #mojo
14:03 kes joined #mojo
14:17 claude joined #mojo
14:40 gryphon joined #mojo
14:51 marty joined #mojo
14:53 maschine joined #mojo
15:08 robx joined #mojo
15:12 marcus We're seeing Zero downtime software upgrade failed on release sometimes, which causes the systemd unit to die
15:12 marcus thinking we might have to change restart=on-failure to =always
15:20 marty_ joined #mojo
15:30 sri marcus: fix should be in master
15:30 sri the default timeout was wrong
15:30 sri guess i should release
15:31 sri was hoping for more open issues to get resolved first, but it doesn't look like it
15:35 good_news_everyon joined #mojo
15:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vNCd3
15:35 good_news_everyon mojo/master 0423059 Sebastian Riedel: bump version
15:35 good_news_everyon left #mojo
15:42 marcus nice!
15:50 nicomen @sri the current timeout leads to a rece conditon with heartbeat or how was it wrong?
15:51 sri yes
15:52 nicomen ah nice
15:59 zivester joined #mojo
16:24 ChmEarl joined #mojo
17:22 gregf_ hi
17:22 gregf_ i was looking at the docs and was wondering if someone could point me to where a controller action can be called from another controller action
17:24 jberger gregf_: there isn't a good way to do that because that is a good indication that you really should be abstracting that code
17:25 gregf_ jberger: abstracting as in moving it to the base controller?
17:25 jberger if both actions are in the same controller you could make a private controller method, otherwise, you probably want to make a helper or perhaps even a model class/method
17:25 jberger depends on what it is
17:25 jberger what does the shared code do?
17:25 gregf_ no no, they're different controllers
17:26 gregf_ its not shared tbh, they're separate API calls
17:26 gregf_ and one API call needs the ther
17:26 gregf_ er, s/ther/other/
17:26 gregf_ for filtering
17:26 jberger ok so that definitely sounds like that would be model then
17:27 jberger mojo is model agnostic, but that doesn't mean we don't encourage making a model layer for yourself
17:27 gregf_ right, but then i should be able to get an instance of any controller and call an action? :/
17:28 gregf_ iirc, in catalyst i could just do $c->controller('foo')->action('bar') # something along those lines
17:28 jberger I'd say you want to make your code so each action could call that model method
17:28 dod joined #mojo
17:29 gregf_ ah - i get you now.. but the model is not a model, its another API :D
17:29 jberger an external api?
17:29 gregf_ so its like MObileAPI -> myAPI -> anotherAPI
17:29 mohawk gregf_, this is a thing i looked at myself with GraphQL::Convert::Plugin::OpenAPI
17:30 gregf_ yep, an external API
17:30 mohawk where the graphql service is running on the same process as the openapi one
17:30 jberger mohawk: let's make sure we understang gregf_ 's existing architecture before we propose solutions for it
17:30 mohawk i didn't propose anything
17:30 mohawk i simply said i'd faced the same thing
17:30 jberger ah, sorry, I misread
17:31 mohawk communication is an iterative process :-)
17:31 jberger (I'm really splitting myself between too many discussions as it is :o )
17:31 mohawk ha ha!
17:31 gregf_ true.. but at times.. it could end in a deadlock ;(
17:31 mohawk sometimes the "correct" answer to that problem is just to extract the code to elsewhere, like a model
17:32 mohawk gregf_, on which machines are the 3 APIs running?
17:32 mohawk same or different?
17:32 gregf_ different.. on ec2 instances
17:32 mohawk are they all yours?
17:32 jberger gregf_: so it sounds like you need to call the second api using a user agent?
17:32 gregf_ well, owned by the same company.. but different teams
17:33 jberger you can't just use controller/action to do that
17:33 gregf_ jberger: yes, all http
17:33 jberger so I'd suggest making a helper if it is just one call or else a tiny model abstraction for it if there will be many different calls
17:33 mohawk yes, sounds like a non-blocking UserAgent call - i recommend using promises ie get_p etc :-)
17:33 jberger (and tie the model in via a helper)
17:34 mohawk what jberger said
17:34 jberger this blog example is kinda the canonical example of model/helper pattern in mojo land now
17:34 jberger https://github.com/kraih/mojo-pg/tree/master/examples/blog
17:35 gregf_ ok. so i need to use helpers
17:35 jberger in your case rather than the model talking to postgres via Mojo::Pg you'd talk to your second api via Mojo::UserAgent
17:35 gregf_ let me read through that.
17:35 gregf_ well, the model layer is abstracted, as it can connect to Oracle or another API
17:36 gregf_ @jberger @mohawk thanks for the inputs.
17:38 * sri agrees, that's model layer
17:38 gregf_ not sure if that model example might help.. but let me try and readup, else i'll have to refactor :)
17:39 mohawk gregf_, if all APIs are using perl, you might be best off with all of them using one perl library that is the shared "model", which would avoid several API hops before talking to DB
17:40 gregf_ you guys should try and provide that option as well, calling other controller actions
17:40 gregf_ no no, API's are crazy
17:40 gregf_ some use node and some .net core
17:41 gregf_ or prolly write mojo in perl6 and provide tha option *runs*
17:42 gregf_ super day ahead guys!
17:43 dantti_laptop joined #mojo
17:48 jberger microservice pattern with http for interchange is fine, especially when the services are developed by different groups
17:48 jberger that's ok by me
17:49 sri gregf_: i designed that catalyst feature, and i think it was wrong :)
17:49 jberger catalyst could talk to other apis via controller/action?
17:54 sri catalyst dispatching was a lot more dynamic, it was pretty stupid https://metacpan.org/pod/Catalyst#$c-%3Eforward(-$action-%5B,-%5C@arguments-%5D-)
17:55 sri the idea was that back then we had no clue how web development would evolve and which patterns would end up winning, so we just allowed everything
17:56 sri not that mojo didn't have to learn from mistakes...
17:57 sri i still remember the failure of not putting model classes into a model namespace, that confused the hell out of many beginners
17:59 sri you would just use $c->controller('Foo'), $c->model('Bar'), $c->view('Baz') to get an instance of that specific class
18:00 sri or rather *the* one instance, since they all would be preloaded on startup, since each controller contained its own routes
18:07 trone joined #mojo
18:27 dantti_laptop joined #mojo
18:31 geospeck joined #mojo
18:40 Pyritic joined #mojo
18:54 * jberger reads that Catalyst doc and hugs Mojolicious
18:58 nicomen win 29
19:17 dantti_laptop|2 joined #mojo
19:36 Pyritic joined #mojo
20:53 maschine joined #mojo
21:57 marty joined #mojo
22:03 ghenry joined #mojo
22:12 marty joined #mojo
22:15 jberger my fresh hell: https://github.com/Cougar/lg/blob/develop/lg.cgi
22:16 pink_mist at least it's using XML::Parser and not XML::Simple
22:17 pink_mist and then I see &read_config; >_>
22:17 * pink_mist runs away in hrror
22:17 jberger oh, its bad
22:17 pink_mist +o
22:17 jberger its a cgi script ... but where is CGI.pm :-P
22:17 jberger yeah, does it all itself
22:18 jberger not saying CGI.pm is great ... but still
22:18 pink_mist yeah >_<
22:19 Grinnz not even cgi-lib.pl?
22:24 jberger newp
22:29 genio jberger: oh, gods
22:34 markong joined #mojo
22:42 marty joined #mojo
23:17 maschine oh man.. that looks like something I would have wrote 20 years ago :p

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary