mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Compare commits
384 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63be17f440 | ||
|
|
06ee7849c1 | ||
|
|
61c91ff858 | ||
|
|
92cbf8925b | ||
|
|
c8b7c64d93 | ||
|
|
9572ef9ad3 | ||
|
|
388932b41f | ||
|
|
829f69198c | ||
|
|
4648a252b9 | ||
|
|
219f29cd20 | ||
|
|
51003bf582 | ||
|
|
0d5cff66a9 | ||
|
|
7e66c98dd5 | ||
|
|
14c2ee7944 | ||
|
|
9ae372a920 | ||
|
|
eecb61a132 | ||
|
|
4574a9fb0b | ||
|
|
bec9a6d792 | ||
|
|
dbe89d0a82 | ||
|
|
255547288b | ||
|
|
a9abc294e3 | ||
|
|
101d61b808 | ||
|
|
054925c297 | ||
|
|
ff97d1e975 | ||
|
|
e26fee3d6c | ||
|
|
ec0ea5e321 | ||
|
|
dd9d67fe48 | ||
|
|
9105187f78 | ||
|
|
1da6066e83 | ||
|
|
52c6debc97 | ||
|
|
f3be4fa2c7 | ||
|
|
d64541d47a | ||
|
|
9714c2c5f0 | ||
|
|
855d183be3 | ||
|
|
a37e548b25 | ||
|
|
99695f07cc | ||
|
|
63ca6ee2d8 | ||
|
|
042c47cc3f | ||
|
|
49ab41d4dc | ||
|
|
7fb63fd9eb | ||
|
|
e853550bda | ||
|
|
24c68bebe4 | ||
|
|
0a82363187 | ||
|
|
1e87eee2e4 | ||
|
|
53244d702c | ||
|
|
07cc3a6bad | ||
|
|
6f4762a30c | ||
|
|
ce3179307d | ||
|
|
2620dc820d | ||
|
|
9c88c7fcd1 | ||
|
|
a01b7dde23 | ||
|
|
62136eb59f | ||
|
|
8ed39703e5 | ||
|
|
a3ded18eb6 | ||
|
|
5b0efdba58 | ||
|
|
8865041a8b | ||
|
|
d9e833ba58 | ||
|
|
9137414305 | ||
|
|
65ae99abd4 | ||
|
|
eb9bfa0d29 | ||
|
|
1724be5c72 | ||
|
|
7a289ca1ad | ||
|
|
b7a0b007e4 | ||
|
|
f2fb1d520d | ||
|
|
59d95f11ee | ||
|
|
248cc7ecde | ||
|
|
bb41f1f559 | ||
|
|
5903f75665 | ||
|
|
46182edc5d | ||
|
|
accd4196dc | ||
|
|
d3d85f3519 | ||
|
|
6e90f704f8 | ||
|
|
497b782a6a | ||
|
|
bc935f18b3 | ||
|
|
12a51ea7af | ||
|
|
f0b1639143 | ||
|
|
9bb95efaaa | ||
|
|
e6c042d1a0 | ||
|
|
df583ea571 | ||
|
|
c7fde5bc72 | ||
|
|
d080037af9 | ||
|
|
5a6ba5ddd6 | ||
|
|
658a5601a5 | ||
|
|
adbab55ffc | ||
|
|
20fbd99658 | ||
|
|
d9a0e040c1 | ||
|
|
4aaf4d34d0 | ||
|
|
7143792c0e | ||
|
|
4214329a1f | ||
|
|
921b2472f1 | ||
|
|
9e9e19c439 | ||
|
|
f3595881fe | ||
|
|
ba36eae848 | ||
|
|
0bf76dc7ac | ||
|
|
66ff5d36e9 | ||
|
|
749ff5dc72 | ||
|
|
d958df3041 | ||
|
|
8690278bed | ||
|
|
85c4a99c13 | ||
|
|
a3fe3592c6 | ||
|
|
a2c31a1e5c | ||
|
|
3f6dfa3dec | ||
|
|
f9ef297777 | ||
|
|
801b8998db | ||
|
|
a28b966685 | ||
|
|
3656e5e466 | ||
|
|
92b7ad7554 | ||
|
|
18bb847488 | ||
|
|
47133604c3 | ||
|
|
80b93e412a | ||
|
|
e839f84537 | ||
|
|
a548e47f90 | ||
|
|
89e8658f49 | ||
|
|
6d255f24ab | ||
|
|
e8f0ba6ec7 | ||
|
|
60798f9346 | ||
|
|
c83f5d88cb | ||
|
|
2f2134412e | ||
|
|
1e6b6bb24f | ||
|
|
16de29dabd | ||
|
|
691809cd85 | ||
|
|
ce1df8d794 | ||
|
|
74be36d8a3 | ||
|
|
2bb7eb2f91 | ||
|
|
c4592aa65f | ||
|
|
9bac35b3f1 | ||
|
|
2a0f866f26 | ||
|
|
371238a882 | ||
|
|
67e7d1074e | ||
|
|
25c34d8bca | ||
|
|
75f3a618f0 | ||
|
|
9947f3973e | ||
|
|
a685517118 | ||
|
|
14482162fd | ||
|
|
0f757655b8 | ||
|
|
39fb266221 | ||
|
|
9b91b1b260 | ||
|
|
c2194381f8 | ||
|
|
c860b89e23 | ||
|
|
04f29ba70c | ||
|
|
e118695ea7 | ||
|
|
894e90f485 | ||
|
|
97bb52bbdd | ||
|
|
f3d08d61c4 | ||
|
|
22697edeec | ||
|
|
e0fc576f9e | ||
|
|
ef9e5de8f4 | ||
|
|
5878611817 | ||
|
|
2b61e3368d | ||
|
|
f5772334e1 | ||
|
|
fcc4a944bb | ||
|
|
a0d61c67b8 | ||
|
|
42ff708da8 | ||
|
|
b52a846c5f | ||
|
|
9a8b64393e | ||
|
|
bd1f14eeb0 | ||
|
|
4b59569013 | ||
|
|
a603c7e07a | ||
|
|
96f6cb36fd | ||
|
|
3d63c6d333 | ||
|
|
4cdb081c9d | ||
|
|
9ed6b4261d | ||
|
|
a0e78f2eb0 | ||
|
|
af4e41a717 | ||
|
|
7f91e787de | ||
|
|
6810cf473f | ||
|
|
79a0ae86e8 | ||
|
|
4cec35daf8 | ||
|
|
8d4cb98d59 | ||
|
|
e6424e2589 | ||
|
|
dcc7783f12 | ||
|
|
d35ebe04e7 | ||
|
|
c80f2d4baa | ||
|
|
9a4e0c1741 | ||
|
|
47d3d2b738 | ||
|
|
e0e600a6ce | ||
|
|
21875b98cc | ||
|
|
28a1b4d663 | ||
|
|
bbcdd67b95 | ||
|
|
cfc1dc2379 | ||
|
|
9e95f96195 | ||
|
|
770704f3a7 | ||
|
|
d9a3db1ebf | ||
|
|
9980633ac3 | ||
|
|
5b42c707b1 | ||
|
|
83a35f89cf | ||
|
|
746d3d54c2 | ||
|
|
f19b57c1e6 | ||
|
|
7533cd8879 | ||
|
|
75609bf2ce | ||
|
|
4b44827f2a | ||
|
|
a04195ee0e | ||
|
|
b2c131f516 | ||
|
|
359d25c1f2 | ||
|
|
6552735df3 | ||
|
|
59b3d50e03 | ||
|
|
f2bf75328e | ||
|
|
0213524317 | ||
|
|
fd931397a4 | ||
|
|
64585223ee | ||
|
|
564fdc27be | ||
|
|
06e4d2f7f8 | ||
|
|
cc70480126 | ||
|
|
7bcb6b83fb | ||
|
|
e72471f020 | ||
|
|
de74c00378 | ||
|
|
b206a656e8 | ||
|
|
32669d347a | ||
|
|
5bdfb6e98a | ||
|
|
85fd5c8320 | ||
|
|
41bd9ce9bc | ||
|
|
e346170f24 | ||
|
|
b399925368 | ||
|
|
ecbd485fd8 | ||
|
|
0fcf8c7409 | ||
|
|
430c3de460 | ||
|
|
a6f5e4fb01 | ||
|
|
ff1fe79016 | ||
|
|
8e9f6ce8bd | ||
|
|
47e0b96725 | ||
|
|
f25758cc05 | ||
|
|
bb6a44634d | ||
|
|
3657cfecab | ||
|
|
8a08680a74 | ||
|
|
25670b9620 | ||
|
|
fa09e2e83a | ||
|
|
a9a1413331 | ||
|
|
637cea6a02 | ||
|
|
cc82bfcca0 | ||
|
|
faa216147d | ||
|
|
cbf10216b0 | ||
|
|
bb560f9cdf | ||
|
|
bc2e0607ef | ||
|
|
cd5ca49b32 | ||
|
|
6da6c5c214 | ||
|
|
37a5a7effc | ||
|
|
baad84ee7b | ||
|
|
8a8b0f91c6 | ||
|
|
93476c321a | ||
|
|
ea91185816 | ||
|
|
879e35dcc0 | ||
|
|
e8111cef5e | ||
|
|
c0ebbd4ce7 | ||
|
|
818b35a370 | ||
|
|
34947136d4 | ||
|
|
894d932210 | ||
|
|
8032d202e3 | ||
|
|
046c62e710 | ||
|
|
9001972d8b | ||
|
|
0fc8f5accf | ||
|
|
2a34cb582b | ||
|
|
7411013b45 | ||
|
|
0e7f864d4d | ||
|
|
14cdf57bc5 | ||
|
|
41e9fda2de | ||
|
|
e6211dbf54 | ||
|
|
1664aa1bde | ||
|
|
1b54e3e8fb | ||
|
|
5d09053d30 | ||
|
|
1494aec836 | ||
|
|
a0f42632e0 | ||
|
|
28643ae7b8 | ||
|
|
70ea2df334 | ||
|
|
e964d80f7e | ||
|
|
1e62b2b9f8 | ||
|
|
1732c333c2 | ||
|
|
a01d219607 | ||
|
|
36910e8659 | ||
|
|
230314d7a1 | ||
|
|
7282df4326 | ||
|
|
81034f43d2 | ||
|
|
30a95ed773 | ||
|
|
ddaf49db4a | ||
|
|
3d3d6205b6 | ||
|
|
e72d226263 | ||
|
|
4da838a3c3 | ||
|
|
d63119b1e6 | ||
|
|
6bc98bede6 | ||
|
|
99e05c8a09 | ||
|
|
3e1087ff58 | ||
|
|
43315c349f | ||
|
|
e74b6ad6f8 | ||
|
|
6fe3cf8538 | ||
|
|
db6c25aba2 | ||
|
|
938fd5b827 | ||
|
|
b100634587 | ||
|
|
a071f21f4e | ||
|
|
eed1a9a063 | ||
|
|
0faaa22546 | ||
|
|
0f6fa5844b | ||
|
|
784e1c0961 | ||
|
|
9a2eaf7ac9 | ||
|
|
d805c7773d | ||
|
|
18c5b5dfff | ||
|
|
b76306dfb3 | ||
|
|
89c5b2f7de | ||
|
|
6bce34f379 | ||
|
|
c8f2c27311 | ||
|
|
22fa33c06f | ||
|
|
2508f503b7 | ||
|
|
1093e16a81 | ||
|
|
1fe436e05a | ||
|
|
b18f153e6a | ||
|
|
b05dcf9a56 | ||
|
|
3c7fffc320 | ||
|
|
b580995e4b | ||
|
|
2873eb8991 | ||
|
|
eebe29fec3 | ||
|
|
7bbad86eb4 | ||
|
|
dbba4e2787 | ||
|
|
27365a71d9 | ||
|
|
6a5028b80a | ||
|
|
e021218b3c | ||
|
|
993e6a1e43 | ||
|
|
0318db4c53 | ||
|
|
03a193b6c2 | ||
|
|
38705580c8 | ||
|
|
6b0985a44e | ||
|
|
2c3973bfa0 | ||
|
|
28168c0550 | ||
|
|
c3dffb79f5 | ||
|
|
5b40567b6d | ||
|
|
0f48019321 | ||
|
|
583ff8951a | ||
|
|
5c688267fa | ||
|
|
2c496a36db | ||
|
|
51a364a184 | ||
|
|
c435a98670 | ||
|
|
42dae3edf3 | ||
|
|
24ee246a34 | ||
|
|
9966e13fa3 | ||
|
|
f3fc2b53ba | ||
|
|
1a9b7af4ac | ||
|
|
0c7fd67dca | ||
|
|
6063ba31d0 | ||
|
|
7bf2c702a1 | ||
|
|
61d432ba4c | ||
|
|
7cdb9ecf53 | ||
|
|
ae61c81575 | ||
|
|
e10ba8126a | ||
|
|
a7626b78f5 | ||
|
|
29042d10f2 | ||
|
|
760e30855c | ||
|
|
6636527006 | ||
|
|
aacf0b2476 | ||
|
|
88ac0d2879 | ||
|
|
ac305af963 | ||
|
|
78fb58f016 | ||
|
|
8481768b58 | ||
|
|
50d65bc0b9 | ||
|
|
4eb8d1d2ea | ||
|
|
104cf7d5f4 | ||
|
|
220c1b591a | ||
|
|
b06a4ecb73 | ||
|
|
764db254da | ||
|
|
c1359f7a86 | ||
|
|
51409346cc | ||
|
|
2cd5af5193 | ||
|
|
1180425109 | ||
|
|
3c3a6df6dd | ||
|
|
c6e96867c7 | ||
|
|
8d134ba0c5 | ||
|
|
9d5bc20666 | ||
|
|
1fcf7c86d0 | ||
|
|
bca643bf1f | ||
|
|
f276501923 | ||
|
|
76408da930 | ||
|
|
43497c8093 | ||
|
|
f13c9d47c7 | ||
|
|
1a8b17d04e | ||
|
|
20c5b494cd | ||
|
|
cd49d2ccf2 | ||
|
|
aa2e2cf1d0 | ||
|
|
8eea9a6771 | ||
|
|
1d445c5438 | ||
|
|
6aabc4d9f9 | ||
|
|
14172fec51 | ||
|
|
9e88d16273 | ||
|
|
66af4a8cdf | ||
|
|
92bde1ac71 | ||
|
|
7e149c4bc1 | ||
|
|
d78afaeb51 | ||
|
|
a0279f2d9c | ||
|
|
98475f7aa0 |
3
.deployment
Normal file
3
.deployment
Normal file
@@ -0,0 +1,3 @@
|
||||
[config]
|
||||
command = deploy.cmd
|
||||
SCM_COMMAND_IDLE_TIMEOUT = 3600
|
||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -96,6 +96,7 @@ publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.Publish.xml
|
||||
*.pubxml
|
||||
|
||||
# NuGet Packages Directory
|
||||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||
@@ -164,13 +165,14 @@ build/
|
||||
/buildtasks
|
||||
/artifacts
|
||||
*.sln.cache
|
||||
#src/Orchard.Web/Media/*
|
||||
src/Orchard.Web/Media/*
|
||||
log.xml
|
||||
profiling/
|
||||
*.orig
|
||||
src/Orchard.Web/Modules-temp/*
|
||||
src/Backup/*
|
||||
src/packages/*
|
||||
src/node_modules
|
||||
src/UpgradeLog.*
|
||||
*.itrace.csdef
|
||||
*.build.csdef
|
||||
@@ -182,14 +184,7 @@ src/Orchard.Web/Orchard.Web.Publish.xml
|
||||
src/TestResults/*
|
||||
src/Orchard.Web/Properties/PublishProfiles
|
||||
src/Orchard.Azure/Orchard.Azure.CloudService/Staging/
|
||||
node_modules/
|
||||
|
||||
# Enable all /lib artifacts
|
||||
#enable all /lib artifacts
|
||||
!lib/*/*.*
|
||||
|
||||
# Enable version control of some IDeliverable specifics.
|
||||
src/Orchard.Web/Media/Default/RecipeJournal/*
|
||||
src/Orchard.Web/Media/Default/_Profiles/*
|
||||
|
||||
# Enable "IDeliverable/Packaging/" folder.
|
||||
!src/IDeliverable/Packaging/*/*.*
|
||||
*/.vs/*
|
||||
|
||||
13
Orchard.proj
13
Orchard.proj
@@ -27,6 +27,7 @@
|
||||
|
||||
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
|
||||
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
|
||||
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
|
||||
|
||||
<!-- TeamCity build number -->
|
||||
<Version>$(BUILD_NUMBER)</Version>
|
||||
@@ -115,7 +116,7 @@
|
||||
<MSBuild
|
||||
Projects="$(SrcFolder)\Orchard.sln"
|
||||
Targets="Build"
|
||||
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />
|
||||
Properties="Configuration=$(Configuration);OutputPath=$(CompileFolder)" />
|
||||
<!-- Compile to "regular" output folder for devs using VS locally -->
|
||||
<MSBuild
|
||||
Projects="$(SrcFolder)\Orchard.sln"
|
||||
@@ -126,7 +127,7 @@
|
||||
<MSBuild
|
||||
Projects="$(SrcFolder)\Tools\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=Release;OutputPath=$(MsBuildTasksFolder)" />
|
||||
Properties="Configuration=$(Configuration);OutputPath=$(MsBuildTasksFolder)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="TypeScript" DependsOnTargets="CompileMsBuildTasks">
|
||||
@@ -155,7 +156,7 @@
|
||||
<Output TaskParameter="Include" ItemName="TestAssemblies" />
|
||||
</CreateItem>
|
||||
|
||||
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" />
|
||||
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" ExcludeCategory="longrunning" />
|
||||
</Target>
|
||||
|
||||
<Target Name ="Spec" DependsOnTargets="Package-Stage">
|
||||
@@ -273,19 +274,19 @@
|
||||
<!-- extra processing of the staged config files -->
|
||||
<TransformXml
|
||||
Source="$(StageFolder)\Web.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Web.Release.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Web.$(Configuration).Config"
|
||||
Destination="$(StageFolder)\Web.Config"
|
||||
/>
|
||||
|
||||
<TransformXml
|
||||
Source="$(StageFolder)\Config\HostComponents.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Config\HostComponents.Release.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Config\HostComponents.$(Configuration).Config"
|
||||
Destination="$(StageFolder)\Config\HostComponents.Config"
|
||||
/>
|
||||
|
||||
<TransformXml
|
||||
Source="$(StageFolder)\Config\log4net.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Config\log4net.Release.Config"
|
||||
Transform="$(SrcFolder)\Orchard.Web\Config\log4net.$(Configuration).Config"
|
||||
Destination="$(StageFolder)\Config\log4net.Config"
|
||||
/>
|
||||
|
||||
|
||||
28
README.md
28
README.md
@@ -1,6 +1,13 @@
|
||||
# Orchard
|
||||
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
|
||||
|
||||
[](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button
|
||||
|
||||
[](https://ms.portal.azure.com/#create/OutercurveFoundation.OrchardCMS.0.5.9)
|
||||
|
||||
## About The Orchard Project
|
||||
|
||||
#### Please visit our website at http://orchardproject.net for the most current information about this project.
|
||||
@@ -13,26 +20,29 @@ Orchard is delivered under the [.NET Foundation](http://www.dotnetfoundation.org
|
||||
|
||||
Our mission is to empower our users and foster a dedicated and diverse community that builds the CMS that we all want to use.
|
||||
|
||||
There are many ways you can [contribute to Orchard](http://orchardproject.net/contribution): you can [fix bugs](https://github.com/OrchardCMS/Orchard/issues), contribute modules and themes to [our gallery](http://gallery.orchardproject.net/), [write documentation](https://github.com/OrchardCMS/OrchardDoc), [translate Orchard](http://orchardproject.net/localize), or answer questions [on our forums](http://orchard.codeplex.com/discussions) and [on Stack Overflow](http://stackoverflow.com/questions/tagged/orchardcms).
|
||||
|
||||
## Project Status
|
||||
Orchard is currently in version 1.8.1. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.8.1 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://www.orchardproject.net/docs/Installing-Orchard.ashx). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
Orchard is currently in version 1.9.2. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.9.2 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
|
||||
* [Download the latest release](https://github.com/OrchardCMS/Orchard/releases)
|
||||
* [Feature roadmap](http://www.orchardproject.net/docs/feature-roadmap.ashx)
|
||||
* [Feature roadmap](http://docs.orchardproject.net/Documentation/feature-roadmap)
|
||||
* [Docs and designs/specs](http://www.orchardproject.net/docs)
|
||||
* [About us](http://www.orchardproject.net/about)
|
||||
* [Contact us](mailto:ofeedbk@microsoft.com)
|
||||
|
||||
## How To Get Involved
|
||||
We hope that by engaging with the community in the very early stages of the project that we will be able to shape Orchard into a valuable set of tools and applications for the community. The Orchard team is committed to open community participation and accepts code contributions today. We encourage community participation at all levels from general project feedback to bug fixes and patches.
|
||||
We hope that by engaging with the community we will continue to shape Orchard into a valuable set of tools and applications. The Orchard team is committed to open community participation and accepts code contributions. We encourage community participation at all levels from general project feedback to bug fixes and patches.
|
||||
|
||||
There are many ways you can [contribute to Orchard](http://orchardproject.net/contribution):
|
||||
|
||||
* [Check out the code](https://github.com/OrchardCMS/Orchard)
|
||||
* [Check out the docs](http://orchardproject.net/docs)
|
||||
* [Write documentation](https://github.com/OrchardCMS/OrchardDoc)
|
||||
* [Find and file a bug](https://github.com/OrchardCMS/Orchard/issues)
|
||||
* [Propose a feature idea](http://orchard.uservoice.com)
|
||||
* [Ask and answer questions](http://www.orchardproject.net/discussions)
|
||||
* [Ask and answer questions in our forums](http://www.orchardproject.net/discussions) and [on Stack Overflow](http://stackoverflow.com/questions/tagged/orchardcms)
|
||||
* [Participate in our gitter.im chatroom](https://gitter.im/OrchardCMS/Orchard)
|
||||
* [Participate in forum discussions](http://orchard.codeplex.com/discussions)
|
||||
* [Submit a patch](http://www.orchardproject.net/docs/Contributing-patches.ashx)
|
||||
* [Submit a pull request](http://docs.orchardproject.net/Documentation/Contributing-patches)
|
||||
* [Translate Orchard](http://orchardproject.net/localize)
|
||||
* [Contribute modules and themes to our gallery](http://gallery.orchardproject.net/)
|
||||
* [Send us feedback](mailto:ofeedbk@microsoft.com)
|
||||
|
||||
114
deploy.cmd
Normal file
114
deploy.cmd
Normal file
@@ -0,0 +1,114 @@
|
||||
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
|
||||
|
||||
:: ----------------------
|
||||
:: KUDU Deployment Script
|
||||
:: Version: 0.1.11
|
||||
:: ----------------------
|
||||
|
||||
:: Prerequisites
|
||||
:: -------------
|
||||
|
||||
:: Verify node.js installed
|
||||
where node 2>nul >nul
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
|
||||
goto error
|
||||
)
|
||||
|
||||
:: Setup
|
||||
:: -----
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
SET ARTIFACTS=%~dp0%..\artifacts
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_SOURCE (
|
||||
SET DEPLOYMENT_SOURCE=%~dp0%.
|
||||
)
|
||||
|
||||
IF NOT DEFINED DEPLOYMENT_TARGET (
|
||||
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
|
||||
)
|
||||
|
||||
IF NOT DEFINED NEXT_MANIFEST_PATH (
|
||||
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
|
||||
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
|
||||
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
|
||||
)
|
||||
)
|
||||
|
||||
IF NOT DEFINED KUDU_SYNC_CMD (
|
||||
:: Install kudu sync
|
||||
echo Installing Kudu Sync
|
||||
call npm install kudusync -g --silent
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: Locally just running "kuduSync" would also work
|
||||
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
|
||||
)
|
||||
IF NOT DEFINED DEPLOYMENT_TEMP (
|
||||
SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
|
||||
SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
|
||||
)
|
||||
|
||||
IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
|
||||
IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
|
||||
mkdir "%DEPLOYMENT_TEMP%"
|
||||
)
|
||||
|
||||
IF NOT DEFINED MSBUILD_PATH (
|
||||
SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
|
||||
)
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Deployment
|
||||
:: ----------
|
||||
|
||||
echo Handling .NET Web Application deployment.
|
||||
|
||||
:: 1. Restore NuGet packages
|
||||
IF /I "" NEQ "" (
|
||||
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
)
|
||||
|
||||
:: 2. Build to the temporary path
|
||||
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: 3. KuduSync
|
||||
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\build\Precompiled" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: Post deployment stub
|
||||
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
goto end
|
||||
|
||||
:: Execute command routine that will echo out when error
|
||||
:ExecuteCmd
|
||||
setlocal
|
||||
set _CMD_=%*
|
||||
call %_CMD_%
|
||||
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:error
|
||||
endlocal
|
||||
echo An error has occurred during web site deployment.
|
||||
call :exitSetErrorLevel
|
||||
call :exitFromFunction 2>nul
|
||||
|
||||
:exitSetErrorLevel
|
||||
exit /b 1
|
||||
|
||||
:exitFromFunction
|
||||
()
|
||||
|
||||
:end
|
||||
endlocal
|
||||
echo Finished successfully.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
This is a modified version including a [assembly: SecutiryTransparent] attribute in AssemblyInfo.cs
|
||||
9
lib/msdeploy/createlogin.sql
Normal file
9
lib/msdeploy/createlogin.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
/**********************************************************************/
|
||||
/* Install.SQL */
|
||||
/* Creates a login and makes the user a member of db roles */
|
||||
/* */
|
||||
/* Modifications for SQL AZURE - ON MASTER */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
CREATE LOGIN PlaceHolderForUser WITH PASSWORD = 'PlaceHolderForPassword'
|
||||
15
lib/msdeploy/createuser.sql
Normal file
15
lib/msdeploy/createuser.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
/**********************************************************************/
|
||||
/* CreateUser.SQL */
|
||||
/* Creates a user and makes the user a member of db roles */
|
||||
/* This script runs against the User database and requires connection string */
|
||||
/* Supports SQL Server and SQL AZURE */
|
||||
/**********************************************************************/
|
||||
|
||||
-- Create database user and map to login
|
||||
-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
|
||||
--
|
||||
|
||||
CREATE USER PlaceHolderForUser FOR LOGIN PlaceHolderForUser;
|
||||
GO
|
||||
EXEC sp_addrolemember 'db_owner', PlaceHolderForUser;
|
||||
GO
|
||||
@@ -1,45 +0,0 @@
|
||||
/**********************************************************************/
|
||||
/* Install.SQL */
|
||||
/* Creates a login and makes the user a member of db roles */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
-- Declare variables for database name, username and password
|
||||
DECLARE @dbName sysname,
|
||||
@dbUser sysname,
|
||||
@dbPwd nvarchar(max);
|
||||
|
||||
-- Set variables for database name, username and password
|
||||
SET @dbName = 'PlaceHolderForDb';
|
||||
SET @dbUser = 'PlaceHolderForUser';
|
||||
SET @dbPwd = 'PlaceHolderForPassword';
|
||||
|
||||
DECLARE @cmd nvarchar(max)
|
||||
|
||||
-- Create login
|
||||
IF( SUSER_SID(@dbUser) is null )
|
||||
BEGIN
|
||||
print '-- Creating login '
|
||||
SET @cmd = N'CREATE LOGIN ' + quotename(@dbUser) + N' WITH PASSWORD ='''+ replace(@dbPwd, '''', '''''') + N''''
|
||||
EXEC(@cmd)
|
||||
END
|
||||
|
||||
-- Create database user and map to login
|
||||
-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
|
||||
--
|
||||
SET @cmd = N'USE ' + quotename(@DBName) + N';
|
||||
IF( NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' + replace(@dbUser, '''', '''''') + N'''))
|
||||
BEGIN
|
||||
print ''-- Creating user'';
|
||||
CREATE USER ' + quotename(@dbUser) + N' FOR LOGIN ' + quotename(@dbUser) + N';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_ddladmin'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_securityadmin'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_datareader'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_datawriter'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
END'
|
||||
EXEC(@cmd)
|
||||
GO
|
||||
@@ -1,7 +1,13 @@
|
||||
<MSDeploy.iisApp>
|
||||
<iisapp path="Orchard" managedRuntimeVersion="v4.0" />
|
||||
<iisapp path="Orchard" managedRuntimeVersion="v4.0" />
|
||||
<setAcl path="Orchard/App_Data" setAclAccess="Modify" />
|
||||
<setAcl path="Orchard/Media" setAclAccess="Modify" />
|
||||
<setAcl path="Orchard/bin/HostRestart" setAclAccess="Modify" />
|
||||
<dbFullSql path="install.sql" />
|
||||
</MSDeploy.iisApp>
|
||||
|
||||
<!-- Runs SQL script to create login and assign permissions, requires transacted="false"
|
||||
This script runs as the database administrator provided in parameters.xml
|
||||
-->
|
||||
<dbfullsql path="createlogin.sql" transacted="false" />
|
||||
<dbfullsql path="createuser.sql" transacted="false" />
|
||||
|
||||
</MSDeploy.iisApp>
|
||||
@@ -23,19 +23,20 @@
|
||||
|
||||
<!-- Prompts for the database name and fills it into the database scripts -->
|
||||
<parameter name="Database Name" description="Name of the database for Orchard." defaultValue="orchard" tags="SQL, dbName">
|
||||
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForDb" />
|
||||
|
||||
</parameter>
|
||||
|
||||
<!-- Prompts for the database username and fills it into the database scripts.
|
||||
The SQL tag indicates it is a parameter required for SQL, the DbUsername tag indicates this is a Db username -->
|
||||
<parameter name="Database Username" description="User name to access you application database." defaultValue="orcharduser" tags="SQL, DbUsername">
|
||||
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForUser" />
|
||||
<parameterEntry type="TextFile" scope="createuser.sql" match="PlaceHolderForUser" />
|
||||
<parameterEntry type="TextFile" scope="createlogin.sql" match="PlaceHolderForUser" />
|
||||
</parameter>
|
||||
|
||||
<!-- Prompts for the database password and fills it into the database scripts.
|
||||
The SQL tag indicates it is a parameter required for SQL, the DbUserPassword tag indicates this is a Db password -->
|
||||
<parameter name="Database Password" description="Password for the Database Username." tags="New, Password, SQL, DbUserPassword">
|
||||
<parameterEntry type="TextFile" scope="install.sql" match="PlaceHolderForPassword" />
|
||||
<parameterEntry type="TextFile" scope="createlogin.sql" match="PlaceHolderForPassword" />
|
||||
</parameter>
|
||||
|
||||
<!-- Prompts for the admin creds and uses it for the administrator connection string. This is used to create a login and assign permissions.
|
||||
@@ -47,19 +48,17 @@
|
||||
<!-- Prompts for the admin password and uses it for the administrator connection string.
|
||||
This is use to create a login and assign permissions. The SQL tag indicates it is a parameter required for SQL.
|
||||
The DbAdminPassword tag indicates it should be used when the user is creating a new database. If they're not, it can be filled in with the DbUserPassword value. -->
|
||||
<parameter name="Database Administrator Password" description="Password for the database administrator account." tags="New, Password, SQL, dbAdminPassword">
|
||||
<parameter name="Database Administrator Password" description="Password for the database administrator account." tags="Password, SQL, dbAdminPassword">
|
||||
</parameter>
|
||||
|
||||
<parameter name="Admin Connection String SqlServer"
|
||||
tags="SQLConnectionString, AdminConnectionString, Hidden, Validate" description="Automatically sets the connection string for the connection request."
|
||||
defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="install.sql" />
|
||||
<parameter name="Admin Connection String SqlServer1" tags="SQLConnectionString, sql, Hidden" description="Automatically sets the connection string for the connection request." defaultValue="Data Source={Database Server};Initial Catalog=MASTER;User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="createlogin.sql" />
|
||||
</parameter>
|
||||
|
||||
<parameter name="Non-Admin Connection String SqlServer"
|
||||
tags="SQLConnectionString, UserConnectionString, Hidden" description="Automatically sets the connection string for the connection request."
|
||||
defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Username};Password={Database Password}">
|
||||
<parameter name="Admin Connection String SqlServer2" tags="SQLConnectionString, SQL, Hidden" description="Automatically sets the connection string for the connection request." defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="createuser.sql" />
|
||||
</parameter>
|
||||
|
||||
|
||||
<parameter name="Orchard Connection String" friendlyName="Orchard Connection String" description="Orchard SQL Data Connection String Setting" defaultValue="" tags="Sql, SqlCE, SingleLineConnectionString, Hidden">
|
||||
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="(?<=\s*DataConnectionString:\s+)[^\s].*[^\r\n]" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -161,6 +161,237 @@
|
||||
asynchronous request failed.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.ResourceBase">
|
||||
<summary>
|
||||
Resource information.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceBase.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceBase class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceBase.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceBase class with required
|
||||
arguments.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceBase.Location">
|
||||
<summary>
|
||||
Required. Gets or sets the location of the resource.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceBase.Tags">
|
||||
<summary>
|
||||
Optional. Gets or sets the tags attached to the resource.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.ResourceBaseExtended">
|
||||
<summary>
|
||||
Resource information with extended details.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceBaseExtended.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceBaseExtended class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceBaseExtended.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceBaseExtended class with
|
||||
required arguments.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceBaseExtended.Id">
|
||||
<summary>
|
||||
Optional. Gets or sets the ID of the resource.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceBaseExtended.Name">
|
||||
<summary>
|
||||
Optional. Gets or sets the name of the resource.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceBaseExtended.Type">
|
||||
<summary>
|
||||
Optional. Gets or sets the type of the resource.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.ResourceIdentity">
|
||||
<summary>
|
||||
Resource identity.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceIdentity.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceIdentity class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceIdentity.#ctor(System.String,System.String,System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the ResourceIdentity class.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceIdentity.GetProviderFromResourceType(System.String)">
|
||||
<summary>
|
||||
Returns provider string from resource type.
|
||||
</summary>
|
||||
<param name="resourceType">Resource type.</param>
|
||||
<returns>Provider</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.ResourceIdentity.GetTypeFromResourceType(System.String)">
|
||||
<summary>
|
||||
Returns type string from resource type.
|
||||
</summary>
|
||||
<param name="resourceType">Resource type.</param>
|
||||
<returns>Type</returns>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceIdentity.ParentResourcePath">
|
||||
<summary>
|
||||
Optional. Gets or sets parent resource path (optional).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceIdentity.ResourceName">
|
||||
<summary>
|
||||
Required. Gets or sets resource name.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceIdentity.ResourceProviderApiVersion">
|
||||
<summary>
|
||||
Required. Gets or sets API version of the resource provider.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceIdentity.ResourceProviderNamespace">
|
||||
<summary>
|
||||
Required. Gets or sets namespace of the resource provider.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.ResourceIdentity.ResourceType">
|
||||
<summary>
|
||||
Required. Gets or sets resource type.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.Common.OData.FilterParameterAttribute">
|
||||
<summary>
|
||||
Parameter attribute used with OData filters.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.FilterParameterAttribute.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Microsoft.Azure.Common.OData.FilterParameterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="name">Property name to use in the filter.</param>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.FilterParameterAttribute.#ctor(System.String,System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Microsoft.Azure.Common.OData.FilterParameterAttribute"/> class.
|
||||
</summary>
|
||||
<param name="name">Property name to use in the filter.</param>
|
||||
<param name="format">Format of the value.</param>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.Common.OData.FilterParameterAttribute.Name">
|
||||
<summary>
|
||||
Property name to use in the filter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.Common.OData.FilterParameterAttribute.Format">
|
||||
<summary>
|
||||
Format of the value.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.Common.OData.FilterString">
|
||||
<summary>
|
||||
Handles OData filter generation.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.FilterString.Generate``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
||||
<summary>
|
||||
Generates an OData filter from a specified Linq expression.
|
||||
</summary>
|
||||
<typeparam name="T">Filter type</typeparam>
|
||||
<param name="filter">Entity to use for filter generation</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.Common.OData.UrlExpressionVisitor">
|
||||
<summary>
|
||||
Expression visitor class that generates OData style $filter parameter.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitBinary(System.Linq.Expressions.BinaryExpression)">
|
||||
<summary>
|
||||
Visits binary expression like ==, &&, >, etc.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitUnary(System.Linq.Expressions.UnaryExpression)">
|
||||
<summary>
|
||||
Visits binary expression !foo.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitConditional(System.Linq.Expressions.ConditionalExpression)">
|
||||
<summary>
|
||||
Visits conditional expression foo == true ? bar : fee. Throws NotSupportedException.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Throws NotSupportedException.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitNew(System.Linq.Expressions.NewExpression)">
|
||||
<summary>
|
||||
Visits new object expression like new DateTime().
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitConstant(System.Linq.Expressions.ConstantExpression)">
|
||||
<summary>
|
||||
Visits constants like 'a' or 123.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitMember(System.Linq.Expressions.MemberExpression)">
|
||||
<summary>
|
||||
Visits object members like p.Foo or dateTime.Hour.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.VisitMethodCall(System.Linq.Expressions.MethodCallExpression)">
|
||||
<summary>
|
||||
Visits method calls like Contains, StartsWith, etc. Methods that are not supported will throw an exception.
|
||||
</summary>
|
||||
<param name="node">Node to visit.</param>
|
||||
<returns>Original node.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.closeUnaryBooleanOperator">
|
||||
<summary>
|
||||
Appends 'eq true' to Boolean unary operators.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.PrintConstant(System.Object)">
|
||||
<summary>
|
||||
Helper method to print constant.
|
||||
</summary>
|
||||
<param name="val">Object to print.</param>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.GetPropertyName(System.Reflection.PropertyInfo)">
|
||||
<summary>
|
||||
Helper method to generate property name.
|
||||
</summary>
|
||||
<param name="property">Property to examine.</param>
|
||||
<returns>Property name or value specified in the FilterParameterAttribute.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.Common.OData.UrlExpressionVisitor.GetPropertyFormat(System.Reflection.PropertyInfo)">
|
||||
<summary>
|
||||
Helper method to retrieve format from the FilterParameterAttribute.
|
||||
</summary>
|
||||
<param name="property">Property to examine.</param>
|
||||
<returns>Format from FilterParameterAttribute or null.</returns>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.Common.Properties.Resources">
|
||||
<summary>
|
||||
A strongly-typed resource class, for looking up localized strings, etc.
|
||||
|
||||
BIN
lib/windowsazure/Microsoft.Azure.KeyVault.Core.dll
Normal file
BIN
lib/windowsazure/Microsoft.Azure.KeyVault.Core.dll
Normal file
Binary file not shown.
114
lib/windowsazure/Microsoft.Azure.KeyVault.Core.xml
Normal file
114
lib/windowsazure/Microsoft.Azure.KeyVault.Core.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Microsoft.Azure.KeyVault.Core</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Microsoft.Azure.KeyVault.Core.IKey">
|
||||
<summary>
|
||||
Interface for Keys
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.DecryptAsync(System.Byte[],System.Byte[],System.Byte[],System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Decrypts the specified cipher text.
|
||||
</summary>
|
||||
<param name="ciphertext">The cipher text to decrypt</param>
|
||||
<param name="iv">The initialization vector</param>
|
||||
<param name="authenticationData">The authentication data</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>The plain text</returns>
|
||||
<remarks>If algorithm is not specified, an implementation should use its default algorithm.
|
||||
Not all algorithms require, or support, all parameters.</remarks>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.EncryptAsync(System.Byte[],System.Byte[],System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Encrypts the specified plain text.
|
||||
</summary>
|
||||
<param name="plaintext">The plain text to encrypt</param>
|
||||
<param name="iv">The initialization vector</param>
|
||||
<param name="authenticationData">The authentication data</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>A Tuple consisting of the cipher text, the authentication tag (if applicable), the algorithm used</returns>
|
||||
<remarks>If the algorithm is not specified, an implementation should use its default algorithm.
|
||||
Not all algorithyms require, or support, all parameters.</remarks>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.WrapKeyAsync(System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Encrypts the specified key material.
|
||||
</summary>
|
||||
<param name="key">The key material to encrypt</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>A Tuple consisting of the encrypted key and the algorithm used</returns>
|
||||
<remarks>If the algorithm is not specified, an implementation should use its default algorithm</remarks>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.UnwrapKeyAsync(System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Decrypts the specified key material.
|
||||
</summary>
|
||||
<param name="encryptedKey">The encrypted key material</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>The decrypted key material</returns>
|
||||
<remarks>If the algorithm is not specified, an implementation should use its default algorithm</remarks>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.SignAsync(System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Signs the specified digest.
|
||||
</summary>
|
||||
<param name="digest">The digest to sign</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>A Tuple consisting of the signature and the algorithm used</returns>
|
||||
<remarks>If the algorithm is not specified, an implementation should use its default algorithm</remarks>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKey.VerifyAsync(System.Byte[],System.Byte[],System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Verifies the specified signature value
|
||||
</summary>
|
||||
<param name="digest">The digest</param>
|
||||
<param name="signature">The signature value</param>
|
||||
<param name="algorithm">The algorithm to use</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>A bool indicating whether the signature was successfully verified</returns>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.KeyVault.Core.IKey.DefaultEncryptionAlgorithm">
|
||||
<summary>
|
||||
The default encryption algorithm for this key
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.KeyVault.Core.IKey.DefaultKeyWrapAlgorithm">
|
||||
<summary>
|
||||
The default key wrap algorithm for this key
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.KeyVault.Core.IKey.DefaultSignatureAlgorithm">
|
||||
<summary>
|
||||
The default signature algorithm for this key
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Microsoft.Azure.KeyVault.Core.IKey.Kid">
|
||||
<summary>
|
||||
The key identifier
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.Azure.KeyVault.Core.IKeyResolver">
|
||||
<summary>
|
||||
Interface for key resolvers.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.Azure.KeyVault.Core.IKeyResolver.ResolveKeyAsync(System.String,System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
Provides an IKey implementation for the specified key identifier.
|
||||
</summary>
|
||||
<param name="kid">The key identifier to resolve</param>
|
||||
<param name="token">Cancellation token</param>
|
||||
<returns>The resolved IKey implementation or null</returns>
|
||||
<remarks>Implementations should check the format of the kid to ensure that it is recognized. Null, rather than
|
||||
an exception, should be returned for unrecognized key identifiers to enable chaining of key resolvers.</remarks>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
Binary file not shown.
@@ -40443,7 +40443,7 @@
|
||||
<param name="model">The model to use.</param>
|
||||
<param name="messageReaderSettings">The message reader settings to use.</param>
|
||||
<param name="version">The version of the payload being read.</param>
|
||||
<param name="typeKindFromPayloadFunc">A func to compute the type kind from the payload shape if it could not be determined from the expected type or the payload type.</param>
|
||||
<param name="typeKindPeekedFromPayloadFunc">A func to compute the type kind from the payload shape if it could not be determined from the expected type or the payload type.</param>
|
||||
<param name="targetTypeKind">The target type kind to be used to read the payload.</param>
|
||||
<param name="serializationTypeNameAnnotation">Potentially non-null instance of an annotation to put on the value reported from the reader.</param>
|
||||
<returns>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,19 +4,19 @@
|
||||
<name>Microsoft.WindowsAzure.Configuration</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Microsoft.WindowsAzure.CloudConfigurationManager">
|
||||
<member name="T:Microsoft.Azure.CloudConfigurationManager">
|
||||
<summary>
|
||||
Configuration manager for accessing Windows Azure settings.
|
||||
Configuration manager for accessing Microsoft Azure settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting(System.String)">
|
||||
<member name="M:Microsoft.Azure.CloudConfigurationManager.GetSetting(System.String)">
|
||||
<summary>
|
||||
Gets a setting with the given name.
|
||||
</summary>
|
||||
<param name="name">Setting name.</param>
|
||||
<returns>Setting value or null if not found.</returns>
|
||||
</member>
|
||||
<member name="P:Microsoft.WindowsAzure.CloudConfigurationManager.AppSettings">
|
||||
<member name="P:Microsoft.Azure.CloudConfigurationManager.AppSettings">
|
||||
<summary>
|
||||
Gets application settings.
|
||||
</summary>
|
||||
@@ -42,17 +42,17 @@
|
||||
Looks up a localized string similar to Argument "{0}" cannot be an empty string..
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Microsoft.WindowsAzure.AzureApplicationSettings">
|
||||
<member name="T:Microsoft.Azure.AzureApplicationSettings">
|
||||
<summary>
|
||||
Windows Azure settings.
|
||||
Microsoft Azure settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.#ctor">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.#ctor">
|
||||
<summary>
|
||||
Initializes the settings.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.IsMissingSettingException(System.Exception)">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.IsMissingSettingException(System.Exception)">
|
||||
<summary>
|
||||
Checks whether the given exception represents an exception throws
|
||||
for a missing setting.
|
||||
@@ -60,14 +60,14 @@
|
||||
<param name="e">Exception</param>
|
||||
<returns>True for the missing setting exception.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.GetSetting(System.String)">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.GetSetting(System.String)">
|
||||
<summary>
|
||||
Gets a setting with the given name.
|
||||
</summary>
|
||||
<param name="name">Setting name.</param>
|
||||
<returns>Setting value or null if such setting does not exist.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.GetValue(System.String,System.String,System.Func{System.String,System.String})">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.GetValue(System.String,System.String,System.Func{System.String,System.String})">
|
||||
<summary>
|
||||
Gets setting's value from the given provider.
|
||||
</summary>
|
||||
@@ -76,21 +76,21 @@
|
||||
<param name="getValue">Method to obtain given setting.</param>
|
||||
<returns>Setting value, or null if not found.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.GetServiceRuntimeSetting(System.String)">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.GetServiceRuntimeSetting(System.String)">
|
||||
<summary>
|
||||
Gets a configuration setting from the service runtime.
|
||||
</summary>
|
||||
<param name="name">Setting name.</param>
|
||||
<returns>Setting value or null if not found.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.AzureApplicationSettings.GetServiceRuntimeAssembly">
|
||||
<member name="M:Microsoft.Azure.AzureApplicationSettings.GetServiceRuntimeAssembly">
|
||||
<summary>
|
||||
Loads and returns the latest available version of the service
|
||||
runtime assembly.
|
||||
</summary>
|
||||
<returns>Loaded assembly, if any.</returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.WindowsAzure.NativeMethods.GetAssemblyPath(System.String)">
|
||||
<member name="M:Microsoft.Azure.NativeMethods.GetAssemblyPath(System.String)">
|
||||
<summary>
|
||||
Gets an assembly path from the GAC given a partial name.
|
||||
</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/windowsazure/System.IdentityModel.Tokens.Jwt.dll
Normal file
BIN
lib/windowsazure/System.IdentityModel.Tokens.Jwt.dll
Normal file
Binary file not shown.
2502
lib/windowsazure/System.IdentityModel.Tokens.Jwt.xml
Normal file
2502
lib/windowsazure/System.IdentityModel.Tokens.Jwt.xml
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
202
src/Gulpfile.js
Normal file
202
src/Gulpfile.js
Normal file
@@ -0,0 +1,202 @@
|
||||
var glob = require("glob"),
|
||||
path = require("path-posix"),
|
||||
merge = require("merge-stream"),
|
||||
gulpif = require("gulp-if"),
|
||||
gulp = require("gulp"),
|
||||
newer = require("gulp-newer"),
|
||||
plumber = require("gulp-plumber"),
|
||||
sourcemaps = require("gulp-sourcemaps"),
|
||||
less = require("gulp-less"),
|
||||
autoprefixer = require("gulp-autoprefixer"),
|
||||
minify = require("gulp-minify-css"),
|
||||
typescript = require("gulp-typescript"),
|
||||
uglify = require("gulp-uglify"),
|
||||
rename = require("gulp-rename"),
|
||||
concat = require("gulp-concat"),
|
||||
header = require("gulp-header"),
|
||||
fs = require("fs");
|
||||
|
||||
/*
|
||||
** GULP TASKS
|
||||
*/
|
||||
|
||||
// Incremental build (each asset group is built only if one or more inputs are newer than the output).
|
||||
gulp.task("build", function () {
|
||||
var assetGroupTasks = getAssetGroups().map(function (assetGroup) {
|
||||
var doRebuild = false;
|
||||
return createAssetGroupTask(assetGroup, doRebuild);
|
||||
});
|
||||
return merge(assetGroupTasks);
|
||||
});
|
||||
|
||||
// Full rebuild (all assets groups are built regardless of timestamps).
|
||||
gulp.task("rebuild", function () {
|
||||
var assetGroupTasks = getAssetGroups().map(function (assetGroup) {
|
||||
var doRebuild = true;
|
||||
return createAssetGroupTask(assetGroup, doRebuild);
|
||||
});
|
||||
return merge(assetGroupTasks);
|
||||
});
|
||||
|
||||
|
||||
// Set "Watchers" as sub-processes in order to restart the task when Assets.json changes.
|
||||
gulp.task("watch", function () {
|
||||
var watchers;
|
||||
function restart() {
|
||||
if (watchers) {
|
||||
watchers.forEach(function (w) {
|
||||
w.remove();
|
||||
w.end();
|
||||
});
|
||||
}
|
||||
watchers = [];
|
||||
// Continuous watch (each asset group is built whenever one of its inputs changes).
|
||||
getAssetGroups().forEach(function (assetGroup) {
|
||||
var watchPaths = assetGroup.inputPaths.concat(assetGroup.watchPaths);
|
||||
var watcher = gulp.watch(watchPaths, function (event) {
|
||||
var isConcat = path.basename(assetGroup.outputFileName, path.extname(assetGroup.outputFileName)) !== "@";
|
||||
if (isConcat)
|
||||
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding asset group with output '" + assetGroup.outputPath + "'.");
|
||||
else
|
||||
console.log("Asset file '" + event.path + "' was " + event.type + ", rebuilding asset group.");
|
||||
var doRebuild = true;
|
||||
var task = createAssetGroupTask(assetGroup, doRebuild);
|
||||
});
|
||||
watchers.push(watcher);
|
||||
});
|
||||
}
|
||||
var p;
|
||||
if (p) { p.exit(); }
|
||||
p = gulp.watch("Orchard.Web/{Core,Modules,Themes}/*/Assets.json", function (event) {
|
||||
console.log("Asset file '" + event.path + "' was " + event.type + ", resetting asset watchers.");
|
||||
restart();
|
||||
});
|
||||
restart();
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
** ASSET GROUPS
|
||||
*/
|
||||
function getAssetGroups() {
|
||||
var assetManifestPaths = glob.sync("Orchard.Web/{Core,Modules,Themes}/*/Assets.json", {});
|
||||
var assetGroups = [];
|
||||
assetManifestPaths.forEach(function (assetManifestPath) {
|
||||
var file = './' + assetManifestPath;
|
||||
var json = fs.readFileSync(file, 'utf8');
|
||||
assetManifest = eval(json);
|
||||
assetManifest.forEach(function (assetGroup) {
|
||||
resolveAssetGroupPaths(assetGroup, assetManifestPath);
|
||||
assetGroups.push(assetGroup);
|
||||
});
|
||||
});
|
||||
return assetGroups;
|
||||
}
|
||||
|
||||
function resolveAssetGroupPaths(assetGroup, assetManifestPath) {
|
||||
assetGroup.basePath = path.dirname(assetManifestPath);
|
||||
assetGroup.inputPaths = assetGroup.inputs.map(function (inputPath) {
|
||||
return path.resolve(path.join(assetGroup.basePath, inputPath));
|
||||
});
|
||||
assetGroup.watchPaths = [];
|
||||
if (!!assetGroup.watch) {
|
||||
assetGroup.watchPaths = assetGroup.watch.map(function (watchPath) {
|
||||
return path.resolve(path.join(assetGroup.basePath, watchPath));
|
||||
});
|
||||
}
|
||||
assetGroup.outputPath = path.resolve(path.join(assetGroup.basePath, assetGroup.output));
|
||||
assetGroup.outputDir = path.dirname(assetGroup.outputPath);
|
||||
assetGroup.outputFileName = path.basename(assetGroup.output);
|
||||
}
|
||||
|
||||
function createAssetGroupTask(assetGroup, doRebuild) {
|
||||
var outputExt = path.extname(assetGroup.output).toLowerCase();
|
||||
switch (outputExt) {
|
||||
case ".css":
|
||||
return buildCssPipeline(assetGroup, doRebuild);
|
||||
case ".js":
|
||||
return buildJsPipeline(assetGroup, doRebuild);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** PROCESSING PIPELINES
|
||||
*/
|
||||
|
||||
function buildCssPipeline(assetGroup, doRebuild) {
|
||||
assetGroup.inputPaths.forEach(function (inputPath) {
|
||||
var ext = path.extname(inputPath).toLowerCase();
|
||||
if (ext !== ".less" && ext !== ".css")
|
||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||
});
|
||||
var doConcat = path.basename(assetGroup.outputFileName, ".css") !== "@";
|
||||
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||
return gulp.src(assetGroup.inputPaths)
|
||||
.pipe(gulpif(!doRebuild,
|
||||
gulpif(doConcat,
|
||||
newer(assetGroup.outputPath),
|
||||
newer({
|
||||
dest: assetGroup.outputDir,
|
||||
ext: ".css"
|
||||
}))))
|
||||
.pipe(plumber())
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||
.pipe(gulpif("*.less", less()))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
//.pipe(header(
|
||||
// "/*\n" +
|
||||
// "** NOTE: This file is generated by Gulp compilation and should not be edited directly!\n" +
|
||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\n" +
|
||||
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||
// "*/\n\n"))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(minify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
|
||||
function buildJsPipeline(assetGroup, doRebuild) {
|
||||
assetGroup.inputPaths.forEach(function (inputPath) {
|
||||
var ext = path.extname(inputPath).toLowerCase();
|
||||
if (ext !== ".ts" && ext !== ".js")
|
||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||
});
|
||||
var doConcat = path.basename(assetGroup.outputFileName, ".js") !== "@";
|
||||
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||
return gulp.src(assetGroup.inputPaths)
|
||||
.pipe(gulpif(!doRebuild,
|
||||
gulpif(doConcat,
|
||||
newer(assetGroup.outputPath),
|
||||
newer({
|
||||
dest: assetGroup.outputDir,
|
||||
ext: ".js"
|
||||
}))))
|
||||
.pipe(plumber())
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||
.pipe(gulpif("*.ts", typescript({
|
||||
declaration: false,
|
||||
//noImplicitAny: true,
|
||||
noEmitOnError: true,
|
||||
sortOutput: true,
|
||||
}).js))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
//.pipe(header(
|
||||
// "/*\n" +
|
||||
// "** NOTE: This file is generated by Gulp compilation and should not be edited directly!\n" +
|
||||
// "** Any changes made directly to this file will be overwritten next time the Gulp compilation runs.\n" +
|
||||
// "** For more information, see the Readme.txt file in the Gulp solution folder.\n" +
|
||||
// "*/\n\n"))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(uglify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F1467A6B-2397-447B-BE90-766D192EC3D9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IDeliverable.Licensing.Orchard</RootNamespace>
|
||||
<AssemblyName>IDeliverable.Licensing.Orchard</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\autofac\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\aspnetwebapi\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ILicensedProductManifest.cs" />
|
||||
<Compile Include="LicenseValidationControllerBase.cs" />
|
||||
<Compile Include="LicenseValidationErrorBannerBase.cs" />
|
||||
<Compile Include="LicenseValidationHelper.cs" />
|
||||
<Compile Include="LicenseVerificationTokenStore.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="LicenseSettingsPartHandlerBase.cs" />
|
||||
<Compile Include="LicenseSettingsPartBase.cs" />
|
||||
<Compile Include="LicenseSettingsPartDriverBase.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IDeliverable.Licensing\IDeliverable.Licensing.csproj">
|
||||
<Project>{7e439cb7-1ace-435f-a8f3-5bb929423e34}</Project>
|
||||
<Name>IDeliverable.Licensing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2d1d92bb-4555-4cbe-8d0e-63563d6ce4c6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,15 +0,0 @@
|
||||
using Orchard;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public interface ILicensedProductManifest : IDependency
|
||||
{
|
||||
string ProductId { get; }
|
||||
string ProductName { get; }
|
||||
string ExtensionId { get; }
|
||||
bool SkipValidationForLocalRequests { get; }
|
||||
string LicenseKey { get; }
|
||||
ILogger Logger { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Utilities;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public abstract class LicenseSettingsPartBase : ContentPart
|
||||
{
|
||||
public readonly LazyField<string> mProductVersionField = new LazyField<string>();
|
||||
public abstract string ProductId { get; }
|
||||
|
||||
public string LicenseKey
|
||||
{
|
||||
get { return this.Retrieve(x => x.LicenseKey); }
|
||||
set { this.Store(x => x.LicenseKey, value); }
|
||||
}
|
||||
|
||||
public string ProductVersion => mProductVersionField.Value;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Environment.Extensions;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public abstract class LicenseSettingsPartDriverBase<TPart> : ContentPartDriver<TPart> where TPart : LicenseSettingsPartBase, new()
|
||||
{
|
||||
protected abstract string EditorShapeName { get; }
|
||||
protected abstract string EditorShapeTemplateName { get; }
|
||||
|
||||
protected override DriverResult Editor(TPart part, dynamic shapeHelper)
|
||||
{
|
||||
return Editor(part, null, shapeHelper);
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(TPart part, IUpdateModel updater, dynamic shapeHelper)
|
||||
{
|
||||
return ContentShape(EditorShapeName, () =>
|
||||
{
|
||||
updater?.TryUpdateModel(part, Prefix, null, null);
|
||||
return shapeHelper.EditorTemplate(TemplateName: EditorShapeTemplateName, Prefix: Prefix, Model: part);
|
||||
}).OnGroup("Licenses");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public abstract class LicenseSettingsPartHandlerBase<TPart> : ContentHandler where TPart : LicenseSettingsPartBase, new()
|
||||
{
|
||||
protected LicenseSettingsPartHandlerBase(IEnumerable<ILicensedProductManifest> products, IExtensionManager extensionManager)
|
||||
{
|
||||
Filters.Add(new ActivatingFilter<TPart>("Site"));
|
||||
OnGetContentItemMetadata<TPart>((context, part) => context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Licenses"))));
|
||||
OnActivated<TPart>(SetupLazyFields);
|
||||
|
||||
mProducts = products;
|
||||
mExtensionManager = extensionManager;
|
||||
}
|
||||
|
||||
private readonly IEnumerable<ILicensedProductManifest> mProducts;
|
||||
private readonly IExtensionManager mExtensionManager;
|
||||
public Localizer T { get; set; } = NullLocalizer.Instance;
|
||||
|
||||
private void SetupLazyFields(ActivatedContentContext context, TPart part)
|
||||
{
|
||||
part.mProductVersionField.Loader(value =>
|
||||
{
|
||||
var productManifest = mProducts.Single(x => x.ProductId == part.ProductId);
|
||||
var extension = mExtensionManager.GetExtension(productManifest.ExtensionId);
|
||||
|
||||
return extension.Version;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public abstract class LicenseValidationControllerBase : Controller
|
||||
{
|
||||
protected LicenseValidationControllerBase(INotifier notifier)
|
||||
{
|
||||
Notifier = notifier;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
protected INotifier Notifier { get; }
|
||||
protected abstract string ProductId { get; }
|
||||
|
||||
public ActionResult VerifyLicenseKey()
|
||||
{
|
||||
LicenseValidationHelper.Instance.ClearLicenseValidationResult(ProductId);
|
||||
|
||||
if (LicenseValidationHelper.GetLicenseIsValid(ProductId))
|
||||
Notifier.Information(T("License key succesfully validated."));
|
||||
|
||||
var urlReferrer = Request.UrlReferrer?.ToString();
|
||||
return Redirect(Request.IsLocalUrl(urlReferrer) ? urlReferrer : "~/");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using IDeliverable.Licensing.Validation;
|
||||
using Orchard;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.UI.Admin.Notification;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public abstract class LicenseValidationErrorBannerBase : Component, INotificationProvider
|
||||
{
|
||||
protected LicenseValidationErrorBannerBase(IEnumerable<ILicensedProductManifest> products, UrlHelper urlHelper, string productId)
|
||||
{
|
||||
mProducts = products;
|
||||
mUrlHelper = urlHelper;
|
||||
mProductId = productId;
|
||||
}
|
||||
|
||||
private readonly IEnumerable<ILicensedProductManifest> mProducts;
|
||||
private readonly UrlHelper mUrlHelper;
|
||||
private readonly string mProductId;
|
||||
|
||||
public IEnumerable<NotifyEntry> GetNotifications()
|
||||
{
|
||||
var productManifest = mProducts.Single(x => x.ProductId == mProductId);
|
||||
var licenseSettingsUrl = mUrlHelper.Action("Index", "Admin", new { area = "Settings", groupInfoId = "Licenses" });
|
||||
var retryResultUrl = mUrlHelper.Action("VerifyLicenseKey", "LicenseValidation", new { area = productManifest.ProductName });
|
||||
var retryResultLink = T("<a href=\"{0}\">Try again</a>", retryResultUrl);
|
||||
LocalizedString message = null;
|
||||
|
||||
try
|
||||
{
|
||||
LicenseValidationHelper.EnsureLicenseIsValid(productManifest.ProductId);
|
||||
}
|
||||
catch (LicenseValidationException ex)
|
||||
{
|
||||
switch (ex.Error)
|
||||
{
|
||||
case LicenseValidationError.UnknownLicenseKey:
|
||||
message = T("The <a href=\"{0}\">configured license key</a> for the {1} module is invalid. {2}", licenseSettingsUrl, productManifest.ProductName, retryResultLink);
|
||||
break;
|
||||
case LicenseValidationError.HostnameMismatch:
|
||||
message = T("The <a href=\"{0}\">configured license key</a> for the {1} module is invalid for the current host name. {2}", licenseSettingsUrl, productManifest.ProductName, retryResultLink);
|
||||
break;
|
||||
case LicenseValidationError.NoActiveSubscription:
|
||||
message = T("The <a href=\"{0}\">configured license key</a> for the {1} module has no active subscription. {2}", licenseSettingsUrl, productManifest.ProductName, retryResultLink);
|
||||
break;
|
||||
case LicenseValidationError.LicenseRevoked:
|
||||
message = T("The <a href=\"{0}\">configured license key</a> for the {1} module has been revoked. {2}", licenseSettingsUrl, productManifest.ProductName, retryResultLink);
|
||||
break;
|
||||
case LicenseValidationError.TokenAgeValidationFailed:
|
||||
case LicenseValidationError.TokenSignatureValidationFailed:
|
||||
case LicenseValidationError.LicensingServiceError:
|
||||
case LicenseValidationError.LicensingServiceUnreachable:
|
||||
case LicenseValidationError.UnexpectedError:
|
||||
default:
|
||||
message = T("There was an error validating the <a href=\"{0}\">configured license key</a> for the {1} module. {2}", licenseSettingsUrl, productManifest.ProductName, retryResultLink);
|
||||
break;
|
||||
}
|
||||
|
||||
Logger.Warning(ex, "An error occurred while validating the configured license key for the {0} module. {1}", productManifest.ProductName, retryResultLink);
|
||||
}
|
||||
|
||||
if (message != null)
|
||||
yield return new NotifyEntry { Message = message, Type = NotifyType.Warning };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using IDeliverable.Licensing.Validation;
|
||||
using IDeliverable.Licensing.VerificationTokens;
|
||||
using Orchard;
|
||||
using Orchard.Logging;
|
||||
using Orchard.FileSystems.AppData;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
public class LicenseValidationHelper
|
||||
{
|
||||
public static bool GetLicenseIsValid(string productId)
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureLicenseIsValid(productId);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void EnsureLicenseIsValid(string productId)
|
||||
{
|
||||
Instance.ValidateLicense(productId);
|
||||
}
|
||||
|
||||
public static LicenseValidationHelper Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
var workContext = HttpContext.Current.Request.RequestContext.GetWorkContext();
|
||||
var products = workContext.Resolve<IEnumerable<ILicensedProductManifest>>();
|
||||
var appDataFolder = workContext.Resolve<IAppDataFolder>();
|
||||
var instance = new LicenseValidationHelper(products, appDataFolder);
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly TimeSpan _validationResultCachedFor = TimeSpan.FromMinutes(5);
|
||||
|
||||
public LicenseValidationHelper(IEnumerable<ILicensedProductManifest> products, IAppDataFolder appDataFolder)
|
||||
{
|
||||
var tokenStore = new LicenseVerificationTokenStore(appDataFolder);
|
||||
var tokenAccessor = new LicenseVerificationTokenAccessor(tokenStore);
|
||||
|
||||
mProducts = products;
|
||||
mLicenseValidator = new LicenseValidator(tokenAccessor);
|
||||
mCacheService = new CacheService();
|
||||
}
|
||||
|
||||
private readonly IEnumerable<ILicensedProductManifest> mProducts;
|
||||
private readonly LicenseValidator mLicenseValidator;
|
||||
private readonly CacheService mCacheService;
|
||||
|
||||
public void ValidateLicense(string productId)
|
||||
{
|
||||
var productManifest = GetLicensedProductManifest(productId);
|
||||
productManifest.Logger.Debug("Validating license for product '{0}'...", productId);
|
||||
|
||||
try
|
||||
{
|
||||
var cacheKey = ComputeCacheKey(productManifest);
|
||||
mCacheService.GetValue(cacheKey, context =>
|
||||
{
|
||||
context.ValidFor = _validationResultCachedFor;
|
||||
|
||||
var options = LicenseValidationOptions.Default;
|
||||
if (productManifest.SkipValidationForLocalRequests)
|
||||
options = options | LicenseValidationOptions.SkipForLocalRequests;
|
||||
|
||||
productManifest.Logger.Debug("Validation result not in cache. Invoking the license validator for product '{0}'...", productId);
|
||||
mLicenseValidator.ValidateLicense(productManifest.ProductId, productManifest.LicenseKey, options);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
productManifest.Logger.Debug("License successfully validated for product '{0}'.", productId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
productManifest.Logger.Error(ex, "An error occurred while validating the license for product '{0}'.", productId);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearLicenseValidationResult(string productId)
|
||||
{
|
||||
var productManifest = GetLicensedProductManifest(productId);
|
||||
productManifest.Logger.Debug("Clearing license validation result for product '{0}'...", productId);
|
||||
|
||||
var cacheKey = ComputeCacheKey(productManifest);
|
||||
mCacheService.RemoveValue(cacheKey);
|
||||
}
|
||||
|
||||
private ILicensedProductManifest GetLicensedProductManifest(string productId)
|
||||
{
|
||||
return mProducts.Single(x => x.ProductId == productId);
|
||||
}
|
||||
|
||||
private string ComputeCacheKey(ILicensedProductManifest productManifest)
|
||||
{
|
||||
return $"ValidateLicenseResult-{productManifest.ProductId}-{productManifest.LicenseKey}-{productManifest.SkipValidationForLocalRequests}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using IDeliverable.Licensing.VerificationTokens;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace IDeliverable.Licensing.Orchard
|
||||
{
|
||||
internal class LicenseVerificationTokenStore : ILicenseVerificationTokenStore
|
||||
{
|
||||
public LicenseVerificationTokenStore(IAppDataFolder appDataFolder)
|
||||
{
|
||||
mAppDataFolder = appDataFolder;
|
||||
}
|
||||
|
||||
private readonly IAppDataFolder mAppDataFolder;
|
||||
|
||||
public LicenseVerificationToken Load(string productId)
|
||||
{
|
||||
var path = GetRelativeTokenFilePath(productId);
|
||||
if (!mAppDataFolder.FileExists(path))
|
||||
return null;
|
||||
|
||||
LicenseVerificationToken token = null;
|
||||
var tokenBase64 = mAppDataFolder.ReadFile(path);
|
||||
|
||||
try
|
||||
{
|
||||
token = LicenseVerificationToken.FromBase64(tokenBase64);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// An exception while parsing the token indicates somebody probably
|
||||
// tampered with it or it got corrupted. In this case, let's clear out
|
||||
// the store and return nothing.
|
||||
Clear(productId);
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
public void Save(string productId, LicenseVerificationToken token)
|
||||
{
|
||||
Clear(productId);
|
||||
|
||||
var path = GetRelativeTokenFilePath(productId);
|
||||
|
||||
var tokenBase64 = token.ToBase64();
|
||||
mAppDataFolder.CreateFile(path, tokenBase64);
|
||||
}
|
||||
|
||||
public void Clear(string productId)
|
||||
{
|
||||
var path = GetRelativeTokenFilePath(productId);
|
||||
if (mAppDataFolder.FileExists(path))
|
||||
mAppDataFolder.DeleteFile(path);
|
||||
}
|
||||
|
||||
private string GetRelativeTokenFilePath(string productId)
|
||||
{
|
||||
return $"IDeliverable.Licensing/{productId}.lic";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("IDeliverable.Licensing.Orchard.Orchard")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("IDeliverable.Licensing.Orchard.Orchard")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f1467a6b-2397-447b-be90-766d192ec3d9")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Filters;
|
||||
|
||||
namespace IDeliverable.Licensing.Service
|
||||
{
|
||||
internal class ApiKeyAuthorizationAttribute : AuthorizationFilterAttribute
|
||||
{
|
||||
public override void OnAuthorization(HttpActionContext actionContext)
|
||||
{
|
||||
var values = new List<string>();
|
||||
|
||||
var paramsQuery =
|
||||
from param in actionContext.Request.GetQueryNameValuePairs()
|
||||
where String.Equals(param.Key, "ApiKey", StringComparison.OrdinalIgnoreCase)
|
||||
select param.Value;
|
||||
values.AddRange(paramsQuery.ToArray());
|
||||
|
||||
IEnumerable<string> headers;
|
||||
actionContext.Request.Headers.TryGetValues("ApiKey", out headers);
|
||||
if (headers != null)
|
||||
values.AddRange(headers);
|
||||
|
||||
string apiKey = values != null ? values.FirstOrDefault() : null;
|
||||
|
||||
if (String.IsNullOrWhiteSpace(apiKey))
|
||||
actionContext.Response = actionContext.ControllerContext.Request.CreateResponse(HttpStatusCode.Unauthorized);
|
||||
|
||||
var expectedApiKey = ConfigurationManager.AppSettings["ApiKey"];
|
||||
|
||||
if (apiKey != expectedApiKey)
|
||||
actionContext.Response = actionContext.ControllerContext.Request.CreateResponse(HttpStatusCode.Unauthorized);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Web.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IDeliverable.Licensing.Service
|
||||
{
|
||||
internal static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
ConfigSerializationSettings(config);
|
||||
|
||||
config.MapHttpAttributeRoutes();
|
||||
config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
|
||||
}
|
||||
|
||||
private static void ConfigSerializationSettings(HttpConfiguration config)
|
||||
{
|
||||
var jsonSetting = new JsonSerializerSettings();
|
||||
jsonSetting.Converters.Add(new StringEnumConverter());
|
||||
config.Formatters.JsonFormatter.SerializerSettings = jsonSetting;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
<!--
|
||||
Learn more about Application Insights configuration with ApplicationInsights.config here:
|
||||
http://go.microsoft.com/fwlink/?LinkID=513840
|
||||
-->
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCollector">
|
||||
<!--
|
||||
Use the following syntax here to collect additional performance counters:
|
||||
|
||||
<Counters>
|
||||
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
|
||||
...
|
||||
</Counters>
|
||||
|
||||
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
|
||||
|
||||
Counter names may only contain letters, round brackets, forward slashes, hyphens, underscores, spaces and dots.
|
||||
You may provide an optional ReportAs attribute which will be used as the metric name when reporting counter data.
|
||||
For the purposes of reporting, metric names will be sanitized by removing all invalid characters from the resulting metric name.
|
||||
|
||||
The following placeholders are supported as InstanceName:
|
||||
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
|
||||
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
|
||||
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
|
||||
-->
|
||||
</Add>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.RemoteDependencyModule, Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryModules.WebApplicationLifecycleModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryModules.WebSessionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryModules.WebUserTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
</TelemetryModules>
|
||||
<TelemetryChannel Type="Microsoft.ApplicationInsights.Channel.PersistenceChannel, Microsoft.ApplicationInsights.PersistenceChannel" />
|
||||
<ContextInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.BuildInfoConfigComponentVersionContextInitializer, Microsoft.ApplicationInsights" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.ContextInitializers.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.ContextInitializers.DomainNameRoleInstanceContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
</ContextInitializers>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebSyntheticTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebClientIpHeaderTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebUserAgentTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebUserTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebSessionTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
</TelemetryInitializers>
|
||||
</ApplicationInsights>
|
||||
@@ -1,89 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using IDeliverable.Licensing.Exceptions;
|
||||
using IDeliverable.Licensing.Service.Services;
|
||||
using IDeliverable.Licensing.VerificationTokens;
|
||||
|
||||
namespace IDeliverable.Licensing.Service.Controllers
|
||||
{
|
||||
[RoutePrefix("api/v1")]
|
||||
public class LicenseController : ApiController
|
||||
{
|
||||
[HttpGet]
|
||||
[Route("license/{licenseKey}/verify")]
|
||||
[ApiKeyAuthorization]
|
||||
public LicenseVerificationToken Verify(string licenseKey, string productId, string hostname)
|
||||
{
|
||||
var service = GetLicenseService();
|
||||
|
||||
try
|
||||
{
|
||||
return service.VerifyLicense(licenseKey, productId, hostname, throwOnError: false);
|
||||
}
|
||||
catch (LicenseVerificationException ex)
|
||||
{
|
||||
switch (ex.Error)
|
||||
{
|
||||
case LicenseVerificationError.UnknownLicenseKey:
|
||||
ThrowHttpResponseException(ex, HttpStatusCode.NotFound);
|
||||
break;
|
||||
|
||||
case LicenseVerificationError.HostnameMismatch:
|
||||
ThrowHttpResponseException(ex, HttpStatusCode.Forbidden);
|
||||
break;
|
||||
|
||||
case LicenseVerificationError.NoActiveSubscription:
|
||||
case LicenseVerificationError.LicenseRevoked:
|
||||
ThrowHttpResponseException(ex, HttpStatusCode.Gone);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("test")]
|
||||
[ApiKeyAuthorization]
|
||||
public HttpResponseMessage Test()
|
||||
{
|
||||
var testKey = ConfigurationManager.AppSettings["TestKey"];
|
||||
var testProductId = ConfigurationManager.AppSettings["TestProductId"];
|
||||
var testHostname = ConfigurationManager.AppSettings["TestHostname"];
|
||||
var service = GetLicenseService();
|
||||
|
||||
try
|
||||
{
|
||||
service.VerifyLicense(testKey, testProductId, testHostname, throwOnError: true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new HttpResponseMessage(HttpStatusCode.InternalServerError) { ReasonPhrase = $"Verification for a supposedly valid license failed: {ex.Message}." };
|
||||
}
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
private static LicenseService GetLicenseService()
|
||||
{
|
||||
var sendOwlApiEndpoint = ConfigurationManager.AppSettings["SendOwlApiEndpoint"];
|
||||
var sendOwlApiKey = ConfigurationManager.AppSettings["SendOwlApiKey"];
|
||||
var sendOwlApiSecret = ConfigurationManager.AppSettings["SendOwlApiSecret"];
|
||||
var tokenSigningCertificateThumbprint = ConfigurationManager.AppSettings["TokenSigningCertificateThumbprint"];
|
||||
|
||||
return new LicenseService(sendOwlApiEndpoint, sendOwlApiKey, sendOwlApiSecret, tokenSigningCertificateThumbprint);
|
||||
}
|
||||
|
||||
private static void ThrowHttpResponseException(LicenseVerificationException ex, HttpStatusCode httpStatusCode)
|
||||
{
|
||||
var response = new HttpResponseMessage(httpStatusCode) { ReasonPhrase = ex.Message };
|
||||
response.Headers.Add("LicensingErrorCode", ex.Error.ToString());
|
||||
throw new HttpResponseException(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<%@ Application Codebehind="Global.asax.cs" Inherits="IDeliverable.Licensing.Service.WebApiApplication" Language="C#" %>
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Web.Http;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
|
||||
namespace IDeliverable.Licensing.Service
|
||||
{
|
||||
public class WebApiApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
{
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
|
||||
// Configure ApplicationInsights instrumentation key.
|
||||
var instrumentationKey = ConfigurationManager.AppSettings["ApplicationInsights.InstrumentationKey"];
|
||||
if (!String.IsNullOrWhiteSpace(instrumentationKey))
|
||||
TelemetryConfiguration.Active.InstrumentationKey = instrumentationKey;
|
||||
else
|
||||
TelemetryConfiguration.Active.DisableTelemetry = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{6014E7AC-C979-4D50-B8D9-5FD9DC8CA641}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IDeliverable.Licensing.Service</RootNamespace>
|
||||
<AssemblyName>IDeliverable.Licensing.Service</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile>true</UseGlobalApplicationHostFile>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<ApplicationInsightsResourceId>/subscriptions/1788357e-d506-4118-9f88-092c1dcddc16/resourcegroups/Internal/providers/microsoft.insights/components/ideliverable-licensing</ApplicationInsightsResourceId>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="LogentriesCore, Version=2.6.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\logentries.core.2.7.0\lib\net40\LogentriesCore.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="LogentriesLog4net, Version=2.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\logentries.log4net.2.7.0\lib\net40\LogentriesLog4net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=0.14.3.177, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.0.14.3-build00177\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.Extensibility.PerfCollector, Version=0.14.3.185, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.PerformanceCollector.0.14.3-build00177\lib\net40\Microsoft.ApplicationInsights.Extensibility.PerfCollector.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry, Version=0.14.3.177, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.RuntimeTelemetry.0.14.3-build00177\lib\net45\Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.Extensibility.Web, Version=0.14.3.177, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.Web.0.14.3-build00177\lib\net45\Microsoft.ApplicationInsights.Extensibility.Web.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.PersistenceChannel, Version=0.14.3.186, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.PersistenceChannel.0.14.3-build00177\lib\net40\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Diagnostics.Instrumentation.Extensions.Intercept, Version=0.14.0.8007, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.ApplicationInsights.Agent.Intercept.0.14.0-build08008\lib\net40\Microsoft.Diagnostics.Instrumentation.Extensions.Intercept.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\lib\net45\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure">
|
||||
<HintPath>..\..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Web.Helpers">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor">
|
||||
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Net.Http">
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="ApiKeyAuthorizationAttribute.cs" />
|
||||
<Compile Include="Controllers\LicenseController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\LicenseInfo.cs" />
|
||||
<Compile Include="Services\LicenseService.cs" />
|
||||
<Compile Include="Services\Logger.cs" />
|
||||
<Compile Include="Services\OrderInfo.cs" />
|
||||
<Compile Include="Services\OrderStatus.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="packages.config" />
|
||||
<Content Include="ApplicationInsights.config" />
|
||||
<Content Include="Log4net.config" />
|
||||
<None Include="Properties\PublishProfiles\ideliverable-licensing.pubxml" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IDeliverable.Licensing\IDeliverable.Licensing.csproj">
|
||||
<Project>{7e439cb7-1ace-435f-a8f3-5bb929423e34}</Project>
|
||||
<Name>IDeliverable.Licensing</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>56979</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:56979/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
|
||||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
|
||||
<Error Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets" Condition="Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.ApplicationInsights.Agent.Intercept.0.14.0-build08008\build\Microsoft.ApplicationInsights.Agent.Intercept.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.ApplicationInsights.Agent.Intercept.0.14.0-build08008\build\Microsoft.ApplicationInsights.Agent.Intercept.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Microsoft.ApplicationInsights.0.14.3-build00177\tools\net40\Microsoft.ApplicationInsights.targets" Condition="Exists('..\..\packages\Microsoft.ApplicationInsights.0.14.3-build00177\tools\net40\Microsoft.ApplicationInsights.targets')" />
|
||||
<Target Name="EnsureApplicationInsightsImported" BeforeTargets="BeforeBuild" Condition="'$(ApplicationInsightsImported)' == ''">
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.ApplicationInsights.0.14.3-build00177\tools\net40\Microsoft.ApplicationInsights.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." />
|
||||
<Error Condition="Exists('..\..\packages\Microsoft.ApplicationInsights.0.14.3-build00177\tools\net40\Microsoft.ApplicationInsights.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Microsoft.ApplicationInsights.Agent.Intercept.0.14.0-build08008\build\Microsoft.ApplicationInsights.Agent.Intercept.targets" Condition="Exists('..\..\packages\Microsoft.ApplicationInsights.Agent.Intercept.0.14.0-build08008\build\Microsoft.ApplicationInsights.Agent.Intercept.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target> -->
|
||||
</Project>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<log4net>
|
||||
|
||||
<root>
|
||||
<!-- Value of level may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF -->
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="DebuggerAppender" />
|
||||
<appender-ref ref="LeAppender" />
|
||||
</root>
|
||||
|
||||
<appender name="LeAppender" type="log4net.Appender.LogentriesAppender, LogentriesLog4net">
|
||||
<!-- Credentials are read from appSettings. -->
|
||||
<immediateFlush value="true" />
|
||||
<debug value="true" />
|
||||
<useHttpPut value="false" />
|
||||
<useSsl value="false" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- The below pattern has been carefully formatted and optimized to work well with the Logentries.com entry parser. For reference see https://logentries.com/doc/search/. -->
|
||||
<param name="ConversionPattern" value="%d %logger %level% %m%n%exceptionSessionId='%aspnet-request{ASP.NET_SessionId}'; Username='%aspnet-request{AUTH_USER}'; ClientIpAddress='%aspnet-request{REMOTE_ADDR}'; ClientUserAgent='%aspnet-request{HTTP_USER_AGENT}'; ServerName='%aspnet-request{SERVER_NAME}'; RequestMethod='%aspnet-request{REQUEST_METHOD}'; RequestUrl='%aspnet-request{URL}'; RequestQueryString='%aspnet-request{QUERY_STRING}'; RequestCookies='%aspnet-request{HTTP_COOKIE}'; MachineName='%property{log4net:HostName}';%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="DebuggerAppender" type="log4net.Appender.DebugAppender">
|
||||
<immediateFlush value="true" />
|
||||
<layout type="log4net.Layout.SimpleLayout" />
|
||||
</appender>
|
||||
|
||||
</log4net>
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("IDeliverable.Licensing.Service")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("IDeliverable.Licensing.Service")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c2a67b6c-4615-4ecf-bfc6-39bf0f975c1f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
|
||||
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>http://ideliverable-licensing.azurewebsites.net</SiteUrlToLaunchAfterPublish>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<MSDeployServiceURL>ideliverable-licensing.scm.azurewebsites.net:443</MSDeployServiceURL>
|
||||
<DeployIisAppPath>ideliverable-licensing</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||
<UserName>$ideliverable-licensing</UserName>
|
||||
<_SavePWD>True</_SavePWD>
|
||||
<_DestinationType>AzureWebSite</_DestinationType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace IDeliverable.Licensing.Service.Services
|
||||
{
|
||||
internal class LicenseInfo
|
||||
{
|
||||
public LicenseInfo(string key, int orderId)
|
||||
{
|
||||
Key = key;
|
||||
OrderId = orderId;
|
||||
}
|
||||
|
||||
public string Key { get; }
|
||||
public int OrderId { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using IDeliverable.Licensing.Exceptions;
|
||||
using IDeliverable.Licensing.VerificationTokens;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace IDeliverable.Licensing.Service.Services
|
||||
{
|
||||
internal class LicenseService
|
||||
{
|
||||
public LicenseService(string sendOwlApiEndpoint, string sendOwlApiKey, string sendOwlApiSecret, string tokenSigningCertificateThumbprint)
|
||||
{
|
||||
mSendOwlApiEndpoint = sendOwlApiEndpoint;
|
||||
mSendOwlApiKey = sendOwlApiKey;
|
||||
mSendOwlApiSecret = sendOwlApiSecret;
|
||||
mTokenSigningCertificateThumbprint = tokenSigningCertificateThumbprint;
|
||||
mLogger = new Logger(nameof(LicenseService));
|
||||
}
|
||||
|
||||
private readonly string mSendOwlApiEndpoint;
|
||||
private readonly string mSendOwlApiKey;
|
||||
private readonly string mSendOwlApiSecret;
|
||||
private readonly string mTokenSigningCertificateThumbprint;
|
||||
private readonly Logger mLogger;
|
||||
|
||||
public LicenseVerificationToken VerifyLicense(string licenseKey, string productId, string hostname, bool throwOnError)
|
||||
{
|
||||
mLogger.Info($"Starting license verification... LicenseKey={licenseKey}; ProductId={productId}; Hostname={hostname};");
|
||||
|
||||
try
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.BaseAddress = new Uri(mSendOwlApiEndpoint);
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", CreateBasicAuthenticationToken(mSendOwlApiKey, mSendOwlApiSecret));
|
||||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||
|
||||
var licenses = ParseLicenseInfo(client.GetAsync($"products/{productId}/licenses/check_valid?key={licenseKey}").Result.Content.ReadAsStringAsync().Result).ToList();
|
||||
|
||||
if (!licenses.Any())
|
||||
throw new LicenseVerificationException($"No license with key '{licenseKey}' was found.", LicenseVerificationError.UnknownLicenseKey);
|
||||
|
||||
var orderId = licenses.First(x => x.Key == licenseKey).OrderId;
|
||||
var order = ParseOrderInfo(client.GetAsync($"orders/{orderId}").Result.Content.ReadAsStringAsync().Result);
|
||||
|
||||
if (!order.IsProductAccessAllowed)
|
||||
{
|
||||
if(order.SubscriptionId != null)
|
||||
throw new LicenseVerificationException($"The license with key '{licenseKey}' is not associated with an active subscription.", LicenseVerificationError.NoActiveSubscription);
|
||||
|
||||
throw new LicenseVerificationException($"The license with key '{licenseKey}' has been revoked.", LicenseVerificationError.LicenseRevoked);
|
||||
}
|
||||
|
||||
if (!order.Hostnames.Contains(hostname, StringComparer.OrdinalIgnoreCase))
|
||||
throw new LicenseVerificationException($"The license with key '{licenseKey}' is not valid for the provided '{hostname}'. Valid hostnames are '{String.Join(",", order.Hostnames)}", LicenseVerificationError.HostnameMismatch);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (!(ex is LicenseVerificationException))
|
||||
{
|
||||
mLogger.Error($"An error occurred while verifying license with SendOwl. LicenseKey={licenseKey}; ProductId={productId}; Hostname={hostname};", ex);
|
||||
|
||||
if (throwOnError)
|
||||
throw;
|
||||
|
||||
mLogger.Info("Ignoring error and issuing verification token anyway. LicenseKey={licenseKey}; ProductId={productId}; Hostname={hostname};");
|
||||
}
|
||||
|
||||
mLogger.Info($"License verification finished. LicenseKey={licenseKey}; ProductId={productId}; Hostname={hostname};");
|
||||
|
||||
return CreateVerificationToken(productId, hostname, licenseKey);
|
||||
}
|
||||
|
||||
private LicenseVerificationToken CreateVerificationToken(string productId, string hostname, string key)
|
||||
{
|
||||
X509Certificate2 signingCert = null;
|
||||
|
||||
// Try to find the certificate in either the CurrentUser or LocalMachine stores
|
||||
// to maximize code portability.
|
||||
signingCert = GetSigningCertificateFrom(StoreLocation.CurrentUser) ?? GetSigningCertificateFrom(StoreLocation.LocalMachine);
|
||||
if (signingCert == null)
|
||||
throw new Exception($"No certificate with thumbprint '{mTokenSigningCertificateThumbprint}' was found in the certificate store.");
|
||||
|
||||
var info = new LicenseVerificationInfo(productId, hostname, key, DateTime.UtcNow.Ticks);
|
||||
var token = LicenseVerificationToken.Create(info, signingCert);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
private X509Certificate2 GetSigningCertificateFrom(StoreLocation location)
|
||||
{
|
||||
var store = new X509Store(StoreName.My, location);
|
||||
store.Open(OpenFlags.ReadOnly);
|
||||
|
||||
try
|
||||
{
|
||||
var certificates = store.Certificates.Find(X509FindType.FindByThumbprint, mTokenSigningCertificateThumbprint, validOnly: false);
|
||||
return certificates.Count > 0 ? certificates[0] : null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
store.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private string CreateBasicAuthenticationToken(string userName, string password)
|
||||
{
|
||||
return Convert.ToBase64String(Encoding.UTF8.GetBytes($"{userName}:{password}"), Base64FormattingOptions.None);
|
||||
}
|
||||
|
||||
private IEnumerable<LicenseInfo> ParseLicenseInfo(string json)
|
||||
{
|
||||
var licensesQuery =
|
||||
from node in JArray.Parse(json)
|
||||
select new LicenseInfo((string)node["license"]["key"], (int)node["license"]["order_id"]);
|
||||
|
||||
return licensesQuery.ToArray();
|
||||
}
|
||||
|
||||
private OrderInfo ParseOrderInfo(string json)
|
||||
{
|
||||
var order = JObject.Parse(json)["order"];
|
||||
var status = ReadOrderStatus(order);
|
||||
var isAccessAllowed = (bool) order["access_allowed"];
|
||||
var subscriptionId = (int?) order["subscription_id"];
|
||||
var customFields = (JArray)order["order_custom_checkout_fields"];
|
||||
var hostnames = new List<string>();
|
||||
|
||||
if (customFields.Count > 0)
|
||||
{
|
||||
var hostnameString = (string)customFields[0]["order_custom_checkout_field"]["value"];
|
||||
if (!String.IsNullOrWhiteSpace(hostnameString))
|
||||
hostnames.Add(ParseHostname(hostnameString));
|
||||
}
|
||||
|
||||
if (customFields.Count > 1)
|
||||
{
|
||||
var hostnameString = (string)customFields[1]["order_custom_checkout_field"]["value"];
|
||||
if (!String.IsNullOrWhiteSpace(hostnameString))
|
||||
hostnames.Add(ParseHostname(hostnameString));
|
||||
}
|
||||
|
||||
return new OrderInfo((int)order["id"], status, isAccessAllowed, subscriptionId, hostnames);
|
||||
}
|
||||
|
||||
private string ParseHostname(string hostnameString)
|
||||
{
|
||||
Uri uri = null;
|
||||
|
||||
if (Uri.TryCreate(hostnameString, UriKind.Absolute, out uri))
|
||||
return uri.Host;
|
||||
|
||||
return hostnameString;
|
||||
}
|
||||
|
||||
private static OrderStatus ReadOrderStatus(JToken order)
|
||||
{
|
||||
var dictionary = new Dictionary<string, OrderStatus>
|
||||
{
|
||||
{"initial", OrderStatus.Initial },
|
||||
{"payment_started", OrderStatus.PaymentStarted },
|
||||
{"payment_pending", OrderStatus.PaymentPending },
|
||||
{"failed", OrderStatus.Failed },
|
||||
{"complete", OrderStatus.Complete },
|
||||
{"chargeback", OrderStatus.Chargeback },
|
||||
{"refunded", OrderStatus.Refunded },
|
||||
{"in_dispute", OrderStatus.InDispute },
|
||||
{"free", OrderStatus.Free },
|
||||
{"imported", OrderStatus.Imported },
|
||||
{"fraud_review", OrderStatus.FraudReview },
|
||||
{"subscription_setup", OrderStatus.SubscriptionSetup },
|
||||
{"subscription_active", OrderStatus.SubscriptionActive },
|
||||
{"subscription_complete", OrderStatus.SubscriptionComplete },
|
||||
{"subscription_cancelled", OrderStatus.SubscriptionCancelled }
|
||||
};
|
||||
var status = (string) order["state"];
|
||||
|
||||
return dictionary.ContainsKey(status) ? dictionary[status] : OrderStatus.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
|
||||
namespace IDeliverable.Licensing.Service.Services
|
||||
{
|
||||
public class Logger
|
||||
{
|
||||
private const string ConfigFileName = "Log4net.config";
|
||||
|
||||
static Logger()
|
||||
{
|
||||
var basePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var configFilePath = Path.Combine(basePath, ConfigFileName);
|
||||
if (File.Exists(configFilePath))
|
||||
XmlConfigurator.Configure(new FileInfo(configFilePath));
|
||||
else
|
||||
throw new Exception($"The log4net configuration file could not be found at path '{configFilePath}'.");
|
||||
}
|
||||
|
||||
public Logger(Type loggerType)
|
||||
:this(loggerType.FullName)
|
||||
{
|
||||
}
|
||||
|
||||
public Logger(string loggerName)
|
||||
{
|
||||
mLog = LogManager.GetLogger(loggerName);
|
||||
}
|
||||
|
||||
private ILog mLog;
|
||||
|
||||
public void Fatal(string message, Exception ex = null)
|
||||
{
|
||||
if (mLog.IsFatalEnabled)
|
||||
mLog.Fatal(message, ex);
|
||||
}
|
||||
|
||||
public void Error(string message, Exception ex = null)
|
||||
{
|
||||
if (mLog.IsErrorEnabled)
|
||||
mLog.Error(message, ex);
|
||||
}
|
||||
|
||||
public void Warn(string message, Exception ex = null)
|
||||
{
|
||||
if (mLog.IsWarnEnabled)
|
||||
mLog.Warn(message, ex);
|
||||
}
|
||||
|
||||
public void Info(string message, Exception ex = null)
|
||||
{
|
||||
if (mLog.IsInfoEnabled)
|
||||
mLog.Info(message, ex);
|
||||
}
|
||||
|
||||
public void Debug(string message, Exception ex = null)
|
||||
{
|
||||
if (mLog.IsDebugEnabled)
|
||||
mLog.Debug(message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IDeliverable.Licensing.Service.Services
|
||||
{
|
||||
internal class OrderInfo
|
||||
{
|
||||
public OrderInfo(int orderId, OrderStatus status, bool isProductAccessAllowed, int? subscriptionId, IEnumerable<string> hostnames)
|
||||
{
|
||||
OrderId = orderId;
|
||||
Hostnames = hostnames;
|
||||
Status = status;
|
||||
IsProductAccessAllowed = isProductAccessAllowed;
|
||||
SubscriptionId = subscriptionId;
|
||||
}
|
||||
|
||||
public int OrderId { get; }
|
||||
public IEnumerable<string> Hostnames { get; }
|
||||
public OrderStatus Status { get; }
|
||||
public bool IsProductAccessAllowed { get; }
|
||||
public int? SubscriptionId { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
namespace IDeliverable.Licensing.Service.Services {
|
||||
internal enum OrderStatus
|
||||
{
|
||||
Unknown,
|
||||
Initial,
|
||||
PaymentStarted,
|
||||
PaymentPending,
|
||||
Failed,
|
||||
Complete,
|
||||
Chargeback,
|
||||
Refunded,
|
||||
InDispute,
|
||||
Free,
|
||||
Imported,
|
||||
FraudReview,
|
||||
SubscriptionSetup,
|
||||
SubscriptionActive,
|
||||
SubscriptionComplete,
|
||||
SubscriptionCancelled,
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your Web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your Web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
|
||||
<appSettings>
|
||||
<add key="ApiKey" value="MJb17j7YAzSjyEYkhsoI" />
|
||||
<add key="TestProductId" value="233554" />
|
||||
<add key="TestHostname" value="ideliverable.com" />
|
||||
<add key="TestKey" value="ADB5-2D53-0A62-4C2F" />
|
||||
<add key="SendOwlApiEndpoint" value="https://www.sendowl.com/api/v1/" />
|
||||
<add key="SendOwlApiKey" value="14be9ee5e05222e" />
|
||||
<add key="SendOwlApiSecret" value="1a10fe7987724e0a56a1" />
|
||||
<add key="TokenSigningCertificateThumbprint" value="fa4746a778716109e7e80e1b8dc2ed2a2ba3b852" />
|
||||
<add key="Logentries.Token" value="5c73ab7f-39a3-4171-b730-03da5c3d4b24"/> <!-- Local -->
|
||||
<add key="ApplicationInsights.InstrumentationKey" value="" /> <!-- Disabled -->
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.2" />
|
||||
<httpRuntime targetFramework="4.5.2" />
|
||||
<httpModules>
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" />
|
||||
</httpModules>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<remove name="ApplicationInsightsWebTracking" />
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
|
||||
</modules>
|
||||
</system.webServer>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
</configuration>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="logentries.core" version="2.7.0" targetFramework="net452" userInstalled="true" />
|
||||
<package id="logentries.log4net" version="2.7.0" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights" version="0.14.3-build00177" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="0.14.0-build08008" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.JavaScript" version="0.11.0-build09387" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.PerformanceCollector" version="0.14.3-build00177" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.PersistenceChannel" version="0.14.3-build00177" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.RuntimeTelemetry" version="0.14.3-build00177" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.ApplicationInsights.Web" version="0.14.3-build00177" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.16-beta" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" userInstalled="true" />
|
||||
</packages>
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Caching;
|
||||
|
||||
namespace IDeliverable.Licensing
|
||||
{
|
||||
public class CacheInvalidationContext
|
||||
{
|
||||
public CacheDependency CacheDependency { get; set; }
|
||||
public TimeSpan? ValidFor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Caching;
|
||||
|
||||
namespace IDeliverable.Licensing
|
||||
{
|
||||
public class CacheService
|
||||
{
|
||||
private readonly HttpContextAccessor mHttpContextAccessor = new HttpContextAccessor();
|
||||
|
||||
private Cache Cache => mHttpContextAccessor.Current().Cache;
|
||||
|
||||
public void SetValue<T>(string key, T value, CacheDependency dependency = null, TimeSpan? validFor = null)
|
||||
{
|
||||
var absoluteExpiration = validFor != null ? DateTime.UtcNow.Add(validFor.Value) : Cache.NoAbsoluteExpiration;
|
||||
Cache.Insert(key, value, dependency, absoluteExpiration, Cache.NoSlidingExpiration);
|
||||
}
|
||||
|
||||
public T GetValue<T>(string key, Func<CacheInvalidationContext, T> valueFactory = null)
|
||||
{
|
||||
var value = Cache.Get(key);
|
||||
var exception = value as Exception;
|
||||
|
||||
if (exception != null)
|
||||
throw (Exception)value;
|
||||
|
||||
if (value != null)
|
||||
return (T)value;
|
||||
|
||||
if (valueFactory == null)
|
||||
return default(T);
|
||||
|
||||
var context = new CacheInvalidationContext();
|
||||
|
||||
try
|
||||
{
|
||||
value = valueFactory(context);
|
||||
SetValue(key, value, context.CacheDependency, context.ValidFor);
|
||||
return (T) value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SetValue(key, ex, context.CacheDependency, context.ValidFor);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public object RemoveValue(string key)
|
||||
{
|
||||
return Cache.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace IDeliverable.Licensing.Exceptions
|
||||
{
|
||||
public enum LicenseVerificationError
|
||||
{
|
||||
UnknownLicenseKey,
|
||||
NoActiveSubscription,
|
||||
LicenseRevoked,
|
||||
HostnameMismatch,
|
||||
UnhandledException
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace IDeliverable.Licensing.Exceptions
|
||||
{
|
||||
public class LicenseVerificationException : Exception
|
||||
{
|
||||
public LicenseVerificationException(LicenseVerificationError error)
|
||||
:this("An error occurred while verifying the license.", error)
|
||||
{
|
||||
}
|
||||
|
||||
public LicenseVerificationException(string message, LicenseVerificationError error) : base(message)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public LicenseVerificationException(LicenseVerificationError error, Exception innerException)
|
||||
: this("An error occurred while verifying the license.", error, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
public LicenseVerificationException(string message, LicenseVerificationError error, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public LicenseVerificationError Error { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Web;
|
||||
|
||||
namespace IDeliverable.Licensing
|
||||
{
|
||||
public class HttpContextAccessor
|
||||
{
|
||||
public HttpContextBase Current()
|
||||
{
|
||||
return new HttpContextWrapper(HttpContext.Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System.Web;
|
||||
|
||||
namespace IDeliverable.Licensing
|
||||
{
|
||||
internal static class HttpRequestExtensions
|
||||
{
|
||||
public static string GetHttpHost(this HttpRequestBase request)
|
||||
{
|
||||
var host = request.ServerVariables["HTTP_HOST"];
|
||||
|
||||
if (host?.Contains(":") == true)
|
||||
host = host.Substring(0, host.IndexOf(':'));
|
||||
|
||||
return host;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7E439CB7-1ACE-435F-A8F3-5BB929423E34}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IDeliverable.Licensing</RootNamespace>
|
||||
<AssemblyName>IDeliverable.Licensing</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CacheInvalidationContext.cs" />
|
||||
<Compile Include="CacheService.cs" />
|
||||
<Compile Include="Exceptions\LicenseVerificationError.cs" />
|
||||
<Compile Include="Exceptions\LicenseVerificationException.cs" />
|
||||
<Compile Include="HttpContextAccessor.cs" />
|
||||
<Compile Include="HttpRequestExtensions.cs" />
|
||||
<Compile Include="Validation\LicenseValidationError.cs" />
|
||||
<Compile Include="Validation\LicenseValidationException.cs" />
|
||||
<Compile Include="Validation\LicenseValidator.cs" />
|
||||
<Compile Include="VerificationTokens\LicenseVerificationTokenError.cs" />
|
||||
<Compile Include="VerificationTokens\LicenseVerificationTokenException.cs" />
|
||||
<Compile Include="VerificationTokens\LicenseVerificationInfo.cs" />
|
||||
<Compile Include="VerificationTokens\LicenseVerificationToken.cs" />
|
||||
<Compile Include="VerificationTokens\LicenseVerificationTokenAccessor.cs" />
|
||||
<Compile Include="VerificationTokens\LicensingServiceClient.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Validation\LicenseValidationOptions.cs" />
|
||||
<Compile Include="VerificationTokens\ILicenseVerificationTokenStore.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("IDeliverable.LicensingFramework")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("IDeliverable.LicensingFramework")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("7e439cb7-1ace-435f-a8f3-5bb929423e34")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace IDeliverable.Licensing.Validation
|
||||
{
|
||||
public enum LicenseValidationError
|
||||
{
|
||||
UnknownLicenseKey,
|
||||
HostnameMismatch,
|
||||
NoActiveSubscription,
|
||||
LicenseRevoked,
|
||||
LicensingServiceError,
|
||||
LicensingServiceUnreachable,
|
||||
TokenAgeValidationFailed,
|
||||
TokenSignatureValidationFailed,
|
||||
UnexpectedError,
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace IDeliverable.Licensing.Validation
|
||||
{
|
||||
public class LicenseValidationException : Exception
|
||||
{
|
||||
public LicenseValidationException(LicenseValidationError error)
|
||||
:this("An error occurred while validating the license.", error)
|
||||
{
|
||||
}
|
||||
|
||||
public LicenseValidationException(string message, LicenseValidationError error) : base(message)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public LicenseValidationException(LicenseValidationError error, Exception innerException)
|
||||
: this("An error occurred while validating the license.", error, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
public LicenseValidationException(string message, LicenseValidationError error, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public LicenseValidationError Error { get; private set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user