Skip to content

Commit

Permalink
Use TELEPORT_ instead of TSH_ for FIDO2 env var
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jun 2, 2022
1 parent 25aa1b1 commit 6f51c36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/auth/webauthncli/fido2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
8 changes: 4 additions & 4 deletions lib/auth/webauthncli/fido2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()
Expand All @@ -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")
},
Expand Down

0 comments on commit 6f51c36

Please sign in to comment.