Skip to content

Commit

Permalink
v1.7.0 (#15)
Browse files Browse the repository at this point in the history
* Swagger updates

* Add automatic update of doco

* Update to latest

* Update README

* Version bump

---------

Co-authored-by: JT <[email protected]>
  • Loading branch information
Hawxy and Hawxy authored Sep 27, 2024
1 parent 00a16f5 commit 581e54b
Show file tree
Hide file tree
Showing 338 changed files with 3,380 additions and 662 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,5 @@ $RECYCLE.BIN/

# Vim temporary swap files
*.swp
.idea
.idea
.nuke/temp/
6 changes: 4 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"NugetPack",
"NugetPush",
"Restore",
"Test"
"Test",
"Update"
]
}
},
Expand All @@ -93,7 +94,8 @@
"NugetPack",
"NugetPush",
"Restore",
"Test"
"Test",
"Update"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion Package.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.6.0</Version>
<Version>1.7.0</Version>
<Authors>Hawxy</Authors>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async onRequestInit({ requestInit }) {

If the requests are coming from an SSR environment (ie NextJS), then you can either use the session JWT via the `__session` cookie and forward it on, or use a JWT template to create a unique JWT for your scenario.

### Sync Clerk data with Webhooks
### Inbound Clerk Webhooks

If you're accepting webhooks from Clerk, you will need to validate the incoming webhook signature. To do this, you'll need to install the `Svix` package:

Expand Down
30 changes: 30 additions & 0 deletions build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using Microsoft.Playwright;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.CI.GitHubActions;
Expand Down Expand Up @@ -41,6 +46,8 @@ class Build : NukeBuild

[Solution(GenerateProjects = true)] readonly Solution Solution;

[NuGetPackage("Microsoft.OpenApi.Kiota", "kiota.dll")]
readonly Tool Kiota;
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";

Target Clean => _ => _
Expand Down Expand Up @@ -108,4 +115,27 @@ class Build : NukeBuild
.SetApiKey(NugetApiKey));
});



Target Update => _ => _
.Requires(() => Kiota)
.Executes(async () =>
{
// swagger URL is a client-side blob...
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions() {Channel = "msedge"});

var page = await browser.NewPageAsync();
await page.GotoAsync("https://clerk.com/docs/reference/backend-api");

var downloadTask = page.WaitForDownloadAsync();
await page.GetByRole(AriaRole.Link, new PageGetByRoleOptions() { Name = "Download" }).ClickAsync();
var download = await downloadTask;

var projectDir = Solution.Clerk_Net.Directory;
await download.SaveAsAsync($"{projectDir}/swagger.json");

Kiota(workingDirectory: projectDir, arguments: $"update -o {projectDir / "Client"} --clean-output");

});
}
4 changes: 3 additions & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.0.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.47.0" />
<PackageReference Include="Nuke.Common" Version="8.1.0" />
<PackageDownload Include="Microsoft.OpenApi.Kiota" Version="[1.18.0]" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.4" PrivateAssets="All" />
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="All" />
</ItemGroup>

<Import Project="../../Package.Build.props" />
Expand Down
6 changes: 3 additions & 3 deletions src/Clerk.Net.JwtSample/Clerk.Net.JwtSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/Clerk.Net.Tests/Clerk.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -10,9 +10,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clerk.Net.DependencyInjection\Clerk.Net.DependencyInjection.csproj" />
<ProjectReference Include="..\Clerk.Net.DependencyInjection\Clerk.Net.DependencyInjection.csproj" />
</ItemGroup>

</Project>
</Project>
14 changes: 7 additions & 7 deletions src/Clerk.Net/Clerk.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.9.7" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.4.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.2.5" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.3.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.1.5" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.2.2" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.13.0" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.13.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.13.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.13.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Multipart" Version="1.13.0" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.13.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.4" PrivateAssets="All" />
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="All" />
</ItemGroup>

<Import Project="../../Package.Build.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System;
namespace Clerk.Net.Client.Actor_tokens
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
#pragma warning disable CS1591
public partial class Actor_tokensPostRequestBody : IParsable
#pragma warning restore CS1591
Expand All @@ -23,7 +24,7 @@ public partial class Actor_tokensPostRequestBody : IParsable
public int? ExpiresInSeconds { get; set; }
/// <summary>The maximum duration that the session which will be created by the generated actor token should last.By default, the duration of a session created via an actor token, lasts 30 minutes.</summary>
public int? SessionMaxDurationInSeconds { get; set; }
/// <summary>The ID of the user that can use the newly created sign in token.</summary>
/// <summary>The ID of the user being impersonated.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? UserId { get; set; }
Expand Down Expand Up @@ -69,3 +70,4 @@ public virtual void Serialize(ISerializationWriter writer)
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
Expand All @@ -9,7 +10,7 @@ namespace Clerk.Net.Client.Actor_tokens
/// <summary>
/// The actor payload. It needs to include a sub property which should contain the ID of the actor.This whole payload will be also included in the JWT session token.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class Actor_tokensPostRequestBody_actor : IAdditionalDataHolder, IParsable
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
Expand Down Expand Up @@ -52,3 +53,4 @@ public virtual void Serialize(ISerializationWriter writer)
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Actor_tokens.Item;
using Clerk.Net.Client.Models;
using Microsoft.Kiota.Abstractions.Extensions;
Expand All @@ -14,7 +15,7 @@ namespace Clerk.Net.Client.Actor_tokens
/// <summary>
/// Builds and executes requests for operations under \actor_tokens
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class Actor_tokensRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the Clerk.Net.Client.actor_tokens.item collection</summary>
Expand Down Expand Up @@ -107,3 +108,4 @@ public RequestInformation ToPostRequestInformation(global::Clerk.Net.Client.Acto
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
Expand All @@ -13,7 +14,7 @@ namespace Clerk.Net.Client.Actor_tokens.Item.Revoke
/// <summary>
/// Builds and executes requests for operations under \actor_tokens\{actor_token_id}\revoke
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class RevokeRequestBuilder : BaseRequestBuilder
{
/// <summary>
Expand Down Expand Up @@ -87,3 +88,4 @@ public RequestInformation ToPostRequestInformation(Action<RequestConfiguration<D
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Actor_tokens.Item.Revoke;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
Expand All @@ -11,7 +12,7 @@ namespace Clerk.Net.Client.Actor_tokens.Item
/// <summary>
/// Builds and executes requests for operations under \actor_tokens\{actor_token_id}
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class WithActor_token_ItemRequestBuilder : BaseRequestBuilder
{
/// <summary>The revoke property</summary>
Expand All @@ -37,3 +38,4 @@ public WithActor_token_ItemRequestBuilder(string rawUrl, IRequestAdapter request
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System;
namespace Clerk.Net.Client.Allowlist_identifiers
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
#pragma warning disable CS1591
public partial class Allowlist_identifiersPostRequestBody : IParsable
#pragma warning restore CS1591
Expand Down Expand Up @@ -55,3 +56,4 @@ public virtual void Serialize(ISerializationWriter writer)
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Allowlist_identifiers.Item;
using Clerk.Net.Client.Models;
using Microsoft.Kiota.Abstractions.Extensions;
Expand All @@ -14,7 +15,7 @@ namespace Clerk.Net.Client.Allowlist_identifiers
/// <summary>
/// Builds and executes requests for operations under \allowlist_identifiers
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class Allowlist_identifiersRequestBuilder : BaseRequestBuilder
{
/// <summary>Gets an item from the Clerk.Net.Client.allowlist_identifiers.item collection</summary>
Expand Down Expand Up @@ -152,3 +153,4 @@ public RequestInformation ToPostRequestInformation(global::Clerk.Net.Client.Allo
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Models;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
Expand All @@ -13,7 +14,7 @@ namespace Clerk.Net.Client.Allowlist_identifiers.Item
/// <summary>
/// Builds and executes requests for operations under \allowlist_identifiers\{identifier_id}
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class WithIdentifier_ItemRequestBuilder : BaseRequestBuilder
{
/// <summary>
Expand Down Expand Up @@ -87,3 +88,4 @@ public RequestInformation ToDeleteRequestInformation(Action<RequestConfiguration
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated/>
#pragma warning disable CS0618
using Clerk.Net.Client.Beta_features.Domain;
using Clerk.Net.Client.Beta_features.Instance_settings;
using Microsoft.Kiota.Abstractions.Extensions;
Expand All @@ -12,7 +13,7 @@ namespace Clerk.Net.Client.Beta_features
/// <summary>
/// Builds and executes requests for operations under \beta_features
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class Beta_featuresRequestBuilder : BaseRequestBuilder
{
/// <summary>The domain property</summary>
Expand Down Expand Up @@ -43,3 +44,4 @@ public Beta_featuresRequestBuilder(string rawUrl, IRequestAdapter requestAdapter
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System;
namespace Clerk.Net.Client.Beta_features.Domain
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.16.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
#pragma warning disable CS1591
public partial class DomainPutRequestBody : IParsable
#pragma warning restore CS1591
Expand Down Expand Up @@ -51,3 +52,4 @@ public virtual void Serialize(ISerializationWriter writer)
}
}
}
#pragma warning restore CS0618
Loading

0 comments on commit 581e54b

Please sign in to comment.