From d378166d222d1d5aa7551a5d126e4a38c1e782a2 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Tue, 18 Mar 2025 13:32:43 +0100 Subject: [PATCH] fix(webkey): create webKey handling (#9559) # Which Problems Are Solved During the review of #9489 we noticed that the curl example as well as the HTTP response if they feature flag was not enabled, was wrong. Additionally, the returned `creationDate` was always a zero value. # How the Problems Are Solved Fixed the exampl, response code and mapped the correct date. # Additional Changes None # Additional Context None --- internal/api/grpc/webkey/v2beta/webkey.go | 2 +- proto/zitadel/webkey/v2beta/webkey_service.proto | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/api/grpc/webkey/v2beta/webkey.go b/internal/api/grpc/webkey/v2beta/webkey.go index eb7cf62f27..d45288dff2 100644 --- a/internal/api/grpc/webkey/v2beta/webkey.go +++ b/internal/api/grpc/webkey/v2beta/webkey.go @@ -25,7 +25,7 @@ func (s *Server) CreateWebKey(ctx context.Context, req *webkey.CreateWebKeyReque return &webkey.CreateWebKeyResponse{ Id: webKey.KeyID, - CreationDate: timestamppb.New(webKey.ObjectDetails.CreationDate), + CreationDate: timestamppb.New(webKey.ObjectDetails.EventDate), }, nil } diff --git a/proto/zitadel/webkey/v2beta/webkey_service.proto b/proto/zitadel/webkey/v2beta/webkey_service.proto index f395ea8a8b..ad52227349 100644 --- a/proto/zitadel/webkey/v2beta/webkey_service.proto +++ b/proto/zitadel/webkey/v2beta/webkey_service.proto @@ -140,7 +140,7 @@ service WebKeyService { } }; responses: { - key: "409" + key: "400" value: { description: "The feature flag `web_key` is not enabled."; } @@ -179,15 +179,15 @@ service WebKeyService { } }; responses: { - key: "404" + key: "400" value: { - description: "The web key to active does not exist."; + description: "The feature flag `web_key` is not enabled."; } }; responses: { - key: "409" + key: "404" value: { - description: "The feature flag `web_key` is not enabled."; + description: "The web key to active does not exist."; } }; }; @@ -226,7 +226,7 @@ service WebKeyService { } }; responses: { - key: "409" + key: "400" value: { description: "The feature flag `web_key` is not enabled or the web key is currently active."; } @@ -262,7 +262,7 @@ service WebKeyService { } }; responses: { - key: "409" + key: "400" value: { description: "The feature flag `web_key` is not enabled."; } @@ -285,7 +285,7 @@ message CreateWebKeyRequest { ED25519 ed25519 = 3; } option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - example: "{\"bits\":\"RSA_BITS_2048\",\"hasher\":\"RSA_HASHER_SHA5256\"}"; + example: "{\"rsa\":{\"bits\":\"RSA_BITS_2048\",\"hasher\":\"RSA_HASHER_SHA256\"}}"; }; }