MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / TestEncryptTOTPSecret_EmptyInput

Function TestEncryptTOTPSecret_EmptyInput

internal/crypto/totp_test.go:94–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestEncryptTOTPSecret_EmptyInput(t *testing.T) {
95 // An empty input is treated as "nothing to encrypt" — return empty
96 // without trying to seal a zero-length plaintext. This matters for
97 // upgrade paths where a half-initialised authenticator row exists.
98 out, err := EncryptTOTPSecret("", "k")
99 require.NoError(t, err)
100 assert.Equal(t, "", out)
101}
102
103func TestIsEncryptedTOTPSecret(t *testing.T) {
104 assert.False(t, IsEncryptedTOTPSecret(""))

Callers

nothing calls this directly

Calls 1

EncryptTOTPSecretFunction · 0.85

Tested by

no test coverage detected