Skip to content

Commit d5f4e65

Browse files
committed
NuGet configuration
1 parent 5e33ea3 commit d5f4e65

4 files changed

Lines changed: 40 additions & 21 deletions

File tree

‎MoodleLti.DependencyInjection/MoodleLti.DependencyInjection.csproj‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
6+
<Version>0.1.0</Version>
7+
<Authors>Jan Wichelmann</Authors>
8+
<Company />
9+
<Description>Dependency Injection support for the MoodleLti package.</Description>
10+
<PackageProjectUrl>https://github.com/Janworks/MoodleLti</PackageProjectUrl>
11+
<RepositoryUrl>https://github.com/Janworks/MoodleLti.git</RepositoryUrl>
12+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13+
<RepositoryType>git</RepositoryType>
514
</PropertyGroup>
615

716
<ItemGroup>

‎MoodleLti.sln‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
EndProject
1515
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoodleLti.DependencyInjection", "MoodleLti.DependencyInjection\MoodleLti.DependencyInjection.csproj", "{84FB738B-F4D8-4B88-AB53-21A6F38A8038}"
1616
EndProject
17-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LtiLibrary.NetCore", "LtiLibrary\src\LtiLibrary.NetCore\LtiLibrary.NetCore.csproj", "{AA9A4E5F-BF28-4BA3-B840-0D0412B4E577}"
18-
EndProject
19-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LtiLibrary.AspNetCore", "LtiLibrary\src\LtiLibrary.AspNetCore\LtiLibrary.AspNetCore.csproj", "{F757D848-0DB5-4953-B272-8E1C35233B8F}"
20-
EndProject
2117
Global
2218
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2319
Debug|Any CPU = Debug|Any CPU
@@ -36,14 +32,6 @@ Global
3632
{84FB738B-F4D8-4B88-AB53-21A6F38A8038}.Debug|Any CPU.Build.0 = Debug|Any CPU
3733
{84FB738B-F4D8-4B88-AB53-21A6F38A8038}.Release|Any CPU.ActiveCfg = Release|Any CPU
3834
{84FB738B-F4D8-4B88-AB53-21A6F38A8038}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{AA9A4E5F-BF28-4BA3-B840-0D0412B4E577}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40-
{AA9A4E5F-BF28-4BA3-B840-0D0412B4E577}.Debug|Any CPU.Build.0 = Debug|Any CPU
41-
{AA9A4E5F-BF28-4BA3-B840-0D0412B4E577}.Release|Any CPU.ActiveCfg = Release|Any CPU
42-
{AA9A4E5F-BF28-4BA3-B840-0D0412B4E577}.Release|Any CPU.Build.0 = Release|Any CPU
43-
{F757D848-0DB5-4953-B272-8E1C35233B8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44-
{F757D848-0DB5-4953-B272-8E1C35233B8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
45-
{F757D848-0DB5-4953-B272-8E1C35233B8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
46-
{F757D848-0DB5-4953-B272-8E1C35233B8F}.Release|Any CPU.Build.0 = Release|Any CPU
4735
EndGlobalSection
4836
GlobalSection(SolutionProperties) = preSolution
4937
HideSolutionNode = FALSE

‎MoodleLti/MoodleLti.csproj‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
6+
<Version>0.1.0</Version>
7+
<Authors>Jan Wichelmann</Authors>
8+
<Company />
9+
<Description>Utility library for creating own external tools via the Moodle LTI API.</Description>
10+
<PackageProjectUrl>https://github.com/Janworks/MoodleLti</PackageProjectUrl>
11+
<RepositoryUrl>https://github.com/Janworks/MoodleLti.git</RepositoryUrl>
12+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13+
<RepositoryType>git</RepositoryType>
514
</PropertyGroup>
615

716
<ItemGroup>
17+
<PackageReference Include="LtiLibrary.AspNetCore" Version="3.2.0" />
18+
<PackageReference Include="LtiLibrary.NetCore" Version="3.2.0" />
819
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
920
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.1" />
1021
</ItemGroup>
1122

12-
<ItemGroup>
13-
<ProjectReference Include="..\LtiLibrary\src\LtiLibrary.AspNetCore\LtiLibrary.AspNetCore.csproj" />
14-
<ProjectReference Include="..\LtiLibrary\src\LtiLibrary.NetCore\LtiLibrary.NetCore.csproj" />
15-
</ItemGroup>
16-
1723
</Project>

‎MoodleLti/MoodleLtiApi.cs‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ private async Task<string> DoGetRequestAsync(string url, string expectedContentT
159159
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(expectedContentType));
160160

161161
// Sign request object
162-
await SecuredClient.SignRequest(_httpClient, HttpMethod.Get, url, new StringContent(string.Empty), _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
162+
var reqMessage = new HttpRequestMessage(HttpMethod.Get, url)
163+
{
164+
Content = new StringContent(string.Empty)
165+
};
166+
await SecuredClient.SignRequest(_httpClient, reqMessage, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
163167

164168
// Send HTTP request and retrieve response
165169
// TODO exception handling
@@ -182,7 +186,11 @@ private async Task<string> DoPostRequestAsync(string url, string body, string bo
182186
{
183187
// Sign request object
184188
var encodedBody = new StringContent(body, Encoding.UTF8, bodyContentType);
185-
await SecuredClient.SignRequest(_httpClient, HttpMethod.Post, url, encodedBody, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
189+
var reqMessage = new HttpRequestMessage(HttpMethod.Post, url)
190+
{
191+
Content = encodedBody
192+
};
193+
await SecuredClient.SignRequest(_httpClient, reqMessage, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
186194

187195
// Send HTTP request and retrieve response
188196
// TODO exception handling
@@ -201,7 +209,11 @@ private async Task<string> DoPutRequestAsync(string url, string body, string bod
201209
{
202210
// Sign request object
203211
var encodedBody = new StringContent(body, Encoding.UTF8, bodyContentType);
204-
await SecuredClient.SignRequest(_httpClient, HttpMethod.Put, url, encodedBody, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
212+
var reqMessage = new HttpRequestMessage(HttpMethod.Put, url)
213+
{
214+
Content = encodedBody
215+
};
216+
await SecuredClient.SignRequest(_httpClient, reqMessage, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
205217

206218
// Send HTTP request and retrieve response
207219
// TODO exception handling
@@ -217,7 +229,11 @@ private async Task<string> DoPutRequestAsync(string url, string body, string bod
217229
private async Task<string> DoDeleteRequestAsync(string url)
218230
{
219231
// Sign request object
220-
await SecuredClient.SignRequest(_httpClient, HttpMethod.Delete, url, new StringContent(string.Empty), _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
232+
var reqMessage = new HttpRequestMessage(HttpMethod.Delete, url)
233+
{
234+
Content = new StringContent(string.Empty)
235+
};
236+
await SecuredClient.SignRequest(_httpClient, reqMessage, _consumerKey, _sharedSecret, SignatureMethod.HmacSha1);
221237

222238
// Send HTTP request and retrieve response
223239
// TODO exception handling

0 commit comments

Comments
 (0)