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

IRC log for #mojo, 2018-01-24

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

All times shown according to UTC.

Time Nick Message
00:41 dhg joined #mojo
00:48 dhg joined #mojo
00:50 dhg left #mojo
00:59 mtths joined #mojo
01:05 aborazmeh joined #mojo
01:07 itaipu joined #mojo
01:19 dh7320 joined #mojo
01:26 dhg joined #mojo
01:34 dustinm joined #mojo
02:42 dikim joined #mojo
02:57 ilbot2 joined #mojo
02:57 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:10 Leffe joined #mojo
03:37 hesco1 Has the Mojolicious::Plugin::Authentication module been seen to work in the real world? This is my first time reaching for it. Am I misunderstanding the expectation advertised by this plugin?
03:38 hesco1 https://gist.github.com/hesco/6e05694f35a733fd36b9279dfd01236c
03:48 hesco1 Thanks, Grinnz.  Yes, I see that that works, and renders new routes.  ::Plugin::Authentication has perldoc claiming it will add additional methods to $self.  But my tests do not seem to support that theory.
03:48 hesco1 jberger: No, but the role wants to use a plugin to modify the $app object.
03:51 hesco1 although it is not itself a plugin.  it is a role, so I can pass it around as needed with a `with 'MyApp::Roles::Auth';`
03:53 hesco1 And thanks to all those who pointed me towards 'The Good Place'.
04:45 Leffe joined #mojo
05:04 dboehmer joined #mojo
05:18 Leffe joined #mojo
06:29 inokenty-w joined #mojo
06:42 Vandal joined #mojo
06:56 McA joined #mojo
07:24 karjala_ joined #mojo
07:34 dod joined #mojo
07:42 AndrewIsh joined #mojo
07:47 dod joined #mojo
08:00 [1]mohawk joined #mojo
08:05 trone joined #mojo
08:06 CHYC joined #mojo
08:23 ashimema joined #mojo
08:27 dod joined #mojo
08:32 ashimema joined #mojo
08:35 ashimema joined #mojo
08:37 Afristar_ joined #mojo
08:37 karjala__ joined #mojo
08:41 klapperl_ joined #mojo
08:41 Zx3 joined #mojo
08:42 pink_mis1 joined #mojo
08:42 Afristar__ joined #mojo
08:44 mtths joined #mojo
08:47 abracadaniel joined #mojo
08:48 vicash joined #mojo
08:52 tinita joined #mojo
08:54 ribasushi joined #mojo
08:54 elik joined #mojo
08:54 tyldis joined #mojo
08:54 suede joined #mojo
08:54 noganex_ joined #mojo
08:54 ashimema joined #mojo
08:54 dboehmer joined #mojo
08:54 Lee joined #mojo
08:54 diegok joined #mojo
08:54 schelcj joined #mojo
08:54 dotan_convos joined #mojo
08:54 kgoess joined #mojo
08:54 xdg joined #mojo
08:54 hkclark joined #mojo
09:07 Edward joined #mojo
09:27 Leffe joined #mojo
09:31 sri hesco1: authentication plugin serves no real purpose i think
09:44 dhg joined #mojo
09:47 mohawk sri, what's your advised solution to authentication?
09:48 sri growing guide
09:48 mohawk ok
09:50 mohawk sri, you don't think the REST section maybe could use a pointer at the OpenAPI plugin?
09:51 sri we don't really link to 3rd party modules we don't specifically support in some way
09:51 gregf_ joined #mojo
09:51 mohawk fair
09:52 mohawk i think i'm being dumb, the word "authentication" doesn't feature in the growing guide?
09:53 mohawk isn't "chmod 744" an unusual mode?
10:10 dhg joined #mojo
10:10 * coolo can find 13 files with that permissions :)
10:11 coolo -rwxr--r-- 1 root root 378 14. Sep 16:58 /etc/init.d/boot.local
10:12 maschine_ joined #mojo
10:13 marty_ joined #mojo
10:15 dustinm` joined #mojo
10:16 cng joined #mojo
10:25 tianon joined #mojo
10:29 mtj joined #mojo
10:29 jacoby joined #mojo
10:40 itaipu joined #mojo
10:44 markong joined #mojo
11:20 tchaves joined #mojo
11:27 Leffe joined #mojo
11:42 trone joined #mojo
12:00 Zx3 joined #mojo
12:32 AndrewIsh joined #mojo
12:51 dod joined #mojo
14:04 karjala_ joined #mojo
14:28 karjala_ joined #mojo
14:29 Pyritic joined #mojo
14:30 itaipu joined #mojo
14:33 jberger it comes down to the fact that authentication with an "under" route is so easy that it doesn't really need a middleware
14:40 silvermike joined #mojo
14:40 silvermike hello, anybody alive?
14:40 zen I hope so
14:41 silvermike great, hi zen - just courious if there are someone
14:42 CandyAngel What about the undead in the room? Not nice to rule them out :P
14:43 maschine_ well, there's Purl..  he's (she's?) kindof undead in a way..
14:43 silvermike ;] i;m glad
14:43 CandyAngel Wait.. where did purl go?
15:05 gryphon joined #mojo
15:16 jacoby joined #mojo
15:19 dod joined #mojo
15:21 jberger the authorities have been notified
15:21 jberger I'm actually on track to have access to her
15:22 jberger just haven't quite worked out all the details yet
15:23 jabberwok joined #mojo
15:24 sri free purl!
15:25 purl joined #mojo
15:25 jberger I DID IT!
15:26 sri super awesome cool!
15:29 genio haha
15:29 sri purl: welcome back
15:29 purl Your dreams were your ticket out.
15:29 genio jberger: Now just take a look at her code and fight the urge to fix things
15:30 jberger just doing that now
15:30 genio I ran her for a couple of years on EFNet and it was tough. your OCD will kick in
15:31 genio in the end, I changed nothing and tried to block it out of my mind
15:46 stqr joined #mojo
16:02 ChmEarl joined #mojo
16:17 jberger sri: I'd like to propose a small addition to the get command
16:17 jberger a username/password entry similar to cURL's -u
16:18 jberger because so many sites require special characters in passwords and because I use lastpass to generate them, I'm having more and more passwords that can't be stuffed into the url practically
16:19 jberger https://curl.haxx.se/docs/manpage.html#-u
16:20 jberger we don't have to support the prompt for password (though if we wanted to, I think we could, it could share the code with cpanify too)
16:21 jberger no, actually I don't think we shoudl
16:23 sri why not?
16:23 * sri wouldn't mind a Mojo::Util::input, siilar to the python function
16:25 sri but i'm not going to complain :p
16:25 jberger I guess my fear is making something that requires input from the user
16:25 sri guess the case for it is not very strong
16:25 jberger ie worried about blocking scripts
16:25 jberger but I do have two use cases :-P
16:26 jberger oh, and re python, I specifically mean a masking input
16:26 jberger for passwords
16:27 jberger I whittled it down to this a while back: https://gist.github.com/jberger/5023930905e05b499041ea7d2656bd0c
16:27 jberger not sure if it works on windows, but it works on linux and mac
16:27 jberger someone want to test on windows?
16:27 sh14 joined #mojo
16:28 CandyAngel Doesn't work for me
16:29 CandyAngel "termios not implement on this architecture"
16:29 jberger sad
16:29 jberger ok nevermind that then
16:29 jberger thanks CandyAngel
16:30 sri Sad.
16:30 jberger heh, I'm kinda surprised that the get command doesn't use Mojo::URL
16:31 jberger anyway, I think I can make a patch for -u that only costs two lines, but it does mean that the $url is only an object sometimes
16:31 jberger well, 3 lines with the import
16:32 genio jberger: I tend to do basic auth by generating the hash ahead of time and including the header
16:32 genio even in curl
16:33 disputin joined #mojo
16:35 jberger genio: curious, why?
16:35 purl curious, why are they suspicious of DBIC?
16:35 jberger not wanting your password in your history I suspect?
16:36 jberger purl: forget curious, why
16:36 purl jberger: I forgot curious, why
16:37 genio jberger: I find it easier than figuring out ways to escape the crazy characters in some of the passwords, etc.
16:38 genio I should have said encode rather than hash. it's just base64, so it's not like it does much good in hiding it from the history
16:39 jberger genio: in curl you can just do -u 'username:password', surely that covers most escaping cases right?
16:39 jberger and that's essentially what I'd like to add to the get command
16:42 good_news_everyon joined #mojo
16:42 good_news_everyon [mojo] jberger created get-user (+1 new commit): https://git.io/vNKz4
16:42 good_news_everyon mojo/get-user e094c16 Joel Berger: add cURL-style -u for username/password entry to the get command
16:42 good_news_everyon left #mojo
16:43 genio jberger: yea, lots of my passwords contain ' and other similarly annoying characters to remember how to escape in the shell
16:43 good_news_everyon joined #mojo
16:43 good_news_everyon [mojo] jberger force-pushed get-user from e094c16 to 89138c4: https://git.io/vNKzy
16:43 good_news_everyon mojo/get-user 89138c4 Joel Berger: add cURL-style -u for username/password entry to the get command
16:43 good_news_everyon left #mojo
16:43 jberger yeah, I guess this doesn't help passwords containing a single quote
16:44 genio and sometimes I am in a conference room projecting and I'd rather project the encoded stuff than the raw pass
16:44 genio it's become a force of habit at this point
16:44 jberger and indeed nothing would help either of those use-cases really :-P
16:44 sri too many lines, i give you 2
16:46 * sri making deals
16:46 jberger not sure this code could be any more concise than that, I can try to find another line to golf?
16:50 jberger though, the max redirects line above it has nothing to do with the commented proxy detection on the line above THAT
16:50 jberger so I could squash out the comment and newline
16:51 sri i'm fine with golfing other lines too, a line is a line :p
16:52 sri comments don't count though
16:55 jberger actually the two lines starting with $url look better next to each other anyway
16:55 jberger and I've found a line \o/
16:55 good_news_everyon joined #mojo
16:55 good_news_everyon [mojo] jberger force-pushed get-user from 89138c4 to 79986bd: https://git.io/vNKzy
16:55 good_news_everyon mojo/get-user 79986bd Joel Berger: add cURL-style -u for username/password entry to the get command
16:55 good_news_everyon left #mojo
16:55 itaipu joined #mojo
16:57 jberger I was getting worried, the rest of the code is pretty tight
16:57 jberger then all of a sudden, gift line!
17:00 CandyAngel Aren't you also no longer keeping a strong reference to the root by merging those lines?
17:00 CandyAngel (regarding the comment above it)
17:00 jberger does it need a strong reference?
17:00 jberger ah damn
17:01 jberger I was surprised there was such an obvious win
17:01 * jberger sulks
17:03 CandyAngel I don't see why it would need a strong reference.. it isn't weakened and goes out of scope at the end anyway..?
17:04 CandyAngel And _select is called right at the end of 'run' and nowhere else
17:07 jberger I suspect there is weakening in Mojo::DOM
17:07 jberger it would make for a very expensive leak
17:09 jberger that said, it does seem to work without it
17:10 CandyAngel Maybe it was just defensively there because it currently working might be reliant on how everything gets called
17:11 CandyAngel Like, you aren't using it once _select returns
17:11 jberger I don't follow you
17:13 jamesaxl joined #mojo
17:13 CandyAngel That's fine, I'm probably not making any sense anyway :P
17:14 CandyAngel I don't use weaken, so I'm not super sure when things get destroyed when you do..
17:19 jberger so sri, curious about that strong reference thing, it seems to work without it
17:19 jberger I think I have another option, but its tight
17:19 CandyAngel Does it work because you aren't asking for the selectors parents?
17:20 CandyAngel Or, rather, because nothing in the command is
17:20 jberger could be
17:20 purl it has been said that could be is not sufficient! I want fatal or nothing.
17:20 dhg joined #mojo
17:21 good_news_everyon joined #mojo
17:21 good_news_everyon [mojo] jberger force-pushed get-user from 79986bd to 6dbde63: https://git.io/vNKzy
17:21 good_news_everyon mojo/get-user 6dbde63 Joel Berger: add cURL-style -u for username/password entry to the get command
17:21 good_news_everyon left #mojo
17:22 jberger oh damn, no that double encodes
17:24 jberger I can cheat by s/encode_json/to_json/ ;-P
17:24 jberger is that too tricky?
17:25 jberger actually ...
17:25 purl actually ... is there a way to customize trace output?
17:26 jberger purl forget actually ...
17:26 purl jberger: I forgot actually
17:26 jberger why check for type there at all
17:27 jberger to_json/encode_json work on strings/numbers
17:29 Grinnz jberger: it will print "foo" instead of foo
17:30 Grinnz not sure if that matters
17:30 jberger ah, that's it
17:30 Grinnz but yeah, you need to_json there
17:31 sri jberger: legacy?
17:31 purl rumour has it legacy is a coded pejorative for 'fail'
17:31 sri that code is pretty old
17:31 jberger sri: you are talking about the strong ref/
17:33 jberger anyway, I can include either or both of the DOM/JSON golfs
17:33 jberger your choice
17:36 jberger could/should to_json/encode_json be called on any ref?
17:37 jberger currently you get 1/0 for a boolean, would it be better to get true/false?
17:39 jberger hmmm maybe not
17:39 jberger command line pipelines probably handle 1/0 as better booleans than true/false
17:40 good_news_everyon joined #mojo
17:40 good_news_everyon [mojo] jberger force-pushed get-user from 6dbde63 to 865ce24: https://git.io/vNKzy
17:40 good_news_everyon mojo/get-user 865ce24 Joel Berger: add cURL-style -u for username/password entry to the get command
17:40 good_news_everyon left #mojo
17:40 jberger anyway, force-pushing a commit with both golfs
17:40 jberger there it is
17:43 sh14 joined #mojo
17:50 Leffe joined #mojo
17:58 sh14|2 joined #mojo
18:02 trone joined #mojo
18:10 sri oh, i did not see your previous changes because you just force pushed them over
18:10 sri i guess the hsrd ref is needed to preserve the root
18:10 jamesaxl joined #mojo
18:12 Grinnz my $results = (my $dom = Mojo::DOM->new($buffer))->find($selector);
18:12 Grinnz voila, hard ref :P
18:21 Seth joined #mojo
18:30 sri :)
18:36 dod joined #mojo
19:36 karjala_ joined #mojo
21:22 disputin joined #mojo
21:44 trone_ joined #mojo
21:53 dikim joined #mojo
22:16 dhg joined #mojo
23:08 dod joined #mojo
23:58 jberger ok so I had to do $work
23:58 jberger but where do we want to go with it? should I use Grinnz one-line strong ref or just remove that?
23:59 jberger I can live with one or the other golf

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