From 6f51c362cac6f18e6a990504fc5020ee172a6bbe Mon Sep 17 00:00:00 2001 From: Alan Parra Date: Thu, 2 Jun 2022 17:38:22 -0300 Subject: [PATCH] Use TELEPORT_ instead of TSH_ for FIDO2 env var --- lib/auth/webauthncli/fido2.go | 2 +- lib/auth/webauthncli/fido2_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/auth/webauthncli/fido2.go b/lib/auth/webauthncli/fido2.go index d8d5d78ec7625..5ee5d4c792ee7 100644 --- a/lib/auth/webauthncli/fido2.go +++ b/lib/auth/webauthncli/fido2.go @@ -77,7 +77,7 @@ var fidoNewDevice = func(path string) (FIDODevice, error) { // IsFIDO2Available returns true if libfido2 is available in the current build. func IsFIDO2Available() bool { - val, ok := os.LookupEnv("TSH_FIDO2") + val, ok := os.LookupEnv("TELEPORT_FIDO2") // Default to enabled, otherwise obey the env variable. return !ok || val == "1" } diff --git a/lib/auth/webauthncli/fido2_test.go b/lib/auth/webauthncli/fido2_test.go index 27a508937df00..0e307c4386174 100644 --- a/lib/auth/webauthncli/fido2_test.go +++ b/lib/auth/webauthncli/fido2_test.go @@ -130,7 +130,7 @@ func (p pinCancelPrompt) PromptTouch() { } func TestIsFIDO2Available(t *testing.T) { - const fido2Key = "TSH_FIDO2" + const fido2Key = "TELEPORT_FIDO2" defer func() { os.Unsetenv(fido2Key) }() @@ -141,21 +141,21 @@ func TestIsFIDO2Available(t *testing.T) { want bool }{ { - name: "TSH_FIDO2 unset", + name: "env var unset", setenv: func() { os.Unsetenv(fido2Key) }, want: true, }, { - name: "TSH_FIDO2=1", + name: "env var set to 1", setenv: func() { os.Setenv(fido2Key, "1") }, want: true, }, { - name: "TSH_FIDO2=0", + name: "env var set to 0", setenv: func() { os.Setenv(fido2Key, "0") },