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

IRC log for #mojo, 2017-06-21

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

All times shown according to UTC.

Time Nick Message
00:13 kiwiroy joined #mojo
00:50 karjala_ joined #mojo
01:00 zivester joined #mojo
01:05 brunoramos joined #mojo
01:09 robinsmidsrod joined #mojo
01:20 disputin joined #mojo
02:25 noganex_ joined #mojo
02:43 robinsmidsrod joined #mojo
03:34 tchaves joined #mojo
05:22 schelcj joined #mojo
06:32 inokenty-w joined #mojo
06:39 AndrewIsh joined #mojo
06:58 ashimema joined #mojo
07:15 karjala_ joined #mojo
07:18 trone joined #mojo
07:41 dod joined #mojo
07:47 sri CandyAngel: you should mention how you benchmarked it, so others can replicate it
07:48 dod joined #mojo
07:50 CandyAngel Like attaching the benchmark script or just a short description?
07:52 good_news_everyon joined #mojo
07:52 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/vQTtr
07:52 good_news_everyon mojo/master 48ed07c CandyAngel: Optimise frame parsing by removing substr calls
07:52 good_news_everyon mojo/master 0b66a6d Sebastian Riedel: Merge pull request #1103 from CandyAngel/master...
07:52 good_news_everyon left #mojo
07:53 sri that said, you did remove a line of code, and that's a very easy way to convince me :)
07:53 CandyAngel :D
07:53 CandyAngel I thought you would notice that!
07:53 CandyAngel I was like "Woo, I reduced the line count :)"
07:54 CandyAngel So in the future, I should attach benchmark script or describe how I benchmarked it?
07:54 sri that would be good
07:55 CandyAngel Okay, I'll try to remember for next time
07:55 sri i tried benchmarking with something like perl -Ilib -Mojo -MMojo::WebSocket=parse_frame -E 'n { parse_frame \(my $foo = "\xf1\x08\x77\x68\x61\x74\x65\x76\x65\x72"), 1560000 } 100000'
07:55 sri but there is no measurable difference
07:55 CandyAngel http://codepad.org/5gwmBtKw
07:55 CandyAngel This is the script I used
07:56 sri oh, i see, so at the parse_frame level it might not be measurable
07:57 CandyAngel Yeah, sorry, I tried to get that across by saying only taking the unpack/substr calls into consideration
07:58 CandyAngel It's already really fast (like.. 178K/s for original code, 210K/s for changes on my machine)
07:59 sri CandyAngel++
08:00 CandyAngel ^_^
08:15 kes joined #mojo
08:47 rshadow joined #mojo
09:10 schelcj joined #mojo
11:00 tadzik joined #mojo
11:00 tadzik hello #mojo
11:05 tadzik I was trying out Mojolicious, and coming from Dancer I was missing something that handles authentication in a more readymade way than Mojolicious::Plugin::Authentication, something closer to https://metacpan.org/pod/Dancer2::Plugin::Auth::Extensible. So I whipped out my own implementation, and figured it might be useful for others too, so I made it into a module:
11:05 tadzik https://github.com/tadzik/Mojolicious-Controller-SimpleAuth
11:06 tadzik I only found one module being a Mojolicious Controller (::REST), it seems like everything gets implemented as plugins, do you think that'd be useful for anybody if properly cpanized?
11:06 tadzik any criticism would be welcome too :)
11:11 sri i don't understand Mojolicious::Plugin::Authentication at all, it seems totally pointless
11:12 * sri would love something that could handle OpenID and OAuth
11:13 sri at work we copypasta an OpenID controller around between projects that uses LWP ;p
11:15 tadzik well, my problem was "I can't be arsed to write my own login, logout and everything"
11:15 tadzik so of course I wrote it, but I'd rather not have to do it again :P
11:15 tadzik Mojolicious::Plugin::Authentication seemed like a bit of what I want, but not enough
11:17 tadzik and yeah, copypasting a controller is something I'd rather not have to do :)
11:17 tadzik for OAuth I think I've seen something on CPAN, M::Plugin::Web::Auth or so
11:18 sri if someone wants to make a cool auth module, i donate this beauty https://gist.github.com/anonymous/e4229bbefc56c8fb3b149ef7babfebf5
11:18 sri for OpenID
11:34 tchaves joined #mojo
12:37 perlpilot joined #mojo
12:52 marty joined #mojo
12:56 vicash tadzik: I have used Mojolicious::Plugin::Web::Auth for Google and LinkedIn sign-in buttons on one prototype and it works well.
12:58 marty joined #mojo
13:12 sri tadzik: re plugins vs controller base classes, i think controller base classes are so rare because they wouldn't work so well with Mojolicious::Lite
13:12 sri so most people make plugins, which work all the time
13:12 Pyritic joined #mojo
13:33 gizmomathboy joined #mojo
13:39 stephan48 joined #mojo
13:40 AndrewIsh joined #mojo
13:43 jberger sri: if you have a moment, could I get the LoC, tests and coverage for my talk?
13:50 orev joined #mojo
13:56 sri hehehe
13:56 sri 8717 lines of code
13:57 sri actually, 6 lines of those are deprecated
13:57 sri so 8711
13:57 sri 11512 tests
14:01 lev left #mojo
14:02 sri coverage still at 94.1%
14:03 jberger thanks!
14:26 dod joined #mojo
14:27 maschine joined #mojo
14:43 sri huh? https://twitter.com/ltriant/status/877335715075432453
14:48 rshadow joined #mojo
15:02 pink_mist 0_o
15:03 Intern42 joined #mojo
15:05 zivester joined #mojo
15:07 plicease joined #mojo
15:13 dod joined #mojo
15:16 disputin joined #mojo
15:16 rshadow joined #mojo
15:30 sri it's funny how i get poked about mojo auth at work too
15:30 sri we definitely should have better solutions for that
15:35 tadzik as in "auth component"?
15:35 mcsnolte joined #mojo
15:35 sri as in a group of plugins i think
15:35 tadzik nodnod
15:35 sri similar api, different auth methods, and shared example apps
15:36 tadzik is there a precedent in Catalyst perhaps?
15:37 pink_mist sri: you mean like, one M::P::Pg::Auth, another M::P::mysql::Auth, etc?
15:37 sri for database modules we do this thing where we adapt the same examples https://st.aticpan.org/source/SRI/Mojo-Pg-3.06/examples/blog/ https://st.aticpan.org/source/DBOOK/Mojo-SQLite-2.002/examples/blog/
15:37 sri pink_mist: yea
15:39 sri tadzik: i guess this counts, it's pretty heavy though https://metacpan.org/pod/Catalyst::Plugin::Authentication#Credential-verification
15:39 sri we tend to go more light
15:41 tadzik right, Catalyst being Catalyst, I suppose
15:41 sri like, i think hooks are better than actual modules with different database backends
15:44 pink_mist sri: what do you envision them actually doing though? do they impose a schema on the database?
15:45 sri pink_mist: no, just hooks for the information the plugin needs
15:46 sri like all the ways my openid controller interacts with $self->users->* https://gist.github.com/anonymous/e4229bbefc56c8fb3b149ef7babfebf5#file-openid-pm-L18
15:46 sri those would be hook points you have to provide when initializing the Auth::OpenID plugin
15:46 tadzik like my SimpleAuth! :P
15:47 PryMar56 joined #mojo
15:48 pink_mist sri: hm, then I'm not quite sure I see the need for different database versions if the database interaction is going to be hooked in anyway :P
15:48 sri pink_mist: you misunderstood me
15:48 sri i want no database code ;p
15:49 rshadow joined #mojo
15:49 sri my Mojo::Pg example link was just to demonstrate how we adapt examples
15:50 sri i meant to suggest that those plugins should share a similar example app just using the different auth methods
15:56 sri btw. suse is a good openid provider for testing :)
15:56 sri https://www.opensuse.org/openid/user/
16:30 sri also an interesting question is under vs condition for auth
16:31 sh14 joined #mojo
16:41 tholen joined #mojo
16:49 tadzik under is useful when you actually have a path prefix for the authed stuff
16:50 sri no need for a prefix
16:50 tadzik which is probably good idea most of the time, but you still need to hack around for others
16:50 tadzik no?
16:50 tadzik I'm misguided then :)
16:50 sri my $auth = $r->under('/')->to('...');
16:50 sri totally fine
16:51 tadzik and won't break other / paths, I assume. Alrighty then, cool
16:51 sri ye
16:53 sri the path  ->under('/') does nothing, it's equal to ->under('') and ->under()
16:56 tadzik nodnod
17:29 trone joined #mojo
17:30 gizmomathboy joined #mojo
17:32 tadzik heh, I think I'll end up pulling Mojolicious as a dep to a Dancer app. I can't think of anything smaller that'll let me do CSS selectors in tests.
17:33 pink_mist hah :P
17:33 pink_mist well, there's Mojo::DOM58
17:34 pink_mist but it doesn't come with Test::Mojo
17:35 genio Mojo's small enough that it's not a problem, IMO.
17:35 pink_mist agreed
17:36 tadzik I don't need Test::Mojo itself, we use Test::WWW::Mechanize::PSGI
17:36 tadzik but it only has content_like()
17:40 tuxlovesyou joined #mojo
17:41 PopeF joined #mojo
17:48 rshadow joined #mojo
17:52 PopeF joined #mojo
17:58 Intern42 joined #mojo
18:11 tholen joined #mojo
18:27 abra joined #mojo
18:31 kaare joined #mojo
18:33 bwf joined #mojo
18:40 zivester joined #mojo
18:58 rshadow joined #mojo
19:26 hrupp joined #mojo
19:34 PopeF0 joined #mojo
20:18 stryx` joined #mojo
20:37 rshadow joined #mojo
20:42 abra joined #mojo
21:01 sri oh, i think i know what that tweet earlier was about
21:02 sri Feersum and Twiggy are not PSGI compliant... lol
21:02 jberger hahaha
21:03 sri https://github.com/stash/Feersum/issues/13
21:03 jberger wow, yeah, ummmm, WONTFIX(TM)
21:03 sri it appears they need a real file handle to be returned, instead of an object that has getline/close methods
21:04 Pyritic joined #mojo
21:11 sri neat, AnyEvent doesn't install on Perl 5.26 anymore?
21:12 sri do "constants.pl.PL" failed, '.' is no longer in @INC; did you mean do "./constants.pl.PL"? at Makefile.PL line 25.
21:12 sri fun
21:13 sri looks like mlehmann has been notified 5 months ago
21:13 sri so, AnyEvent dead?
21:13 haarg half of cpan has that problem
21:16 Grinnz wow, he still hasn't fixed that?
21:16 Grinnz in a way, it's not surprising, but still
21:16 Grinnz sri: it's only a problem if you're running perl Makefile.PL yourself without PERL_USE_UNSAFE_INC=1
21:17 haarg Module::Runtime still has the same issue
21:17 Grinnz or your cpanm is out of date
21:18 sri that is good to know!
21:18 jberger btw, fun find of the day
21:18 jberger https://github.com/kensanata/oddmuse/blob/master/server.pl
21:19 Grinnz sri: of course, as this kludge is currently still planned to be removed eventually, it's only a matter of time before it becomes a bigger problem
21:28 sri suppose i've only had the other half of cpan installed so far :o
21:29 sri honestly, after basically everything i use just installed i thought it was already a non-issue
21:30 Grinnz sadly, lots of things still using Module::Install
22:03 PopeF joined #mojo
22:28 stryx` joined #mojo
23:26 zivester joined #mojo

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