Skip to content

Commit 5dc5700

Browse files
committed
v9.2.5712-Beta2
1 parent e70adb2 commit 5dc5700

File tree

97 files changed

+1369
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1369
-337
lines changed

CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProductVersion>9.0.30729</ProductVersion>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<ProjectGuid>ED0C4E46-E801-4310-917F-FEBC7DCA792F</ProjectGuid>
9+
<ProjectGuid>841E6E1D-954D-4BB3-93D5-0DFD425FC196</ProjectGuid>
1010
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1111
<OutputType>Library</OutputType>
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -41,12 +41,33 @@
4141
<NoWarn>1998,42356</NoWarn>
4242
</PropertyGroup>
4343
<ItemGroup>
44+
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
45+
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
46+
</Reference>
4447
<Reference Include="System.Runtime.InteropServices.RuntimeInformation">
4548
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
4649
</Reference>
4750
<Reference Include="ITHit.Collab, Version=1.0.0.732, Culture=neutral, processorArchitecture=MSIL">
4851
<HintPath>..\packages\ITHit.Collab.1.0.0.732\lib\net45\ITHit.Collab.dll</HintPath>
4952
</Reference>
53+
<Reference Include="Google.Apis, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Google.Apis.Auth, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.dll</HintPath>
58+
</Reference>
59+
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
60+
<HintPath>..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
61+
</Reference>
62+
<Reference Include="Google.Apis.Core, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
63+
<HintPath>..\packages\Google.Apis.Core.1.40.2\lib\net45\Google.Apis.Core.dll</HintPath>
64+
</Reference>
65+
<Reference Include="Google.Apis.Drive.v3, Version=1.40.2.1649, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
66+
<HintPath>..\packages\Google.Apis.Drive.v3.1.40.2.1649\lib\net45\Google.Apis.Drive.v3.dll</HintPath>
67+
</Reference>
68+
<Reference Include="Google.Apis.PlatformServices, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
69+
<HintPath>..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
70+
</Reference>
5071
<Reference Include="System" />
5172
<Reference Include="System.configuration" />
5273
<Reference Include="System.Configuration.Install" />
@@ -124,13 +145,16 @@
124145
</ItemGroup>
125146
<ItemGroup>
126147
<Reference Include="ITHit.WebDAV.Server">
127-
<HintPath>..\packages\ITHit.WebDAV.Server.9.2.5694-Beta2\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
148+
<HintPath>..\packages\ITHit.WebDAV.Server.9.2.5712-Beta2\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
128149
</Reference>
129150
<Reference Include="ITHit.Server">
130-
<HintPath>..\packages\ITHit.Server.9.2.5694-Beta2\lib\net451\ITHit.Server.dll</HintPath>
151+
<HintPath>..\packages\ITHit.Server.9.2.5712-Beta2\lib\net451\ITHit.Server.dll</HintPath>
131152
</Reference>
132153
<Reference Include="ITHit.Server.Web">
133-
<HintPath>..\packages\ITHit.Server.Web.9.2.5694-Beta2\lib\net451\ITHit.Server.Web.dll</HintPath>
154+
<HintPath>..\packages\ITHit.Server.Web.9.2.5712-Beta2\lib\net451\ITHit.Server.Web.dll</HintPath>
155+
</Reference>
156+
<Reference Include="ITHit.GSuite.Server">
157+
<HintPath>..\packages\ITHit.GSuite.Server.9.2.5712-Beta2\lib\net451\ITHit.GSuite.Server.dll</HintPath>
134158
</Reference>
135159
</ItemGroup>
136160
<PropertyGroup>
@@ -148,7 +172,7 @@
148172
<AutoAssignPort>True</AutoAssignPort>
149173
<DevelopmentServerPort>9658</DevelopmentServerPort>
150174
<DevelopmentServerVPath>/</DevelopmentServerVPath>
151-
<IISUrl>http://localhost:28405/</IISUrl>
175+
<IISUrl>http://localhost:36440/</IISUrl>
152176
<NTLMAuthentication>True</NTLMAuthentication>
153177
<UseCustomServer>False</UseCustomServer>
154178
<CustomServerUrl>

CS/CalDAVServer.FileSystemStorage.AspNet/DavHandler.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using ITHit.WebDAV.Server;
1313
using CalDAVServer.FileSystemStorage.AspNet;
1414
using CalDAVServer.FileSystemStorage.AspNet.Acl;
15-
15+
using ITHit.GSuite.Server;
1616
namespace CalDAVServer.FileSystemStorage.AspNet
1717
{
1818
/// <summary>
@@ -26,6 +26,10 @@ public class DavHandler : HttpTaskAsyncHandler
2626
/// - IT Hit iCalendar and vCard Library if used in a project
2727
/// </summary>
2828
private readonly string license = File.ReadAllText(HttpContext.Current.Request.PhysicalApplicationPath + "License.lic");
29+
private static readonly string googleServiceAccountID = ConfigurationManager.AppSettings["GoogleServiceAccountID"];
30+
private static readonly string googleServicePrivateKey = ConfigurationManager.AppSettings["GoogleServicePrivateKey"];
31+
private static readonly string gSuiteLicense = ConfigurationManager.AppSettings["GSuiteLicense"];
32+
private readonly string gSuiteLicense = File.ReadAllText(HttpContext.Current.Request.PhysicalApplicationPath + "GSuiteLicense.lic");
2933

3034
/// <summary>
3135
/// If debug logging is enabled reponses are output as formatted XML,
@@ -78,7 +82,9 @@ public override async Task ProcessRequestAsync(HttpContext context)
7882

7983
context.Response.BufferOutput = false;
8084
DavContext ntfsDavContext = new DavContext(context);
85+
GSuiteEngineAsync gSuiteEngine = getOrInitializeGSuiteEngine(context);
8186
await engine.RunAsync(ntfsDavContext);
87+
await gSuiteEngine.RunAsync(ContextConverter.ConvertToGSuiteContext(ntfsDavContext));
8288
}
8389

8490
/// <summary>
@@ -144,5 +150,28 @@ private DavEngineAsync getOrInitializeEngine(HttpContext context)
144150

145151
return (DavEngineAsync)context.Application[ENGINE_KEY];
146152
}
153+
/// <summary>
154+
/// Initializes or gets engine singleton.
155+
/// </summary>
156+
/// <param name="context">Instance of <see cref="HttpContext"/>.</param>
157+
/// <returns>Instance of <see cref="GSuiteEngineAsync"/>.</returns>
158+
private GSuiteEngineAsync getOrInitializeGSuiteEngine(HttpContext context)
159+
{
160+
//we don't use any double check lock pattern here because nothing wrong
161+
//is going to happen if we created occasionally several engines.
162+
const string ENGINE_KEY = "$GSuiteEngine$";
163+
if (context.Application[ENGINE_KEY] == null)
164+
{
165+
var gSuiteEngine = new GSuiteEngineAsync(googleServiceAccountID, googleServicePrivateKey)
166+
{
167+
License = gSuiteLicense,
168+
Logger = CalDAVServer.FileSystemStorage.AspNet.Logger.Instance
169+
};
170+
171+
context.Application[ENGINE_KEY] = gSuiteEngine;
172+
}
173+
174+
return (GSuiteEngineAsync)context.Application[ENGINE_KEY];
175+
}
147176
}
148177
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHit.Server" version="9.2.5694-Beta2" targetFramework="net451" />
4-
<package id="ITHit.Server.Web" version="9.2.5694-Beta2" targetFramework="net451" />
5-
<package id="ITHit.WebDAV.Server" version="9.2.5694-Beta2" targetFramework="net451" />
3+
<package id="ITHit.Server" version="9.2.5712-Beta2" targetFramework="net451" />
4+
<package id="ITHit.Server.Web" version="9.2.5712-Beta2" targetFramework="net451" />
5+
<package id="ITHit.WebDAV.Server" version="9.2.5712-Beta2" targetFramework="net451" />
6+
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net451" />
67
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net451" />
78
<package id="ITHit.Collab" version="1.0.0.732" targetFramework="net45" />
9+
<package id="ITHit.GSuite.Server" version="9.2.5712-Beta2" targetFramework="net451" />
10+
<package id="Google.Apis" version="1.40.2" targetFramework="net451" />
11+
<package id="Google.Apis.Auth" version="1.40.2" targetFramework="net451" />
12+
<package id="Google.Apis.Core" version="1.40.2" targetFramework="net451" />
13+
<package id="Google.Apis.Drive.v3" version="1.40.2.1649" targetFramework="net451" />
814
</packages>

CS/CalDAVServer.FileSystemStorage.AspNet/web.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
Every attribute will be stored in a separate file under this folder in this case.
1515
-->
1616
<!-- <add key="AttrStoragePath" value="~/App_Data/WebDav/Attributes/" /> -->
17-
17+
<add key="GoogleServiceAccountID" value=""/>
18+
<add key="GoogleServicePrivateKey" value=""/>
1819
</appSettings>
1920

2021
<!--
0 Bytes
Binary file not shown.
Binary file not shown.

CS/CalDAVServer.SqlStorage.AspNet/CalDAVServer.SqlStorage.AspNet.csproj

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProductVersion>9.0.30729</ProductVersion>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<ProjectGuid>9A8DE0B1-08AE-49AE-8305-F51D0535C0EF</ProjectGuid>
9+
<ProjectGuid>F2708F98-3581-44A4-991B-7E75DAFB61D2</ProjectGuid>
1010
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1111
<OutputType>Library</OutputType>
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -41,12 +41,33 @@
4141
<NoWarn>1998,42356</NoWarn>
4242
</PropertyGroup>
4343
<ItemGroup>
44+
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
45+
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
46+
</Reference>
4447
<Reference Include="System.Runtime.InteropServices.RuntimeInformation">
4548
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
4649
</Reference>
4750
<Reference Include="ITHit.Collab, Version=1.0.0.732, Culture=neutral, processorArchitecture=MSIL">
4851
<HintPath>..\packages\ITHit.Collab.1.0.0.732\lib\net45\ITHit.Collab.dll</HintPath>
4952
</Reference>
53+
<Reference Include="Google.Apis, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Google.Apis.Auth, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.dll</HintPath>
58+
</Reference>
59+
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
60+
<HintPath>..\packages\Google.Apis.Auth.1.40.2\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
61+
</Reference>
62+
<Reference Include="Google.Apis.Core, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
63+
<HintPath>..\packages\Google.Apis.Core.1.40.2\lib\net45\Google.Apis.Core.dll</HintPath>
64+
</Reference>
65+
<Reference Include="Google.Apis.Drive.v3, Version=1.40.2.1649, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
66+
<HintPath>..\packages\Google.Apis.Drive.v3.1.40.2.1649\lib\net45\Google.Apis.Drive.v3.dll</HintPath>
67+
</Reference>
68+
<Reference Include="Google.Apis.PlatformServices, Version=1.40.2.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
69+
<HintPath>..\packages\Google.Apis.1.40.2\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
70+
</Reference>
5071
<Reference Include="System" />
5172
<Reference Include="System.configuration" />
5273
<Reference Include="System.Configuration.Install" />
@@ -111,13 +132,16 @@
111132
</ItemGroup>
112133
<ItemGroup>
113134
<Reference Include="ITHit.WebDAV.Server">
114-
<HintPath>..\packages\ITHit.WebDAV.Server.9.2.5694-Beta2\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
135+
<HintPath>..\packages\ITHit.WebDAV.Server.9.2.5712-Beta2\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
115136
</Reference>
116137
<Reference Include="ITHit.Server">
117-
<HintPath>..\packages\ITHit.Server.9.2.5694-Beta2\lib\net451\ITHit.Server.dll</HintPath>
138+
<HintPath>..\packages\ITHit.Server.9.2.5712-Beta2\lib\net451\ITHit.Server.dll</HintPath>
118139
</Reference>
119140
<Reference Include="ITHit.Server.Web">
120-
<HintPath>..\packages\ITHit.Server.Web.9.2.5694-Beta2\lib\net451\ITHit.Server.Web.dll</HintPath>
141+
<HintPath>..\packages\ITHit.Server.Web.9.2.5712-Beta2\lib\net451\ITHit.Server.Web.dll</HintPath>
142+
</Reference>
143+
<Reference Include="ITHit.GSuite.Server">
144+
<HintPath>..\packages\ITHit.GSuite.Server.9.2.5712-Beta2\lib\net451\ITHit.GSuite.Server.dll</HintPath>
121145
</Reference>
122146
</ItemGroup>
123147
<PropertyGroup>
@@ -135,7 +159,7 @@
135159
<AutoAssignPort>True</AutoAssignPort>
136160
<DevelopmentServerPort>9658</DevelopmentServerPort>
137161
<DevelopmentServerVPath>/</DevelopmentServerVPath>
138-
<IISUrl>http://localhost:41471/</IISUrl>
162+
<IISUrl>http://localhost:12455/</IISUrl>
139163
<NTLMAuthentication>False</NTLMAuthentication>
140164
<UseCustomServer>False</UseCustomServer>
141165
<CustomServerUrl>

CS/CalDAVServer.SqlStorage.AspNet/DavHandler.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
using ITHit.Server;
1111
using ITHit.WebDAV.Server;
12-
12+
using ITHit.GSuite.Server;
1313
namespace CalDAVServer.SqlStorage.AspNet
1414
{
1515
/// <summary>
@@ -23,6 +23,10 @@ public class DavHandler : HttpTaskAsyncHandler
2323
/// - IT Hit iCalendar and vCard Library if used in a project
2424
/// </summary>
2525
private readonly string license = File.ReadAllText(HttpContext.Current.Request.PhysicalApplicationPath + "License.lic");
26+
private static readonly string googleServiceAccountID = ConfigurationManager.AppSettings["GoogleServiceAccountID"];
27+
private static readonly string googleServicePrivateKey = ConfigurationManager.AppSettings["GoogleServicePrivateKey"];
28+
private static readonly string gSuiteLicense = ConfigurationManager.AppSettings["GSuiteLicense"];
29+
private readonly string gSuiteLicense = File.ReadAllText(HttpContext.Current.Request.PhysicalApplicationPath + "GSuiteLicense.lic");
2630

2731
/// <summary>
2832
/// If debug logging is enabled reponses are output as formatted XML,
@@ -59,10 +63,12 @@ public override async Task ProcessRequestAsync(HttpContext context)
5963
DavEngineAsync engine = getOrInitializeEngine(context);
6064

6165
context.Response.BufferOutput = false;
66+
GSuiteEngineAsync gSuiteEngine = getOrInitializeGSuiteEngine(context);
6267

6368
using (var sqlDavContext = new DavContext(context))
6469
{
6570
await engine.RunAsync(sqlDavContext);
71+
await gSuiteEngine.RunAsync(ContextConverter.ConvertToGSuiteContext(sqlDavContext));
6672
}
6773
}
6874

@@ -129,5 +135,28 @@ private DavEngineAsync getOrInitializeEngine(HttpContext context)
129135

130136
return (DavEngineAsync)context.Application[ENGINE_KEY];
131137
}
138+
/// <summary>
139+
/// Initializes or gets engine singleton.
140+
/// </summary>
141+
/// <param name="context">Instance of <see cref="HttpContext"/>.</param>
142+
/// <returns>Instance of <see cref="GSuiteEngineAsync"/>.</returns>
143+
private GSuiteEngineAsync getOrInitializeGSuiteEngine(HttpContext context)
144+
{
145+
//we don't use any double check lock pattern here because nothing wrong
146+
//is going to happen if we created occasionally several engines.
147+
const string ENGINE_KEY = "$GSuiteEngine$";
148+
if (context.Application[ENGINE_KEY] == null)
149+
{
150+
var gSuiteEngine = new GSuiteEngineAsync(googleServiceAccountID, googleServicePrivateKey)
151+
{
152+
License = gSuiteLicense,
153+
Logger = CalDAVServer.SqlStorage.AspNet.Logger.Instance
154+
};
155+
156+
context.Application[ENGINE_KEY] = gSuiteEngine;
157+
}
158+
159+
return (GSuiteEngineAsync)context.Application[ENGINE_KEY];
160+
}
132161
}
133162
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHit.Server" version="9.2.5694-Beta2" targetFramework="net451" />
4-
<package id="ITHit.Server.Web" version="9.2.5694-Beta2" targetFramework="net451" />
5-
<package id="ITHit.WebDAV.Server" version="9.2.5694-Beta2" targetFramework="net451" />
3+
<package id="ITHit.Server" version="9.2.5712-Beta2" targetFramework="net451" />
4+
<package id="ITHit.Server.Web" version="9.2.5712-Beta2" targetFramework="net451" />
5+
<package id="ITHit.WebDAV.Server" version="9.2.5712-Beta2" targetFramework="net451" />
6+
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net451" />
67
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net451" />
78
<package id="ITHit.Collab" version="1.0.0.732" targetFramework="net45" />
9+
<package id="ITHit.GSuite.Server" version="9.2.5712-Beta2" targetFramework="net451" />
10+
<package id="Google.Apis" version="1.40.2" targetFramework="net451" />
11+
<package id="Google.Apis.Auth" version="1.40.2" targetFramework="net451" />
12+
<package id="Google.Apis.Core" version="1.40.2" targetFramework="net451" />
13+
<package id="Google.Apis.Drive.v3" version="1.40.2.1649" targetFramework="net451" />
814
</packages>

CS/CalDAVServer.SqlStorage.AspNet/web.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
<appSettings>
2323
<add key="DebugLoggingEnabled" value="true"/>
2424
<add key="LogPath" value="~/App_Data/WebDav/Logs"/>
25-
25+
<add key="GoogleServiceAccountID" value=""/>
26+
<add key="GoogleServicePrivateKey" value=""/>
2627
</appSettings>
2728

2829
<!--

0 commit comments

Comments
 (0)