{"id":253,"date":"2009-03-14T11:31:33","date_gmt":"2009-03-14T19:31:33","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=253"},"modified":"2009-03-14T11:31:33","modified_gmt":"2009-03-14T19:31:33","slug":"mwrc-rack-middleware-by-jon-crosby","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/mwrc-rack-middleware-by-jon-crosby\/","title":{"rendered":"mwrc: Rack Middleware by Jon Crosby"},"content":{"rendered":"<p>Rack Middleware<br \/>\nby Jon Crosby, an employee of Engine Yard<\/p>\n<p>He started by showing an example of monolithic Perl CGI, and moved quicky to Rails. Then he moved to talking about authentication and Rack. I was a bit lost as to what Rack does, or why I would care &#8212; probably because I&#8217;m not a middleware developer.<\/p>\n<p>Authentication: OpenID + Oauth<br \/>\nRack is the Web. The Web is Rack<br \/>\nRack is based on WSGI. It&#8217;s a webserver interface. http:\/\/rack.rubyforge.org\/<br \/>\n&#8220;Rack provides an minimal interface between webservers supporting Ruby and Ruby frameworks.&#8221;<\/p>\n<p>He showed some examples of rack.<\/p>\n<p>&#8211; Rack::Pool:Session<br \/>\n&#8211; Rack::Profiler<br \/>\n&#8211; Rack::MailExceptions<br \/>\n&#8211; Rack:CSSHTTPRequest<br \/>\n&#8211; Rack::Cache &#8211; highly recommended<\/p>\n<p>Cooperative Middleware<br \/>\nTake a look at URI spaces<br \/>\nCloudKit &#8211; and Open Web JSON client http:\/\/getcloudkit.com\/<br \/>\n&#8211; expose :notes, :todos<br \/>\nHas an OAuth plugin &#8220;filter&#8221;<\/p>\n<p>&#8220;Via&#8221; HTTP headers. Used by Rack middleware<\/p>\n<p>    env[&#8216;cloudkit.auth&#8217;] = 1<br \/>\n    env[&#8216;cloudkit.via&#8217;] << 'cloudkit.filter...'\n\nAlternative stacks\n\n- Rack::Map could let you create two apps for your same blog - a public and a private one.\n- Rack::Map + Sinatra 0.9.1\n\nQuestion: How do you detect colissions in the URI namespace?\n\nAnswer: There's no facility in Rack to do that. It's a good time to work on it before Rack hits version 1.0.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rack Middleware by Jon Crosby, an employee of Engine Yard He started by showing an example of monolithic Perl CGI, and moved quicky to Rails. Then he moved to talking about authentication and Rack. I was a bit lost as to what Rack does, or why I would care &#8212; probably because I&#8217;m not a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/mwrc-rack-middleware-by-jon-crosby\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mwrc: Rack Middleware by Jon Crosby&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[20,21],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-programming","tag-mtnwestrubyconf","tag-mwrc"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":2,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":255,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/253\/revisions\/255"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}