From ebe2fbe1d50a7f3b5094d2c7c74821335a36df43 Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Mon, 15 Nov 2021 14:24:45 +0100 Subject: [PATCH] fix: rename lifetime to expiration of pwless link in ImportHumanUserResponse (#2687) --- docs/docs/apis/proto/management.md | 3 ++- internal/api/grpc/management/user.go | 5 +++-- proto/zitadel/management.proto | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/docs/apis/proto/management.md b/docs/docs/apis/proto/management.md index 780b38f1ed..7ff2c66fab 100644 --- a/docs/docs/apis/proto/management.md +++ b/docs/docs/apis/proto/management.md @@ -5081,7 +5081,8 @@ This is an empty response | Field | Type | Description | Validation | | ----- | ---- | ----------- | ----------- | | link | string | - | | -| lifetime | google.protobuf.Duration | - | | +| lifetime | google.protobuf.Duration | deprecated: use expiration instead | | +| expiration | google.protobuf.Duration | - | | diff --git a/internal/api/grpc/management/user.go b/internal/api/grpc/management/user.go index 6ac983c61f..d2fc082673 100644 --- a/internal/api/grpc/management/user.go +++ b/internal/api/grpc/management/user.go @@ -184,8 +184,9 @@ func (s *Server) ImportHumanUser(ctx context.Context, req *mgmt_pb.ImportHumanUs } if code != nil { resp.PasswordlessRegistration = &mgmt_pb.ImportHumanUserResponse_PasswordlessRegistration{ - Link: code.Link(s.systemDefaults.Notifications.Endpoints.PasswordlessRegistration), - Lifetime: durationpb.New(code.Expiration), + Link: code.Link(s.systemDefaults.Notifications.Endpoints.PasswordlessRegistration), + Lifetime: durationpb.New(code.Expiration), + Expiration: durationpb.New(code.Expiration), } } return resp, nil diff --git a/proto/zitadel/management.proto b/proto/zitadel/management.proto index 10fad473fa..dc12b46962 100644 --- a/proto/zitadel/management.proto +++ b/proto/zitadel/management.proto @@ -580,7 +580,6 @@ service ManagementService { rpc AddPasswordlessRegistration(AddPasswordlessRegistrationRequest) returns (AddPasswordlessRegistrationResponse) { option (google.api.http) = { post: "/users/{user_id}/passwordless/_link" - body: "*" }; option (zitadel.v1.auth_option) = { permission: "user.credential.write" @@ -3001,7 +3000,9 @@ message ImportHumanUserRequest { message ImportHumanUserResponse { message PasswordlessRegistration { string link = 1; + //deprecated: use expiration instead google.protobuf.Duration lifetime = 2; + google.protobuf.Duration expiration = 3; } string user_id = 1;