From Daniel.Berger at qwest.com Mon Jun 2 17:12:15 2008 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon, 2 Jun 2008 16:12:15 -0500 Subject: Web development at the speed of light (A Camping Success Story) Message-ID: <7524A45A1A5B264FA4809E2156496CFB023D32DE@ITOMAE2KM01.AD.QINTRA.COM> Hi all, Friday. Noon. I'm tasked with writing a small web front end. LDAP validation required. Form data validation required. I have to post form data to an external URL because of retarded licensing issues. And validate the result using screen scraping. I had the initial version done and online that night. Some finishing touches were added this afternoon. THANK YOU CAMPING!!! Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From kprojection at gmail.com Tue Jun 3 01:01:54 2008 From: kprojection at gmail.com (Eric Mill) Date: Tue, 3 Jun 2008 01:01:54 -0400 Subject: Web development at the speed of light (A Camping Success Story) In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB023D32DE@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFB023D32DE@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hooray! On Mon, Jun 2, 2008 at 5:12 PM, Berger, Daniel wrote: > Hi all, > > Friday. Noon. I'm tasked with writing a small web front end. LDAP > validation required. Form data validation required. > > I have to post form data to an external URL because of retarded > licensing issues. And validate the result using screen scraping. > > I had the initial version done and online that night. Some finishing > touches were added this afternoon. > > THANK YOU CAMPING!!! > > Dan > > > This communication is the property of Qwest and may contain confidential or > privileged information. Unauthorized use of this communication is strictly > prohibited and may be unlawful. If you have received this communication > in error, please immediately notify the sender by reply e-mail and destroy > all copies of the communication and any attachments. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From why at whytheluckystiff.net Tue Jun 3 04:11:45 2008 From: why at whytheluckystiff.net (_why) Date: Tue, 3 Jun 2008 03:11:45 -0500 Subject: @@state_secret Message-ID: <20080603081145.GM70833@beekeeper.hobix.com> I was having some issue getting the class variables in Camping::Session to work with some old apps, so I've changed @@state_secret to a method. module Blog include Camping::Session def state_secret; "kxxxx" end end Also, merged some of zimbatm's patches. And trying to revive the Junebug wiki since it's still my favorite one. Oh and Passenger is working with Camping 2.0. You just use `run Blog` in your config.ru (following everything else in the latest Passenger docs.) Best to wait until they release 1.1.0 gems. _why From david.gurba at gmail.com Tue Jun 3 09:26:17 2008 From: david.gurba at gmail.com (David Gurba) Date: Tue, 3 Jun 2008 06:26:17 -0700 Subject: @@state_secret In-Reply-To: <20080603081145.GM70833@beekeeper.hobix.com> References: <20080603081145.GM70833@beekeeper.hobix.com> Message-ID: I like Junebug alot ... maybe I'll try to add bluecloth to it or something besides straight textile. On Tue, Jun 3, 2008 at 1:11 AM, _why wrote: > I was having some issue getting the class variables in > Camping::Session to work with some old apps, so I've changed > @@state_secret to a method. > > module Blog > include Camping::Session > def state_secret; "kxxxx" end > end > > Also, merged some of zimbatm's patches. And trying to revive the > Junebug wiki since it's still my > favorite one. > > Oh and Passenger is working with Camping 2.0. You just use > `run Blog` in your config.ru (following everything else in the > latest Passenger docs.) Best to wait until they release 1.1.0 gems. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Wed Jun 4 10:12:54 2008 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 4 Jun 2008 16:12:54 +0200 Subject: @@state_secret In-Reply-To: <20080603081145.GM70833@beekeeper.hobix.com> References: <20080603081145.GM70833@beekeeper.hobix.com> Message-ID: <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> Great! If we clean up the documentation, are we then ready for 2.0? The only thing I want now is the catch(:halt) in #service, so we can do stuff like this: module Example module Helpers def require_login! unless @state.user_id redirect Login throw :halt end end end module Controllers class List < R '/list' def get require_login! # do stuff end end end end (It's already in my repo, just pull from judofyr/master) On Tue, Jun 3, 2008 at 10:11 AM, _why wrote: > > I was having some issue getting the class variables in > Camping::Session to work with some old apps, so I've changed > @@state_secret to a method. > > module Blog > include Camping::Session > def state_secret; "kxxxx" end > end > > Also, merged some of zimbatm's patches. And trying to revive the > Junebug wiki since it's still my > favorite one. > > Oh and Passenger is working with Camping 2.0. You just use > `run Blog` in your config.ru (following everything else in the > latest Passenger docs.) Best to wait until they release 1.1.0 gems. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list -- Magnus Holm From blueberry at creativepony.com Wed Jun 4 10:30:35 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Thu, 5 Jun 2008 00:30:35 +1000 Subject: @@state_secret In-Reply-To: <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> References: <20080603081145.GM70833@beekeeper.hobix.com> <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> Message-ID: I second this! On 05/06/2008, at 12:12 AM, Magnus Holm wrote: > Great! If we clean up the documentation, are we then ready for 2.0? > > The only thing I want now is the catch(:halt) in #service, so we can > do stuff > like this: > > module Example > module Helpers > def require_login! > unless @state.user_id > redirect Login > throw :halt > end > end > end > > module Controllers > class List < R '/list' > def get > require_login! > # do stuff > end > end > end > end > > (It's already in my repo, just pull from judofyr/master) > > On Tue, Jun 3, 2008 at 10:11 AM, _why > wrote: >> >> I was having some issue getting the class variables in >> Camping::Session to work with some old apps, so I've changed >> @@state_secret to a method. >> >> module Blog >> include Camping::Session >> def state_secret; "kxxxx" end >> end >> >> Also, merged some of zimbatm's patches. And trying to revive the >> Junebug wiki since it's still my >> favorite one. >> >> Oh and Passenger is working with Camping 2.0. You just use >> `run Blog` in your config.ru (following everything else in the >> latest Passenger docs.) Best to wait until they release 1.1.0 gems. >> >> _why >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > > -- > Magnus Holm > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From julian.tarkhanov at gmail.com Wed Jun 4 16:23:27 2008 From: julian.tarkhanov at gmail.com (Julian Tarkhanov) Date: Wed, 4 Jun 2008 22:23:27 +0200 Subject: @@state_secret In-Reply-To: References: <20080603081145.GM70833@beekeeper.hobix.com> <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> Message-ID: <2FBA4ED2-167A-48E8-8AE4-89A6132C1C59@gmail.com> Why do you need that if you can just skip calling super if the authentication fails? On 4 jun 2008, at 16:30, Bluebie, Jenna wrote: > I second this! > > On 05/06/2008, at 12:12 AM, Magnus Holm wrote: > >> Great! If we clean up the documentation, are we then ready for 2.0? >> >> The only thing I want now is the catch(:halt) in #service, so we >> can do stuff >> like this: From blueberry at creativepony.com Wed Jun 4 18:46:39 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Thu, 5 Jun 2008 08:46:39 +1000 Subject: @@state_secret In-Reply-To: <2FBA4ED2-167A-48E8-8AE4-89A6132C1C59@gmail.com> References: <20080603081145.GM70833@beekeeper.hobix.com> <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> <2FBA4ED2-167A-48E8-8AE4-89A6132C1C59@gmail.com> Message-ID: <7DCC7A0B-DD2B-4F3B-AE4E-07EBBE3A1890@creativepony.com> No no, this is something we can use in helper methods, so writing 'render :blah' for instance would render it and terminate the thingo... instead of having to be the very last thing in the controller method or be prefixed with return. Though I don't mind this too much, it would open possibilities for some nifty things. On 05/06/2008, at 6:23 AM, Julian Tarkhanov wrote: > Why do you need that if you can just skip calling super if the > authentication fails? > > On 4 jun 2008, at 16:30, Bluebie, Jenna wrote: > >> I second this! >> >> On 05/06/2008, at 12:12 AM, Magnus Holm wrote: >> >>> Great! If we clean up the documentation, are we then ready for 2.0? >>> >>> The only thing I want now is the catch(:halt) in #service, so we >>> can do stuff >>> like this: > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From aredridel at nbtsc.org Wed Jun 4 18:58:21 2008 From: aredridel at nbtsc.org (Aria Stewart) Date: Wed, 4 Jun 2008 16:58:21 -0600 Subject: @@state_secret In-Reply-To: <7DCC7A0B-DD2B-4F3B-AE4E-07EBBE3A1890@creativepony.com> References: <20080603081145.GM70833@beekeeper.hobix.com> <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> <2FBA4ED2-167A-48E8-8AE4-89A6132C1C59@gmail.com> <7DCC7A0B-DD2B-4F3B-AE4E-07EBBE3A1890@creativepony.com> Message-ID: <292C8D75-7778-419B-A3A9-E3DCD94874AB@nbtsc.org> On Jun 4, 2008, at 4:46 PM, Bluebie, Jenna wrote: > No no, this is something we can use in helper methods, so writing > 'render :blah' for instance would render it and terminate the > thingo... instead of having to be the very last thing in the > controller method or be prefixed with return. Though I don't mind > this too much, it would open possibilities for some nifty things. > I almost expected this behavior. I've certainly wondered where my view went when I did something after rendering. Aria Stewart aredridel at nbtsc.org From blueberry at creativepony.com Wed Jun 4 19:41:16 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Thu, 5 Jun 2008 09:41:16 +1000 Subject: @@state_secret In-Reply-To: <292C8D75-7778-419B-A3A9-E3DCD94874AB@nbtsc.org> References: <20080603081145.GM70833@beekeeper.hobix.com> <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> <2FBA4ED2-167A-48E8-8AE4-89A6132C1C59@gmail.com> <7DCC7A0B-DD2B-4F3B-AE4E-07EBBE3A1890@creativepony.com> <292C8D75-7778-419B-A3A9-E3DCD94874AB@nbtsc.org> Message-ID: I've had that annoyance too. Another thing I really want to see fixed in 2.0 is when the controller returns something that isn't a string, ignore it! Don't throw exceptions about thingo not being a stringo. Writing methods called using xmlhttprequests, sometimes I don't return anything, so the last method ends up returning a number or something and breaks everything. I shouldn't have to put return ''; at the end of a controller method to make it work. On 05/06/2008, at 8:58 AM, Aria Stewart wrote: > > On Jun 4, 2008, at 4:46 PM, Bluebie, Jenna wrote: > >> No no, this is something we can use in helper methods, so writing >> 'render :blah' for instance would render it and terminate the >> thingo... instead of having to be the very last thing in the >> controller method or be prefixed with return. Though I don't mind >> this too much, it would open possibilities for some nifty things. >> > > I almost expected this behavior. I've certainly wondered where my > view went when I did something after rendering. > > Aria Stewart > aredridel at nbtsc.org > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From ironald at gmail.com Thu Jun 5 01:02:00 2008 From: ironald at gmail.com (ronald.evangelista) Date: Thu, 05 Jun 2008 13:02:00 +0800 Subject: @@state_secret In-Reply-To: <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> References: <391a49da0806040712m281f0a6ck90407169355b34b@mail.gmail.com> Message-ID: <48477348.80009@gmail.com> would be great to do something simple like that for authenticating controller methods. been using something like this to authenticate get and post in one sweep. module Controllers module AuthenticationHelper def self.included(base) base.module_eval do def get(*a) end unless method_defined? :get def post(*a) end unless method_defined? :post alias_method :__post__, :post alias_method :__get__ , :get def get(*args) on_authenticated do __get__(*args) end end def post(*args) on_authenticated do __post__(*args) end end end end private def on_authenticated unless @state.blank? or @state.user_id.nil? yield else @state.link_back=@env.REQUEST_URI redirect(Login) end end end end # included at the end class Add def get;end def post;end include AuthenticationHelper end From ironald at gmail.com Thu Jun 5 04:19:45 2008 From: ironald at gmail.com (ronald.evangelista) Date: Thu, 05 Jun 2008 16:19:45 +0800 Subject: how to add a method without coding it directly into app? Message-ID: <4847A1A1.8010503@gmail.com> i'm missing something here. how would I code this outside the application to be shared with other Camping apps? module Blog::Controllers module AuthenticationHelper def self.included(base) class << base define_method :authenticate do |*a| a.each do |meth| if method_defined?(meth.to_s) alias_method "__#{meth}__", meth class_def(meth) do |*a| @state.Back=@env.REQUEST_URI return redirect(Login) if @state.blank? or @state.user_id.nil? send("__#{meth}__", *a) end end end end end end end end any hints? thanks! From blueberry at creativepony.com Thu Jun 5 04:21:24 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Thu, 5 Jun 2008 18:21:24 +1000 Subject: how to add a method without coding it directly into app? In-Reply-To: <4847A1A1.8010503@gmail.com> References: <4847A1A1.8010503@gmail.com> Message-ID: <462A6743-C37C-42BD-8CBB-E0DF7BC5F7E8@creativepony.com> Change Blog::Controllers to Camping::Controllers and require it before Caming.goes :somewhere_else On 05/06/2008, at 6:19 PM, ronald.evangelista wrote: > i'm missing something here. > how would I code this outside the application to be shared with > other Camping apps? > > module Blog::Controllers > module AuthenticationHelper > def self.included(base) > class << base > define_method :authenticate do |*a| > a.each do |meth| > if method_defined?(meth.to_s) > alias_method "__#{meth}__", meth > class_def(meth) do |*a| > @state.Back=@env.REQUEST_URI > return redirect(Login) if > @state.blank? or @state.user_id.nil? > send("__#{meth}__", *a) > end > end > end > end > end > end > end > end > > any hints? thanks! > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From ironald at gmail.com Thu Jun 5 04:53:53 2008 From: ironald at gmail.com (ronald.evangelista) Date: Thu, 05 Jun 2008 16:53:53 +0800 Subject: how to add a method without coding it directly into app? In-Reply-To: <462A6743-C37C-42BD-8CBB-E0DF7BC5F7E8@creativepony.com> References: <462A6743-C37C-42BD-8CBB-E0DF7BC5F7E8@creativepony.com> Message-ID: <4847A9A1.7010502@gmail.com> ..an oversight. :-) modified slightly to work: class_def(meth) do |*a| controller_module = self.class.name.split(/::/) controller_module.pop controller_module << :Login # maybe this could be passed as an arg too controller_module=controller_module.join("::").constantize @state.Back=@env.REQUEST_URI return redirect(controller_module) if @state.blank? or @state.user_id.nil? send("__#{meth}__", *a) end thanks for the speedy reply! From why at whytheluckystiff.net Thu Jun 5 20:36:04 2008 From: why at whytheluckystiff.net (_why) Date: Thu, 5 Jun 2008 19:36:04 -0500 Subject: throw :halt Message-ID: <20080606003604.GS70833@beekeeper.hobix.com> Okay, I decided to go with Magnus' :halt idea. I was skeptical, but good points from the blueberry australian. Anyway, it was only like a thirteen-byte patch. Now THAT'S a camping patch! _why From blueberry at creativepony.com Thu Jun 5 21:18:22 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 11:18:22 +1000 Subject: Attention Judofyr: Broken cookies in 2.0 Message-ID: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> Hey Judofyr! Fix this! When someone sets a cookie using @cookies.something = 'data' it should be set with the path going to the camping app's root, not with no path, otherwise only that controller with the same parameters will ever see the cookie again! Please change this code: > @cookies.each do |k, v| > @response.set_cookie(k, v) if o[k] != v > end to: > @cookies.each do |k, v| > @response.set_cookie(k, :value => v, :path => self/"/") if o[k] != v > end Which should unbreak it, but cookie sessions will still remain broken so long as you keep using the longer weird set_cookie syntax in there without a path set. Please change it back to @cookie.stuff = "things". Againy, judofyr, now I find out in the trunk, still, you have a 15 minute timeout. When I said 10 minutes wasn't enough I didn't mean 'so bump it up to 15'. Please get rid of this and just use plain old untimed 'session cookies'. If you insist on having state_timeout functionality ? which I strongly feel is something a user could easily implement if they wanted it and beyond the scope of what should come with camping ? please default it to 'nil' and change the logic to not be setting those timeout cookies when it is nil. We're not Rails, we don't need to build in every bit of functionality any user could ever want. We can provide timed sessions on the wiki. Well, at least we could if there was any way to make a new page on the wiki, which seems to be currently disabled. it looks like this: > def service(*a) > @state = Camping::H[] if @cookies.timeout < (Time.now - 1.hour); > @cookies.timeout = Time.now.to_i; super(*a) > end And, one more thing: I thought the cookie thing had been fixed now, but apparently the cookie setting logic is still happening in service(*a), making the cookies hash useless inside of service wrappers. The stuff in service(*a) should be moved out to call(...), outside of the services chain. It's too weird to have to use weird rack api's to do things in a service but have to use familiar simple camping inside of the camping app and before you call 'super()'. the inner most service should just do: > @body = (catch(:halt){send(@request.request_method.downcase, *a)} || > @body).to_s Then @body should be used and @headers and @status and @cookies should be all done in call() to do all the stuff currently being done in the service. Then we can live in a happy world where services really do work as 'before' and 'after' style methods and we don't have to code to rack api's half the time to make it work in ways which really cannot be understood without reading the camping source code. As is happening now, these api's might be replaced entirely with some other thingo in the future if rack is superseded and break it all, not to mention that rack's api's are a lot less fun to code to than camping's. If someone wants to tell me how git works, I'll be happy to patch these problems myself, provided it isn't a stressful or excessively difficult thing to do... My username on there is Bluebie. I have no idea how to use it. ? Blueberry the fictional pony -------------- next part -------------- An HTML attachment was scrubbed... URL: From why at whytheluckystiff.net Thu Jun 5 21:35:11 2008 From: why at whytheluckystiff.net (_why) Date: Thu, 5 Jun 2008 20:35:11 -0500 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> Message-ID: <20080606013511.GT70833@beekeeper.hobix.com> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: > If someone wants to tell me how git works, I'll be happy to patch these > problems myself, provided it isn't a stressful or excessively difficult > thing to do... My username on there is Bluebie. I have no idea how to use > it. Basically what you need to do is fork the project, add your changes, commit, and send me a pull request. The "pull request" is just a message that you have some changes to pick up. It's like putting up the little flag on your mailbox to tell the mailman to stop by. First off, go here: http://github.com/why/camping/tree/master. And click the "fork" button. >From there, you'll need to do the rest from a console: $ git clone git at github.com:Bluebie/camping.git $ cd camping # ... make your changes ... $ git commit -a # ... saves your changes ... $ git push # ... sends your changes to github ... And then, you can just send me a pull request. Go to your camping page: http://github.com/Bluebie/camping/tree/master. Click on "pull request" and explain the change. You're going to love it. _why From blueberry at creativepony.com Thu Jun 5 21:54:07 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 11:54:07 +1000 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: <20080606013511.GT70833@beekeeper.hobix.com> References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> Message-ID: now it's in vim and I don't know what to do and it wont let me quit and wont save... On 06/06/2008, at 11:35 AM, _why wrote: > On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >> If someone wants to tell me how git works, I'll be happy to patch >> these >> problems myself, provided it isn't a stressful or excessively >> difficult >> thing to do... My username on there is Bluebie. I have no idea how >> to use >> it. > > Basically what you need to do is fork the project, add your changes, > commit, and send me a pull request. The "pull request" is just a > message that you have some changes to pick up. It's like putting up > the little flag on your mailbox to tell the mailman to stop by. > > First off, go here: http://github.com/why/camping/tree/master. > And click the "fork" button. > >> From there, you'll need to do the rest from a console: > > $ git clone git at github.com:Bluebie/camping.git > $ cd camping > # ... make your changes ... > > $ git commit -a > # ... saves your changes ... > > $ git push > # ... sends your changes to github ... > > And then, you can just send me a pull request. Go to your camping > page: http://github.com/Bluebie/camping/tree/master. Click on "pull > request" and explain the change. > > You're going to love it. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From blueberry at creativepony.com Thu Jun 5 22:07:39 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 12:07:39 +1000 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> Message-ID: <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> I did some vimtutor and put some text in the thing and then :wq to save it and then it says: > fatal: There was a problem with the editor vi. A fantastic descriptive error if ever I did see one. can someone tell me how the heck to make vim go? Or better yet how to hack git to use TextMate or Coda instead? On 06/06/2008, at 11:54 AM, Bluebie, Jenna wrote: > now it's in vim and I don't know what to do and it wont let me quit > and wont save... > On 06/06/2008, at 11:35 AM, _why wrote: > >> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >>> If someone wants to tell me how git works, I'll be happy to patch >>> these >>> problems myself, provided it isn't a stressful or excessively >>> difficult >>> thing to do... My username on there is Bluebie. I have no idea how >>> to use >>> it. >> >> Basically what you need to do is fork the project, add your changes, >> commit, and send me a pull request. The "pull request" is just a >> message that you have some changes to pick up. It's like putting up >> the little flag on your mailbox to tell the mailman to stop by. >> >> First off, go here: http://github.com/why/camping/tree/master. >> And click the "fork" button. >> >>> From there, you'll need to do the rest from a console: >> >> $ git clone git at github.com:Bluebie/camping.git >> $ cd camping >> # ... make your changes ... >> >> $ git commit -a >> # ... saves your changes ... >> >> $ git push >> # ... sends your changes to github ... >> >> And then, you can just send me a pull request. Go to your camping >> page: http://github.com/Bluebie/camping/tree/master. Click on "pull >> request" and explain the change. >> >> You're going to love it. >> >> _why >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From kprojection at gmail.com Thu Jun 5 22:11:33 2008 From: kprojection at gmail.com (Eric Mill) Date: Thu, 5 Jun 2008 22:11:33 -0400 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> Message-ID: How did you end up in vim? You don't need to use any particular editor, edit the files from the repository any way you want. You don't actually have to make all your changes from the command line. -- Eric On Thu, Jun 5, 2008 at 10:07 PM, Bluebie, Jenna wrote: > I did some vimtutor and put some text in the thing and then :wq to save it > and then it says: > >> fatal: There was a problem with the editor vi. > > > A fantastic descriptive error if ever I did see one. > > can someone tell me how the heck to make vim go? Or better yet how to hack > git to use TextMate or Coda instead? > > > On 06/06/2008, at 11:54 AM, Bluebie, Jenna wrote: > >> now it's in vim and I don't know what to do and it wont let me quit and >> wont save... >> On 06/06/2008, at 11:35 AM, _why wrote: >> >>> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >>>> >>>> If someone wants to tell me how git works, I'll be happy to patch these >>>> problems myself, provided it isn't a stressful or excessively difficult >>>> thing to do... My username on there is Bluebie. I have no idea how to >>>> use >>>> it. >>> >>> Basically what you need to do is fork the project, add your changes, >>> commit, and send me a pull request. The "pull request" is just a >>> message that you have some changes to pick up. It's like putting up >>> the little flag on your mailbox to tell the mailman to stop by. >>> >>> First off, go here: http://github.com/why/camping/tree/master. >>> And click the "fork" button. >>> >>>> From there, you'll need to do the rest from a console: >>> >>> $ git clone git at github.com:Bluebie/camping.git >>> $ cd camping >>> # ... make your changes ... >>> >>> $ git commit -a >>> # ... saves your changes ... >>> >>> $ git push >>> # ... sends your changes to github ... >>> >>> And then, you can just send me a pull request. Go to your camping >>> page: http://github.com/Bluebie/camping/tree/master. Click on "pull >>> request" and explain the change. >>> >>> You're going to love it. >>> >>> _why >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From blueberry at creativepony.com Thu Jun 5 22:11:41 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 12:11:41 +1000 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> Message-ID: Ooh I figured it out! On 06/06/2008, at 12:07 PM, Bluebie, Jenna wrote: > I did some vimtutor and put some text in the thing and then :wq to > save it and then it says: > >> fatal: There was a problem with the editor vi. > > > A fantastic descriptive error if ever I did see one. > > can someone tell me how the heck to make vim go? Or better yet how > to hack git to use TextMate or Coda instead? > > > On 06/06/2008, at 11:54 AM, Bluebie, Jenna wrote: > >> now it's in vim and I don't know what to do and it wont let me quit >> and wont save... >> On 06/06/2008, at 11:35 AM, _why wrote: >> >>> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >>>> If someone wants to tell me how git works, I'll be happy to patch >>>> these >>>> problems myself, provided it isn't a stressful or excessively >>>> difficult >>>> thing to do... My username on there is Bluebie. I have no idea >>>> how to use >>>> it. >>> >>> Basically what you need to do is fork the project, add your changes, >>> commit, and send me a pull request. The "pull request" is just a >>> message that you have some changes to pick up. It's like putting up >>> the little flag on your mailbox to tell the mailman to stop by. >>> >>> First off, go here: http://github.com/why/camping/tree/master. >>> And click the "fork" button. >>> >>>> From there, you'll need to do the rest from a console: >>> >>> $ git clone git at github.com:Bluebie/camping.git >>> $ cd camping >>> # ... make your changes ... >>> >>> $ git commit -a >>> # ... saves your changes ... >>> >>> $ git push >>> # ... sends your changes to github ... >>> >>> And then, you can just send me a pull request. Go to your camping >>> page: http://github.com/Bluebie/camping/tree/master. Click on "pull >>> request" and explain the change. >>> >>> You're going to love it. >>> >>> _why >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From blueberry at creativepony.com Thu Jun 5 22:12:54 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 12:12:54 +1000 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> Message-ID: <2341CB0E-D9B0-44D4-A15B-920A376DFD65@creativepony.com> git forced me in to vim when I did git commit -a. Turns out that's what it defaults to when EDITOR enviroment variable isn't set. Now it is, all is well. On 06/06/2008, at 12:11 PM, Eric Mill wrote: > How did you end up in vim? You don't need to use any particular > editor, edit the files from the repository any way you want. You > don't actually have to make all your changes from the command line. > > -- Eric > > On Thu, Jun 5, 2008 at 10:07 PM, Bluebie, Jenna > wrote: >> I did some vimtutor and put some text in the thing and then :wq to >> save it >> and then it says: >> >>> fatal: There was a problem with the editor vi. >> >> >> A fantastic descriptive error if ever I did see one. >> >> can someone tell me how the heck to make vim go? Or better yet how >> to hack >> git to use TextMate or Coda instead? >> >> >> On 06/06/2008, at 11:54 AM, Bluebie, Jenna wrote: >> >>> now it's in vim and I don't know what to do and it wont let me >>> quit and >>> wont save... >>> On 06/06/2008, at 11:35 AM, _why wrote: >>> >>>> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >>>>> >>>>> If someone wants to tell me how git works, I'll be happy to >>>>> patch these >>>>> problems myself, provided it isn't a stressful or excessively >>>>> difficult >>>>> thing to do... My username on there is Bluebie. I have no idea >>>>> how to >>>>> use >>>>> it. >>>> >>>> Basically what you need to do is fork the project, add your >>>> changes, >>>> commit, and send me a pull request. The "pull request" is just a >>>> message that you have some changes to pick up. It's like putting >>>> up >>>> the little flag on your mailbox to tell the mailman to stop by. >>>> >>>> First off, go here: http://github.com/why/camping/tree/master. >>>> And click the "fork" button. >>>> >>>>> From there, you'll need to do the rest from a console: >>>> >>>> $ git clone git at github.com:Bluebie/camping.git >>>> $ cd camping >>>> # ... make your changes ... >>>> >>>> $ git commit -a >>>> # ... saves your changes ... >>>> >>>> $ git push >>>> # ... sends your changes to github ... >>>> >>>> And then, you can just send me a pull request. Go to your camping >>>> page: http://github.com/Bluebie/camping/tree/master. Click on >>>> "pull >>>> request" and explain the change. >>>> >>>> You're going to love it. >>>> >>>> _why >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From anibalrojas at gmail.com Thu Jun 5 22:14:48 2008 From: anibalrojas at gmail.com (=?ISO-8859-1?Q?An=EDbal_Rojas?=) Date: Fri, 6 Jun 2008 21:44:48 +1930 Subject: Attention Judofyr: Broken cookies in 2.0 In-Reply-To: <2341CB0E-D9B0-44D4-A15B-920A376DFD65@creativepony.com> References: <82A50135-8063-476A-8CC6-E7267403BD2C@creativepony.com> <20080606013511.GT70833@beekeeper.hobix.com> <35E5941D-84A2-4257-A0B3-93767F12F5D4@creativepony.com> <2341CB0E-D9B0-44D4-A15B-920A376DFD65@creativepony.com> Message-ID: Use the -m switch -- An?bal On Fri, Jun 6, 2008 at 9:42 PM, Bluebie, Jenna wrote: > git forced me in to vim when I did git commit -a. Turns out that's what it > defaults to when EDITOR enviroment variable isn't set. Now it is, all is > well. > > > On 06/06/2008, at 12:11 PM, Eric Mill wrote: > >> How did you end up in vim? You don't need to use any particular >> editor, edit the files from the repository any way you want. You >> don't actually have to make all your changes from the command line. >> >> -- Eric >> >> On Thu, Jun 5, 2008 at 10:07 PM, Bluebie, Jenna >> wrote: >>> >>> I did some vimtutor and put some text in the thing and then :wq to save >>> it >>> and then it says: >>> >>>> fatal: There was a problem with the editor vi. >>> >>> >>> A fantastic descriptive error if ever I did see one. >>> >>> can someone tell me how the heck to make vim go? Or better yet how to >>> hack >>> git to use TextMate or Coda instead? >>> >>> >>> On 06/06/2008, at 11:54 AM, Bluebie, Jenna wrote: >>> >>>> now it's in vim and I don't know what to do and it wont let me quit and >>>> wont save... >>>> On 06/06/2008, at 11:35 AM, _why wrote: >>>> >>>>> On Fri, Jun 06, 2008 at 11:18:22AM +1000, Bluebie, Jenna wrote: >>>>>> >>>>>> If someone wants to tell me how git works, I'll be happy to patch >>>>>> these >>>>>> problems myself, provided it isn't a stressful or excessively >>>>>> difficult >>>>>> thing to do... My username on there is Bluebie. I have no idea how to >>>>>> use >>>>>> it. >>>>> >>>>> Basically what you need to do is fork the project, add your changes, >>>>> commit, and send me a pull request. The "pull request" is just a >>>>> message that you have some changes to pick up. It's like putting up >>>>> the little flag on your mailbox to tell the mailman to stop by. >>>>> >>>>> First off, go here: http://github.com/why/camping/tree/master. >>>>> And click the "fork" button. >>>>> >>>>>> From there, you'll need to do the rest from a console: >>>>> >>>>> $ git clone git at github.com:Bluebie/camping.git >>>>> $ cd camping >>>>> # ... make your changes ... >>>>> >>>>> $ git commit -a >>>>> # ... saves your changes ... >>>>> >>>>> $ git push >>>>> # ... sends your changes to github ... >>>>> >>>>> And then, you can just send me a pull request. Go to your camping >>>>> page: http://github.com/Bluebie/camping/tree/master. Click on "pull >>>>> request" and explain the change. >>>>> >>>>> You're going to love it. >>>>> >>>>> _why >>>>> _______________________________________________ >>>>> Camping-list mailing list >>>>> Camping-list at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/camping-list >>>> >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From blueberry at creativepony.com Fri Jun 6 00:53:28 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Fri, 6 Jun 2008 14:53:28 +1000 Subject: Quickie: URL Shortener's, some code. Message-ID: <908BBB6B-BC1B-4946-8AF9-C0B8E739D40D@creativepony.com> The wiki won't let me make new pages anymore, so I put it on my own site. http://creativepony.com/journal/scripts/url-shorteners/ I hope it helps someone! ? Jenna From judofyr at gmail.com Fri Jun 6 09:07:50 2008 From: judofyr at gmail.com (Magnus Holm) Date: Fri, 6 Jun 2008 15:07:50 +0200 Subject: Messy Cookies Message-ID: <391a49da0806060607jea4701dt39a1ae732656e56f@mail.gmail.com> It looks like everyone has tried to fix the cookies lately, and no-one managed to get it 100% correctly. The current implementation doesn't set the path correctly, and you can't use @cookies in a #service-overload. Qwzybug's patch fixed only the sessions. Jenna's patch won't allow to set complex cookies (@cookies.key = {:path => "/path", :value => "value", :expires => Time.now + 900}) and won't work properly when you use #method_missing (which allows you to do Blog.get(:Controller)). So I took Bluebie's code and rewrote it a bit. I moved some logic (which currently is in #service) from #call to Base#to_a. So even if you're not using Rack, you need to call #to_a in order to clean things up. The code is available in the proper_cookie-branch: http://github.com/judofyr/camping/commits/proper_cookies I've tested it with Firefox + LiveHTTPHeaders and it seems to work fine. If anyone spots a bug, please comment on a commit (or scream out on IRC)! Oh, and _why has to decide if we should make the session-system completely XSS-proof, or be a little more relaxed. It doesn't have to be XSS-proof as long as you keep the cookies secret (aka, escapes all Javascript). -- Magnus Holm From devin.chalmers at gmail.com Fri Jun 6 16:06:35 2008 From: devin.chalmers at gmail.com (Devin Chalmers) Date: Fri, 6 Jun 2008 13:06:35 -0700 Subject: Messy Cookies In-Reply-To: <391a49da0806060607jea4701dt39a1ae732656e56f@mail.gmail.com> References: <391a49da0806060607jea4701dt39a1ae732656e56f@mail.gmail.com> Message-ID: On Fri, Jun 6, 2008 at 6:07 AM, Magnus Holm wrote: > It looks like everyone has tried to fix the cookies lately, and no-one > managed > to get it 100% correctly... > Thanks for the code, that seems to work really well and prettily. I admit that, though I love writing apps in it, I am very new to hacking on the dark underbelly of Camping. (Me, I just wanted to get sessions to work in the Junebug wiki for a Ruby class I'm teaching some friends.) Your new patch makes sense to me. I'd be interested to hear a discussion of why the Bluebie version didn't work, because I thought that made sense too. :) I do like Jenna's streamlining of the session handling stuff: http://github.com/Bluebie/camping/commit/8ef1e532453fd378b003f967c034c78f64dbc802 I tend to agree that for most Camping apps it's probably okay to keep the cookie session around for the whole browser session, and that trying to prevent session hijacking with IP addresses/UA strings is going to be annoying for a fair amount of people. On the other hand, removing the timeout and remote address stuff does make it stupidly easy to steal a session, since all the session data is sent in essentially cleartext with every request. (This is of course only very slightly worse than, say, a username/password being sent in cleartext once during a login.) Tricky tricky! Myself, I'd prefer to keep Camping sessions super-simple, and just make sure that the limitations are documented and the necessity of something like OpenID or SSL is emphasized if you need really real security. Like this: http://rubyforge.org/pipermail/camping-list/2008-May/000712.html and also this: http://rubyforge.org/pipermail/camping-list/2008-May/000722.html devin ('qwzybug') -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueberry at creativepony.com Fri Jun 6 19:52:52 2008 From: blueberry at creativepony.com (Bluebie, Jenna) Date: Sat, 7 Jun 2008 09:52:52 +1000 Subject: Messy Cookies In-Reply-To: References: <391a49da0806060607jea4701dt39a1ae732656e56f@mail.gmail.com> Message-ID: Judofyr: This isn't a question to ask _why. It simply cannot be done. Stealing cookies is not the same thing as XSS, and locking cookies to an IP address will not stop XSS at all. Locking cookies to an IP address (as I wrote in my git commit where I removed it) will lock out AOL users, and surely many others on large NAT based networks. We aren't just talking getting logged out occasionally. Every single request from an AOL user comes from a seemingly random IP address, often from a different continent to where the user is. This is because AOL user's don't have their own internet IP address. The network is a giant nat, but it's a nat with several outgoing IP's, and every time a connection is made, it's sent through a different IP. In a world where IPv6 still hasn't gained serious traction and the IPv4 address space continues to shrink, this practice is only becoming more and more common. In some countries, they only have 2-5 IP's to NAT the whole country through. To understand why we can't fix XSS in the cookies handler you have to understand what XSS is. Imagine a bank, who has a camping app for internet banking. Imagine they have a /login controller, and a / transfer_monies controller. XSS is when a bad person creates a webpage with a tag in it capable of loading remote resources, like , and sets the src attribute to http://mybank.com/transfer_monies?to=888422243&name=Hahahahaha Then they direct the user to this page, which could be on myspace or anywhere else html embedding is allowed, while the target is logged in to their banking website. When their browser reaches the page, and parses the , it throws that get request on to the queue, and when it gets around to it, it goes right ahead and loads that address with a get request with all the users cookies in tact. This can't be worked around by requiring important things to be done with the 'post' method either as it is incredibly easy to make an invisible form that automatically submits as soon as it is parsed. The one attack binding cookies to the user's IP address prevents (in countries and ISP's where each user has their own IP address, and their ISP's don't allow other user's to request a specific IP from the DHCP server's and get it if it is available now) is someone who inserts a