fix(api): add remove otp sms and email to management api (#6721)

* fix(api): add remove otp sms and email to management api

* fix(console): remove otpsms and otpemail from user

---------

Co-authored-by: peintnermax <max@caos.ch>
This commit is contained in:
Livio Spring
2023-10-16 10:49:02 +03:00
committed by GitHub
parent ce719a3fa4
commit cb0a0f996e
5 changed files with 147 additions and 3 deletions

View File

@@ -1255,7 +1255,7 @@ service ManagementService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Remove Multi-Factor OTP";
description: "Remove the configured One-Time-Password (OTP) as a factor from the user. OTP is an authentication app, like Authy or Google/Microsoft Authenticator.."
description: "Remove the configured One-Time-Password (OTP) as a factor from the user. OTP is an authentication app, like Authy or Google/Microsoft Authenticator."
tags: "Users";
tags: "User Human";
responses: {
@@ -1306,6 +1306,68 @@ service ManagementService {
};
}
rpc RemoveHumanAuthFactorOTPSMS(RemoveHumanAuthFactorOTPSMSRequest) returns (RemoveHumanAuthFactorOTPSMSResponse) {
option (google.api.http) = {
delete: "/users/{user_id}/auth_factors/otp_sms"
};
option (zitadel.v1.auth_option) = {
permission: "user.write"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Remove Multi-Factor OTP SMS";
description: "Remove the configured One-Time-Password (OTP) SMS as a factor from the user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second-factor afterward."
tags: "Users";
tags: "User Human";
responses: {
key: "200"
value: {
description: "OK";
}
};
parameters: {
headers: {
name: "x-zitadel-orgid";
description: "The default is always the organization of the requesting user. If you like to get a user from another organization include the header. Make sure the requesting user has permission in the requested organization.";
type: STRING,
required: false;
};
};
};
}
rpc RemoveHumanAuthFactorOTPEmail(RemoveHumanAuthFactorOTPEmailRequest) returns (RemoveHumanAuthFactorOTPEmailResponse) {
option (google.api.http) = {
delete: "/users/{user_id}/auth_factors/otp_email"
};
option (zitadel.v1.auth_option) = {
permission: "user.write"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Remove Multi-Factor OTP SMS";
description: "Remove the configured One-Time-Password (OTP) Email as a factor from the user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second-factor afterward."
tags: "Users";
tags: "User Human";
responses: {
key: "200"
value: {
description: "OK";
}
};
parameters: {
headers: {
name: "x-zitadel-orgid";
description: "The default is always the organization of the requesting user. If you like to get a user from another organization include the header. Make sure the requesting user has permission in the requested organization.";
type: STRING,
required: false;
};
};
};
}
rpc ListHumanPasswordless(ListHumanPasswordlessRequest) returns (ListHumanPasswordlessResponse) {
option (google.api.http) = {
post: "/users/{user_id}/passwordless/_search"
@@ -8246,6 +8308,22 @@ message RemoveHumanAuthFactorU2FResponse {
zitadel.v1.ObjectDetails details = 1;
}
message RemoveHumanAuthFactorOTPSMSRequest {
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message RemoveHumanAuthFactorOTPSMSResponse {
zitadel.v1.ObjectDetails details = 1;
}
message RemoveHumanAuthFactorOTPEmailRequest {
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
}
message RemoveHumanAuthFactorOTPEmailResponse {
zitadel.v1.ObjectDetails details = 1;
}
message ListHumanPasswordlessRequest {
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
}