Backfill unit tests for paramsSafeToLog

This commit is contained in:
Joshua Casey
2024-11-19 14:06:34 -06:00
parent 51c86795af
commit c7e9ee1c61
5 changed files with 69 additions and 2 deletions

View File

@@ -5996,3 +5996,20 @@ func getSecretNameFromSignature(t *testing.T, signature string, typeLabel string
signatureAsValidName := strings.ToLower(b32.EncodeToString(signatureBytes))
return fmt.Sprintf("pinniped-storage-%s-%s", typeLabel, signatureAsValidName)
}
// TestParamsSafeToLog only exists to ensure that paramsSafeToLog will not be accidentally updated.
func TestParamsSafeToLog(t *testing.T) {
wantParams := []string{
"actor_token_type",
"audience",
"client_id",
"grant_type",
"redirect_uri",
"requested_token_type",
"resource",
"scope",
"subject_token_type",
}
require.ElementsMatch(t, wantParams, paramsSafeToLog().UnsortedList())
}