From 6f30042803578a9e45a56b1ccb5af2f65b346800 Mon Sep 17 00:00:00 2001 From: Dennis Oehme Date: Wed, 15 Apr 2026 17:35:17 +0200 Subject: [PATCH 1/2] chore(deps)!: upgrade to .NET 10 and refresh NuGet packages Align target frameworks, CI setup, analyzers, and test/runtime dependencies with current .NET 10 releases to keep builds and tests current. BREAKING CHANGE: The Zitadel package now targets net10.0 and no longer supports net8.0 consumers. --- .github/workflows/dotnet-release.yml | 2 +- .github/workflows/dotnet-test.yml | 2 +- examples/Zitadel.ApiAccess/Zitadel.ApiAccess.csproj | 2 +- .../Zitadel.AspNet.AuthN/Zitadel.AspNet.AuthN.csproj | 2 +- examples/Zitadel.WebApi/Zitadel.WebApi.csproj | 2 +- src/Directory.Build.props | 4 ++-- src/Zitadel/Zitadel.csproj | 6 +++--- tests/Directory.Build.props | 10 +++++----- tests/Zitadel.Test/Zitadel.Test.csproj | 10 +++++----- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml index d50fe4b8..d26355a3 100644 --- a/.github/workflows/dotnet-release.yml +++ b/.github/workflows/dotnet-release.yml @@ -24,7 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.x + dotnet-version: 10.x - name: Setup dotnet tools run: dotnet tool restore - name: Generate gRPC code diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index ef00f95c..ff737ed9 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -13,7 +13,7 @@ jobs: fail-fast: true matrix: version: - - 8.x + - 10.x steps: - uses: actions/checkout@v6 - uses: bufbuild/buf-setup-action@v1 diff --git a/examples/Zitadel.ApiAccess/Zitadel.ApiAccess.csproj b/examples/Zitadel.ApiAccess/Zitadel.ApiAccess.csproj index dcafb70f..4ef4ecab 100644 --- a/examples/Zitadel.ApiAccess/Zitadel.ApiAccess.csproj +++ b/examples/Zitadel.ApiAccess/Zitadel.ApiAccess.csproj @@ -3,7 +3,7 @@ false Exe - net8.0 + net10.0 enable enable diff --git a/examples/Zitadel.AspNet.AuthN/Zitadel.AspNet.AuthN.csproj b/examples/Zitadel.AspNet.AuthN/Zitadel.AspNet.AuthN.csproj index bb5486c6..82ccbae3 100644 --- a/examples/Zitadel.AspNet.AuthN/Zitadel.AspNet.AuthN.csproj +++ b/examples/Zitadel.AspNet.AuthN/Zitadel.AspNet.AuthN.csproj @@ -2,7 +2,7 @@ false - net8.0 + net10.0 enable enable diff --git a/examples/Zitadel.WebApi/Zitadel.WebApi.csproj b/examples/Zitadel.WebApi/Zitadel.WebApi.csproj index 9438625e..f9f5d0e7 100644 --- a/examples/Zitadel.WebApi/Zitadel.WebApi.csproj +++ b/examples/Zitadel.WebApi/Zitadel.WebApi.csproj @@ -2,7 +2,7 @@ false - net8.0 + net10.0 enable enable diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3f7afeed..6c57ce64 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0 + net10.0 enable enable true @@ -42,7 +42,7 @@ Condition="$(MSBuildProjectExtension) == '.csproj'" /> diff --git a/src/Zitadel/Zitadel.csproj b/src/Zitadel/Zitadel.csproj index c35b6330..36cf94be 100644 --- a/src/Zitadel/Zitadel.csproj +++ b/src/Zitadel/Zitadel.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index bc86379e..65389ed8 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0 + net10.0 enable enable false @@ -8,14 +8,14 @@ - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Zitadel.Test/Zitadel.Test.csproj b/tests/Zitadel.Test/Zitadel.Test.csproj index 1f214046..cd46286b 100644 --- a/tests/Zitadel.Test/Zitadel.Test.csproj +++ b/tests/Zitadel.Test/Zitadel.Test.csproj @@ -1,16 +1,16 @@ - + - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 2c7b9b2bc2087b56bea6642a9cd2c12ce2b0f961 Mon Sep 17 00:00:00 2001 From: Dennis Oehme Date: Mon, 8 Jun 2026 18:13:15 +0200 Subject: [PATCH 2/2] feat(api): enhance gRPC client support and versioning - Added new service clients for Application, Project, Action, Authorization, Feature, Telemetry, SAML, and WebKey services. - Updated the `justfile` to use a specific git tag for protobuf generation. - Introduced `ZitadelGrpcVersion` class to manage version information for generated gRPC clients. --- justfile | 5 +- src/Zitadel/Api/Clients.cs | 104 +++++++++++++++++- src/Zitadel/Api/ZitadelGrpcVersion.cs | 12 ++ .../Credentials/ServiceAccount.Test.cs | 2 +- 4 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 src/Zitadel/Api/ZitadelGrpcVersion.cs diff --git a/justfile b/justfile index 58cba614..34de34ef 100755 --- a/justfile +++ b/justfile @@ -2,8 +2,11 @@ default: clean generate-grpc +# Keep this in sync with `Zitadel.Api.ZitadelGrpcVersion.SupportedTag`. +zitadel_tag := "v4.15.0" + @clean: rm -rf ./src/Zitadel/Api/Generated generate-grpc: - buf generate https://github.com/zitadel/zitadel.git#depth=1 --include-imports --path ./proto/zitadel + buf generate https://github.com/zitadel/zitadel.git#ref={{zitadel_tag}},depth=1 --include-imports --path ./proto/zitadel diff --git a/src/Zitadel/Api/Clients.cs b/src/Zitadel/Api/Clients.cs index 1367dfe0..26d97064 100644 --- a/src/Zitadel/Api/Clients.cs +++ b/src/Zitadel/Api/Clients.cs @@ -1,22 +1,33 @@ using Grpc.Core; using Grpc.Net.Client; +using Zitadel.Action.V2; using Zitadel.Admin.V1; +using Zitadel.Analytics.V2beta; +using Zitadel.Application.V2; using Zitadel.Auth.V1; using Zitadel.Authentication; +using Zitadel.Authorization.V2; +using Zitadel.Feature.V2; +using Zitadel.Idp.V2; +using Zitadel.Instance.V2; +using Zitadel.InternalPermission.V2; using Zitadel.Management.V1; using Zitadel.Oidc.V2; using Zitadel.Org.V2; +using Zitadel.Project.V2; +using Zitadel.Saml.V2; using Zitadel.Session.V2; using Zitadel.Settings.V2; using Zitadel.System.V1; using Zitadel.User.V2; +using Zitadel.Webkey.V2; namespace Zitadel.Api; /// -/// Helper class to instantiate (gRPC) api service clients for the ZITADEL API with correct settings. -/// All other versions are still available, but the latest version is used by default. +/// Provides static methods to create and configure instances of gRPC API service clients for the ZITADEL API. +/// The clients are instantiated with default or specified options to ensure proper connectivity and authentication. /// public static class Clients { @@ -44,6 +55,70 @@ public static AuthService.AuthServiceClient AuthService(Options options) => public static ManagementService.ManagementServiceClient ManagementService(Options options) => GetClient(options); + /// + /// Create a service client for the application service. + /// + /// Options for the client, including endpoint and authorization method. + /// The . + public static ApplicationService.ApplicationServiceClient ApplicationService(Options options) => + GetClient(options); + + /// + /// Create a service client for the project service. + /// + /// Options for the client like authorization method. + /// The . + public static ProjectService.ProjectServiceClient ProjectService(Options options) => + GetClient(options); + + /// + /// Create a service client for the action service. + /// + /// Options for the client like authorization method. + /// The . + public static ActionService.ActionServiceClient ActionService(Options options) => + GetClient(options); + + /// + /// Create a service client for the authorization service. + /// + /// Options for the client like authorization method. + /// The . + public static AuthorizationService.AuthorizationServiceClient AuthorizationService(Options options) => + GetClient(options); + + /// + /// Create a service client for the feature service. + /// + /// Options for the client like authorization method. + /// The . + public static FeatureService.FeatureServiceClient FeatureService(Options options) => + GetClient(options); + + /// + /// Create a service client for the telemetry service. + /// + /// Options for the client like authorization method. + /// The . + public static TelemetryService.TelemetryServiceClient TelemetryService(Options options) => + GetClient(options); + + /// + /// Create a service client for the SAML service. + /// + /// Options for the client like authorization method. + /// The . + public static SAMLService.SAMLServiceClient SAMLService(Options options) => + GetClient(options); + + /// + /// Create a service client for the web key service. + /// + /// Options for the client like authorization method. + /// The . + public static WebKeyService.WebKeyServiceClient WebKeyService(Options options) => + GetClient(options); + /// /// Create a service client for the oidc service. /// @@ -92,6 +167,31 @@ public static SystemService.SystemServiceClient SystemService(Options options) = public static UserService.UserServiceClient UserService(Options options) => GetClient(options); + /// + /// Create a service client for the identity provider service. + /// + /// Options for the client like authorization method. + /// The . + public static IdentityProviderService.IdentityProviderServiceClient IdentityProviderService(Options options) => + GetClient(options); + + /// + /// Create a service client for the instance service. + /// + /// Options for the client like authorization method. + /// The . + public static InstanceService.InstanceServiceClient InstanceService(Options options) => + GetClient(options); + + /// + /// Create a service client for the internal permission service. + /// + /// Options for the client like authorization method. + /// The . + public static InternalPermissionService.InternalPermissionServiceClient + InternalPermissionService(Options options) => + GetClient(options); + private static TClient GetClient(Options options) where TClient : ClientBase { diff --git a/src/Zitadel/Api/ZitadelGrpcVersion.cs b/src/Zitadel/Api/ZitadelGrpcVersion.cs new file mode 100644 index 00000000..81d6243b --- /dev/null +++ b/src/Zitadel/Api/ZitadelGrpcVersion.cs @@ -0,0 +1,12 @@ +namespace Zitadel.Api; + +/// +/// Version information about the generated ZITADEL gRPC API clients in this package. +/// +public static class ZitadelGrpcVersion +{ + /// + /// Upstream ZITADEL git tag used as source for protobuf generation. + /// + public const string SupportedTag = "v4.15.0"; +} diff --git a/tests/Zitadel.Test/Credentials/ServiceAccount.Test.cs b/tests/Zitadel.Test/Credentials/ServiceAccount.Test.cs index be7594f2..9cd0304a 100644 --- a/tests/Zitadel.Test/Credentials/ServiceAccount.Test.cs +++ b/tests/Zitadel.Test/Credentials/ServiceAccount.Test.cs @@ -30,6 +30,6 @@ public async Task Should_Throw_With_Meaningful_Error() var sa = await ServiceAccount.LoadFromJsonStringAsync(TestData.InvalidServiceAccountJson); var ex = await Assert.ThrowsAsync(() => sa.AuthenticateAsync(TestData.ApiUrl)); - ex.Message.Should().Contain("Errors.Internal"); + ex.Message.Should().Contain("invalid_grant"); } }