Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore owin.dll to support ASP.NET Katana on netstandard #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OWIN IAppBuilder interface
Copyright 2012 Louis DeJardin
Copyright 2012 Chris Ross
20 changes: 20 additions & 0 deletions Owin.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owin", "src\Owin\Owin.csproj", "{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# What is it?
OWIN defines a standard interface between .NET web servers and web applications. The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools.

## Read the specification
### Read the specification
[owin.org](http://owin.org/)

## Note on owin NuGet Package

The OWIN community [voted to sunset the `owin.dll`](https://groups.google.com/forum/#!topic/net-http-abstractions/YDbMZqGFVHA) as it contains only the `IAppBuilder` interface which is not specified in any form in the current OWIN specification. We recommend you not use the [owin NuGet package](https://www.nuget.org/packages/owin) for any new OWIN related libraries. If you currently use a project that relies on the owin package, you do not need to do anything. The package will remain available in its current state for the foreseeable future.

7 changes: 7 additions & 0 deletions src/Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="Exists('Common.snk')">
<AssemblyOriginatorKeyFile>..\..\Common.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
</Project>
18 changes: 18 additions & 0 deletions src/Owin/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to Monkey Square, Inc. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work or additional information regarding copyright
// ownership. Monkey Square, Inc. licenses this file to you
// under the Apache License, Version 2.0 (the "License"); you
// may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Owin", Justification = "Project name")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Owin", Scope = "namespace", Target = "Owin", Justification = "Project name")]
102 changes: 102 additions & 0 deletions src/Owin/IAppBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Licensed to Monkey Square, Inc. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work or additional information regarding copyright
// ownership. Monkey Square, Inc. licenses this file to you
// under the Apache License, Version 2.0 (the "License"); you
// may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Owin
{
/// <summary>
/// This interface may be passed to web site's Startup code. It enables the
/// site author to add middleware to an OWIN pipeline, typically ending with
/// the OWIN adapter for the web framework their site is built on.
/// </summary>
public interface IAppBuilder
{
/// <summary>
/// Contains arbitrary properties which may be added, examined, and modified by
/// components during the startup sequence.
/// </summary>
IDictionary<string, object> Properties { get; }

/// <summary>
/// Adds a middleware node to the OWIN function pipeline. The middleware are
/// invoked in the order they are added: the first middleware passed to Use will
/// be the outermost function, and the last middleware passed to Use will be the
/// innermost.
/// </summary>
/// <param name="middleware">
/// The middleware parameter determines which behavior is being chained into the
/// pipeline.
///
/// If the middleware given to Use is a Delegate, then it will be invoked with the "next app" in
/// the chain as the first parameter. If the delegate takes more than the single argument,
/// then the additional values must be provided to Use in the args array.
///
/// If the middleware given to Use is a Type, then the public constructor will be
/// invoked with the "next app" in the chain as the first parameter. The resulting object
/// must have a public Invoke method. If the object has constructors which take more than
/// the single "next app" argument, then additional values may be provided in the args array.
/// </param>
/// <param name="args">
/// Any additional args passed to Use will be passed as additional values, following the "next app"
/// parameter, when the OWIN call pipeline is build.
///
/// They are passed as additional parameters if the middleware parameter is a Delegate, or as additional
/// constructor arguments if the middle parameter is a Type.
/// </param>
/// <returns>
/// The IAppBuilder itself is returned. This enables you to chain your use statements together.
/// </returns>
IAppBuilder Use(object middleware, params object[] args);

/// <summary>
/// Build is called at the point when all of the middleware should be chained
/// together. This is typically done by the hosting component which created the app builder,
/// and does not need to be called by the startup method if the IAppBuilder is passed in.
/// </summary>
/// <param name="returnType">
/// The Type argument indicates which calling convention should be returned, and
/// is typically typeof(Func&lt;IDictionary&lt;string, object&gt;, Task&gt;) for the OWIN
/// calling convention.
/// </param>
/// <returns>
/// Returns an instance of the pipeline's entry point. This object may be safely cast to the
/// type which was provided
/// </returns>
object Build(Type returnType);

/// <summary>
/// The New method creates a new instance of an IAppBuilder. This is needed to create
/// a tree structure in your processing, rather than a linear pipeline. The new instance share the
/// same Properties, but will be created with a new, empty middleware list.
///
/// To create a tangent pipeline you would first call New, followed by several calls to Use on
/// the new builder, ending with a call to Build on the new builder. The return value from Build
/// will be the entry-point to your tangent pipeline. This entry-point may now be added to the
/// main pipeline as an argument to a switching middleware, which will either call the tangent
/// pipeline or the "next app", based on something in the request.
///
/// That said - all of that work is typically hidden by a middleware like Map, which will do that
/// for you.
/// </summary>
/// <returns>The new instance of the IAppBuilder implementation</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "New", Justification = "By design")]
IAppBuilder New();
}
}
26 changes: 26 additions & 0 deletions src/Owin/Owin.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net40</TargetFrameworks>
<ProjectGuid>{480FD49E-9C69-4FCE-B93A-3E65AFBF82D9}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Owin</RootNamespace>
<AssemblyName>Owin</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.1</Version>
<Title>OWIN</Title>
<Authors>OWIN startup components contributors</Authors>
<PackageLicenseUrl>https://github.com/aspnet/owin.dll/blob/master/LICENSE.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/aspnet/owin.dll/</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>OWIN IAppBuilder startup interface</Description>
<PackageTags>OWIN</PackageTags>
<RepositoryUrl>https://github.com/aspnet/owin.dll/</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Owin.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(ProjectDir)..\Common.targets" />
</Project>
Binary file added src/Owin/Owin.snk
Binary file not shown.