From 1d7deff9a6c8eca1ae94404955531fddeedced07 Mon Sep 17 00:00:00 2001 From: Maxwell Hammad Date: Mon, 3 Jun 2024 13:20:45 -0400 Subject: [PATCH] feat: add support for TOTP secret (#345) --- pkg/usermanagement/client.go | 1 + pkg/usermanagement/usermanagement_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/usermanagement/client.go b/pkg/usermanagement/client.go index 9133a06..13ee87e 100644 --- a/pkg/usermanagement/client.go +++ b/pkg/usermanagement/client.go @@ -407,6 +407,7 @@ type EnrollAuthFactorOpts struct { Type mfa.FactorType `json:"type"` TOTPIssuer string `json:"totp_issuer,omitempty"` TOTPUser string `json:"totp_user,omitempty"` + TOTPSecret string `json:"totp_secret,omitempty"` } type EnrollAuthFactorResponse struct { diff --git a/pkg/usermanagement/usermanagement_test.go b/pkg/usermanagement/usermanagement_test.go index 75f196b..858bc7f 100644 --- a/pkg/usermanagement/usermanagement_test.go +++ b/pkg/usermanagement/usermanagement_test.go @@ -663,6 +663,7 @@ func TestUserManagementEnrollAuthFactor(t *testing.T) { authenticationRes, err := EnrollAuthFactor(context.Background(), EnrollAuthFactorOpts{ User: "user_01E3JC5F5Z1YJNPGVYWV9SX6GH", Type: mfa.TOTP, + TOTPSecret: "testSecret", }) require.NoError(t, err)