diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ca790d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,46 @@ +* text + +*.bmp binary +*.dll binary +*.gif binary +*.jpg binary +*.png binary +*.snk binary +*.mdf binary +*.ldf binary +*.sql binary +*.nupkg binary +*.exe binary + +*.ascx text +*.cd text +*.cmd text +*.coffee text +*.config text +*.cs text diff=csharp +*.csproj text merge=union +*.cshtml text +*.css text +*.dtd text +*.edmx text +*.htm text +*.html text +*.js text +*.json text +*.msbuild text +*.nuspec text +*.resx text +*.ruleset text +*.StyleCop text +*.targets text +*.tt text +*.txt text +*.vb text +*.vbhtml text +*.vbproj text merge=union +*.vbs text +*.wsf text +*.xml text +*.xunit text + +*.sln text eol=crlf merge=union \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e527ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,200 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studo 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +!**/System.Web.OData.Design.Scaffolding/ReferencePackages/* +!**/Microsoft.Restier.Scaffolding/ReferencePackages/* +!**/packages/Microsoft.ApplicationInsights.1.0.1-beta/* +# The packages folder can be ignored because of Package Restore +**/packages/* +# Uncomment the nuget have not been +!**/packages/Microsoft.ApplicationInsights.1.0.1-beta/ +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.[Cc]ache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/README.md b/README.md new file mode 100644 index 0000000..0f62898 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# OData WebApi Authorization extensions \ No newline at end of file diff --git a/sln/WebApiAuthorization.sln b/sln/WebApiAuthorization.sln new file mode 100644 index 0000000..00ff119 --- /dev/null +++ b/sln/WebApiAuthorization.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29806.167 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNet.OData.Authorization", "..\src\Microsoft.AspNet.OData.Authorization\Microsoft.AspNet.OData.Authorization.csproj", "{C5584F3A-1D56-404C-B77D-B488419F9DCF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.OData.Authorization.Tests", "..\test\Microsoft.AspNet.OData.Authorization.Tests\Microsoft.AspNet.OData.Authorization.Tests.csproj", "{4006B90C-924A-407D-BEAD-F229699BA552}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5584F3A-1D56-404C-B77D-B488419F9DCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5584F3A-1D56-404C-B77D-B488419F9DCF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5584F3A-1D56-404C-B77D-B488419F9DCF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5584F3A-1D56-404C-B77D-B488419F9DCF}.Release|Any CPU.Build.0 = Release|Any CPU + {4006B90C-924A-407D-BEAD-F229699BA552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4006B90C-924A-407D-BEAD-F229699BA552}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4006B90C-924A-407D-BEAD-F229699BA552}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4006B90C-924A-407D-BEAD-F229699BA552}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A0192535-BE21-4075-B04D-25DEF66502E8} + EndGlobalSection +EndGlobal diff --git a/src/Microsoft.AspNet.OData.Authorization/Class1.cs b/src/Microsoft.AspNet.OData.Authorization/Class1.cs new file mode 100644 index 0000000..9e97dbd --- /dev/null +++ b/src/Microsoft.AspNet.OData.Authorization/Class1.cs @@ -0,0 +1,9 @@ +using System; + +namespace Microsoft.AspNet.OData.Authorization +{ + public class Class1 + { + public int Add(int x, int y) => x + y; + } +} diff --git a/src/Microsoft.AspNet.OData.Authorization/Microsoft.AspNet.OData.Authorization.csproj b/src/Microsoft.AspNet.OData.Authorization/Microsoft.AspNet.OData.Authorization.csproj new file mode 100644 index 0000000..cb63190 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Authorization/Microsoft.AspNet.OData.Authorization.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.1 + + + diff --git a/test/Microsoft.AspNet.OData.Authorization.Tests/Microsoft.AspNet.OData.Authorization.Tests.csproj b/test/Microsoft.AspNet.OData.Authorization.Tests/Microsoft.AspNet.OData.Authorization.Tests.csproj new file mode 100644 index 0000000..85fbd4d --- /dev/null +++ b/test/Microsoft.AspNet.OData.Authorization.Tests/Microsoft.AspNet.OData.Authorization.Tests.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNet.OData.Authorization.Tests/UnitTest1.cs b/test/Microsoft.AspNet.OData.Authorization.Tests/UnitTest1.cs new file mode 100644 index 0000000..a9cf66b --- /dev/null +++ b/test/Microsoft.AspNet.OData.Authorization.Tests/UnitTest1.cs @@ -0,0 +1,16 @@ +using System; +using Xunit; +using Microsoft.AspNet.OData.Authorization; + +namespace Microsoft.AspNet.OData.Authorization.Tests +{ + public class UnitTest1 + { + [Fact] + public void Test1() + { + var test = new Class1(); + Assert.Equal(3, test.Add(1, 2)); + } + } +}