{"action":"created","comment":{"url":"https://api.github.com/repos/owin/owin/pulls/comments/39734740","id":39734740,"diff_hunk":"@@ -0,0 +1,309 @@\n+# OWIN Middlewares\n+\n+**Version**\n+1.0.0-draft.1\n+\n+**Authors**\n+Sebastien Lambla (Caffeine IT)\n+\n+**License**\n+[Creative Commons Attribution 3.0 Unported License][CCLicense]\n+\n+**Last updated**\n+1 October 2015\n+\n+## Abstract\n+\n+The [OWIN Specification][owin-spec] defines a standard interface between .NET web servers\n+and web applications. This document specifies additional standard interfaces\n+for reusable OWIN Middleware components.\n+\n+## Status\n+\n+This is a working draft.\n+\n+This document is a submission to the OWIN Working Group and is valid for a\n+period of six months and may be updated, replaced, or obsoleted by other\n+documents at any time. It is inappropriate to use working drafts as reference\n+material or to cite them other than as \"work in progress\"\n+\n+This working draft will expire on 1 March 2016.\n+\n+## Copyright\n+\n+Copyright (c) 2014 the persons identified as the document authors. The work\n+is licensed as per the\n+[Creative Commons Attribution 3.0 Unported License][CCLicense] in effect on the\n+date of publication of this document.\n+\n+## Table of Content\n+\n+1. [Introduction](#1-introduction)  \n+  1.1. [Requirements Notation](#11-requirements-notation)\n+2. [Definitions](#2-definitions)\n+3. [Middleware](#3-middleware)  \n+  3.1. [Examples](#31-examples)  \n+  3.2. [Middleware Operation](#32-middleware-operation)  \n+  3.3. [Signature](#33-signature)  \n+  3.4. [Code Sample](#34-code-sample)\n+4. [Middleware Registration](#4-middleware-registration)  \n+  4.1. [Signature](#41-signature)  \n+    4.1.1. [Registration Sample](#411-registration-sample)  \n+  4.2. [Discovery and Registration of Middleware](#42-discovery-and-registration-of-middleware)  \n+    4.2.1. [Extension Method Sample](#421-extension-method-sample)  \n+5. [Versioning](#5-versioning)\n+6. [Acknowledgements](#6-acknowledgements)\n+\n+## 1. Introduction\n+\n+The [OWIN] specification was created to decouple web servers and web\n+applications on .NET platforms by creating a standardised abstract signature\n+that can be implemented by Applications and Servers in a vendor-neutral fashion.\n+\n+[Layering][FieldingLayering] components conforming to a uniform interface\n+is a natural architectural style for HTTP-based application, and many\n+application frameworks provide such abstractions in the form of reusable\n+software components.\n+\n+This specification provides a standardised signature for such components in the\n+OWIN ecosystem, hereby referred to as **Middleware**.\n+\n+OWIN Middleware is defined in terms of a delegate structure building upon the\n+OWIN: Open Web Server Interface for .NET [Owin 1.0], with no\n+dependency on external libraries.\n+\n+### 1.1. Requirements Notation\n+\n+ The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\",\n+\"SHOULD NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this document are to be\n+interpreted as described in [RFC 2119][rfc2119].\n+\n+A component is deemed to be compliant with this specification if all absolute\n+requirements and prohibitions are conformed to.\n+\n+Components and terms defined in this and other specifications are always\n+capitalized, so as to clarify between a general term and the term as used in a\n+specification.\n+\n+## 2. Definitions\n+\n+This document refers to the following terms:\n+\n+ - **Application**: a process or operation inspecting, modifying or otherwise\n+   accessing HTTP messages, as an AppFunc signature.\n+\n+ - **Middleware**: Pass through components, capable of mediating request and\n+   response messages, in a pipeline model which, when\n+   composed, forms an Application.\n+\n+ - **Builder**: The extension point lambda used by developers to add Middleware\n+   components to a pipeline.","path":"spec/middleware-1.0.0-draft.1.md","position":100,"original_position":100,"commit_id":"a003c28844cda8527c16ed516f28aa7511929c55","original_commit_id":"a003c28844cda8527c16ed516f28aa7511929c55","user":{"login":"serialseb","id":212039,"avatar_url":"https://avatars.githubusercontent.com/u/212039?v=3","gravatar_id":"","url":"https://api.github.com/users/serialseb","html_url":"https://github.com/serialseb","followers_url":"https://api.github.com/users/serialseb/followers","following_url":"https://api.github.com/users/serialseb/following{/other_user}","gists_url":"https://api.github.com/users/serialseb/gists{/gist_id}","starred_url":"https://api.github.com/users/serialseb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serialseb/subscriptions","organizations_url":"https://api.github.com/users/serialseb/orgs","repos_url":"https://api.github.com/users/serialseb/repos","events_url":"https://api.github.com/users/serialseb/events{/privacy}","received_events_url":"https://api.github.com/users/serialseb/received_events","type":"User","site_admin":false},"body":"I used Middleware and Middleware components as synonyms here, chosing Middleware most of the time, unless it just sounds a bit wrong. \"may add Middleware\" just sounds a bit wrong, even if it's accurate. I'm not fussed either way. What do people think? ","created_at":"2015-09-17T11:19:10Z","updated_at":"2015-09-17T11:19:10Z","html_url":"https://github.com/owin/owin/pull/41#discussion_r39734740","pull_request_url":"https://api.github.com/repos/owin/owin/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/owin/owin/pulls/comments/39734740"},"html":{"href":"https://github.com/owin/owin/pull/41#discussion_r39734740"},"pull_request":{"href":"https://api.github.com/repos/owin/owin/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/owin/owin/pulls/41","id":43858119,"html_url":"https://github.com/owin/owin/pull/41","diff_url":"https://github.com/owin/owin/pull/41.diff","patch_url":"https://github.com/owin/owin/pull/41.patch","issue_url":"https://api.github.com/repos/owin/owin/issues/41","number":41,"state":"open","locked":false,"title":"Middleware spec","user":{"login":"serialseb","id":212039,"avatar_url":"https://avatars.githubusercontent.com/u/212039?v=3","gravatar_id":"","url":"https://api.github.com/users/serialseb","html_url":"https://github.com/serialseb","followers_url":"https://api.github.com/users/serialseb/followers","following_url":"https://api.github.com/users/serialseb/following{/other_user}","gists_url":"https://api.github.com/users/serialseb/gists{/gist_id}","starred_url":"https://api.github.com/users/serialseb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serialseb/subscriptions","organizations_url":"https://api.github.com/users/serialseb/orgs","repos_url":"https://api.github.com/users/serialseb/repos","events_url":"https://api.github.com/users/serialseb/events{/privacy}","received_events_url":"https://api.github.com/users/serialseb/received_events","type":"User","site_admin":false},"body":"Please review","created_at":"2015-09-01T10:07:14Z","updated_at":"2015-09-17T11:19:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b7b55c5e2ed2c0d13fd435e844ec387b1589619","assignee":null,"milestone":{"url":"https://api.github.com/repos/owin/owin/milestones/1","html_url":"https://github.com/owin/owin/milestones/1.1%20Specify%20Middleware","labels_url":"https://api.github.com/repos/owin/owin/milestones/1/labels","id":669285,"number":1,"title":"1.1 Specify Middleware","description":"Add a middleware specification or amend the current OWIN specification to describe the `MidFunc` signature and use.","creator":{"login":"panesofglass","id":8803,"avatar_url":"https://avatars.githubusercontent.com/u/8803?v=3","gravatar_id":"","url":"https://api.github.com/users/panesofglass","html_url":"https://github.com/panesofglass","followers_url":"https://api.github.com/users/panesofglass/followers","following_url":"https://api.github.com/users/panesofglass/following{/other_user}","gists_url":"https://api.github.com/users/panesofglass/gists{/gist_id}","starred_url":"https://api.github.com/users/panesofglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panesofglass/subscriptions","organizations_url":"https://api.github.com/users/panesofglass/orgs","repos_url":"https://api.github.com/users/panesofglass/repos","events_url":"https://api.github.com/users/panesofglass/events{/privacy}","received_events_url":"https://api.github.com/users/panesofglass/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2014-05-24T15:12:11Z","updated_at":"2015-09-01T15:09:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/owin/owin/pulls/41/commits","review_comments_url":"https://api.github.com/repos/owin/owin/pulls/41/comments","review_comment_url":"https://api.github.com/repos/owin/owin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owin/owin/issues/41/comments","statuses_url":"https://api.github.com/repos/owin/owin/statuses/a003c28844cda8527c16ed516f28aa7511929c55","head":{"label":"openrasta:middleware","ref":"middleware","sha":"a003c28844cda8527c16ed516f28aa7511929c55","user":{"login":"openrasta","id":273613,"avatar_url":"https://avatars.githubusercontent.com/u/273613?v=3","gravatar_id":"","url":"https://api.github.com/users/openrasta","html_url":"https://github.com/openrasta","followers_url":"https://api.github.com/users/openrasta/followers","following_url":"https://api.github.com/users/openrasta/following{/other_user}","gists_url":"https://api.github.com/users/openrasta/gists{/gist_id}","starred_url":"https://api.github.com/users/openrasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openrasta/subscriptions","organizations_url":"https://api.github.com/users/openrasta/orgs","repos_url":"https://api.github.com/users/openrasta/repos","events_url":"https://api.github.com/users/openrasta/events{/privacy}","received_events_url":"https://api.github.com/users/openrasta/received_events","type":"Organization","site_admin":false},"repo":{"id":24813159,"name":"owin.spec","full_name":"openrasta/owin.spec","owner":{"login":"openrasta","id":273613,"avatar_url":"https://avatars.githubusercontent.com/u/273613?v=3","gravatar_id":"","url":"https://api.github.com/users/openrasta","html_url":"https://github.com/openrasta","followers_url":"https://api.github.com/users/openrasta/followers","following_url":"https://api.github.com/users/openrasta/following{/other_user}","gists_url":"https://api.github.com/users/openrasta/gists{/gist_id}","starred_url":"https://api.github.com/users/openrasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openrasta/subscriptions","organizations_url":"https://api.github.com/users/openrasta/orgs","repos_url":"https://api.github.com/users/openrasta/repos","events_url":"https://api.github.com/users/openrasta/events{/privacy}","received_events_url":"https://api.github.com/users/openrasta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openrasta/owin.spec","description":"OWIN GitHub site","fork":true,"url":"https://api.github.com/repos/openrasta/owin.spec","forks_url":"https://api.github.com/repos/openrasta/owin.spec/forks","keys_url":"https://api.github.com/repos/openrasta/owin.spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openrasta/owin.spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openrasta/owin.spec/teams","hooks_url":"https://api.github.com/repos/openrasta/owin.spec/hooks","issue_events_url":"https://api.github.com/repos/openrasta/owin.spec/issues/events{/number}","events_url":"https://api.github.com/repos/openrasta/owin.spec/events","assignees_url":"https://api.github.com/repos/openrasta/owin.spec/assignees{/user}","branches_url":"https://api.github.com/repos/openrasta/owin.spec/branches{/branch}","tags_url":"https://api.github.com/repos/openrasta/owin.spec/tags","blobs_url":"https://api.github.com/repos/openrasta/owin.spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openrasta/owin.spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openrasta/owin.spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/openrasta/owin.spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openrasta/owin.spec/statuses/{sha}","languages_url":"https://api.github.com/repos/openrasta/owin.spec/languages","stargazers_url":"https://api.github.com/repos/openrasta/owin.spec/stargazers","contributors_url":"https://api.github.com/repos/openrasta/owin.spec/contributors","subscribers_url":"https://api.github.com/repos/openrasta/owin.spec/subscribers","subscription_url":"https://api.github.com/repos/openrasta/owin.spec/subscription","commits_url":"https://api.github.com/repos/openrasta/owin.spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/openrasta/owin.spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/openrasta/owin.spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/openrasta/owin.spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/openrasta/owin.spec/contents/{+path}","compare_url":"https://api.github.com/repos/openrasta/owin.spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openrasta/owin.spec/merges","archive_url":"https://api.github.com/repos/openrasta/owin.spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openrasta/owin.spec/downloads","issues_url":"https://api.github.com/repos/openrasta/owin.spec/issues{/number}","pulls_url":"https://api.github.com/repos/openrasta/owin.spec/pulls{/number}","milestones_url":"https://api.github.com/repos/openrasta/owin.spec/milestones{/number}","notifications_url":"https://api.github.com/repos/openrasta/owin.spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openrasta/owin.spec/labels{/name}","releases_url":"https://api.github.com/repos/openrasta/owin.spec/releases{/id}","created_at":"2014-10-05T10:16:55Z","updated_at":"2015-04-11T23:59:54Z","pushed_at":"2015-09-01T10:43:14Z","git_url":"git://github.com/openrasta/owin.spec.git","ssh_url":"git@github.com:openrasta/owin.spec.git","clone_url":"https://github.com/openrasta/owin.spec.git","svn_url":"https://github.com/openrasta/owin.spec","homepage":"owin.org","size":559,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"owin:master","ref":"master","sha":"21851966ab304187ad6700850daf0294a4ec7a4e","user":{"login":"owin","id":512438,"avatar_url":"https://avatars.githubusercontent.com/u/512438?v=3","gravatar_id":"","url":"https://api.github.com/users/owin","html_url":"https://github.com/owin","followers_url":"https://api.github.com/users/owin/followers","following_url":"https://api.github.com/users/owin/following{/other_user}","gists_url":"https://api.github.com/users/owin/gists{/gist_id}","starred_url":"https://api.github.com/users/owin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owin/subscriptions","organizations_url":"https://api.github.com/users/owin/orgs","repos_url":"https://api.github.com/users/owin/repos","events_url":"https://api.github.com/users/owin/events{/privacy}","received_events_url":"https://api.github.com/users/owin/received_events","type":"Organization","site_admin":false},"repo":{"id":1154500,"name":"owin","full_name":"owin/owin","owner":{"login":"owin","id":512438,"avatar_url":"https://avatars.githubusercontent.com/u/512438?v=3","gravatar_id":"","url":"https://api.github.com/users/owin","html_url":"https://github.com/owin","followers_url":"https://api.github.com/users/owin/followers","following_url":"https://api.github.com/users/owin/following{/other_user}","gists_url":"https://api.github.com/users/owin/gists{/gist_id}","starred_url":"https://api.github.com/users/owin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owin/subscriptions","organizations_url":"https://api.github.com/users/owin/orgs","repos_url":"https://api.github.com/users/owin/repos","events_url":"https://api.github.com/users/owin/events{/privacy}","received_events_url":"https://api.github.com/users/owin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owin/owin","description":"OWIN GitHub site","fork":false,"url":"https://api.github.com/repos/owin/owin","forks_url":"https://api.github.com/repos/owin/owin/forks","keys_url":"https://api.github.com/repos/owin/owin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owin/owin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owin/owin/teams","hooks_url":"https://api.github.com/repos/owin/owin/hooks","issue_events_url":"https://api.github.com/repos/owin/owin/issues/events{/number}","events_url":"https://api.github.com/repos/owin/owin/events","assignees_url":"https://api.github.com/repos/owin/owin/assignees{/user}","branches_url":"https://api.github.com/repos/owin/owin/branches{/branch}","tags_url":"https://api.github.com/repos/owin/owin/tags","blobs_url":"https://api.github.com/repos/owin/owin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owin/owin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owin/owin/git/refs{/sha}","trees_url":"https://api.github.com/repos/owin/owin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owin/owin/statuses/{sha}","languages_url":"https://api.github.com/repos/owin/owin/languages","stargazers_url":"https://api.github.com/repos/owin/owin/stargazers","contributors_url":"https://api.github.com/repos/owin/owin/contributors","subscribers_url":"https://api.github.com/repos/owin/owin/subscribers","subscription_url":"https://api.github.com/repos/owin/owin/subscription","commits_url":"https://api.github.com/repos/owin/owin/commits{/sha}","git_commits_url":"https://api.github.com/repos/owin/owin/git/commits{/sha}","comments_url":"https://api.github.com/repos/owin/owin/comments{/number}","issue_comment_url":"https://api.github.com/repos/owin/owin/issues/comments{/number}","contents_url":"https://api.github.com/repos/owin/owin/contents/{+path}","compare_url":"https://api.github.com/repos/owin/owin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owin/owin/merges","archive_url":"https://api.github.com/repos/owin/owin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owin/owin/downloads","issues_url":"https://api.github.com/repos/owin/owin/issues{/number}","pulls_url":"https://api.github.com/repos/owin/owin/pulls{/number}","milestones_url":"https://api.github.com/repos/owin/owin/milestones{/number}","notifications_url":"https://api.github.com/repos/owin/owin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owin/owin/labels{/name}","releases_url":"https://api.github.com/repos/owin/owin/releases{/id}","created_at":"2010-12-09T21:41:27Z","updated_at":"2015-09-14T17:25:04Z","pushed_at":"2015-09-01T10:43:14Z","git_url":"git://github.com/owin/owin.git","ssh_url":"git@github.com:owin/owin.git","clone_url":"https://github.com/owin/owin.git","svn_url":"https://github.com/owin/owin","homepage":"owin.org","size":989,"stargazers_count":80,"watchers_count":80,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":14,"forks":29,"open_issues":14,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owin/owin/pulls/41"},"html":{"href":"https://github.com/owin/owin/pull/41"},"issue":{"href":"https://api.github.com/repos/owin/owin/issues/41"},"comments":{"href":"https://api.github.com/repos/owin/owin/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/owin/owin/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/owin/owin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owin/owin/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/owin/owin/statuses/a003c28844cda8527c16ed516f28aa7511929c55"}}}}