net.snowflake.client.util

## Class SecretDetector

- java.lang.Object
- - net.snowflake.client.util.SecretDetector

    public class SecretDetector
    extends Object

Search for credentials in sql and/or other text

### Constructor Summary

Constructors
Constructor and Description
`SecretDetector()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `filterAccessTokens(String message)` Filter access tokens that might be buried in JSON.
`static String` `maskAWSSecret(String sql)` mask AWS secret in the input string
`static String` `maskSASToken(String text)` Masks SAS token(s) in the input string
`static String` `maskSecrets(String text)` Masks any secrets present in the input string.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SecretDetector

    public SecretDetector()

### Method Detail

#### maskAWSSecret

    public static String maskAWSSecret(String sql)

mask AWS secret in the input string

Parameters:
  `sql` - The sql text to mask
Returns:
  masked string

#### maskSASToken

    public static String maskSASToken(String text)

Masks SAS token(s) in the input string

Parameters:
  `text` - Text which may contain SAS token(s)
Returns:
  Masked string

#### maskSecrets

    public static String maskSecrets(String text)

Masks any secrets present in the input string. This currently checks for SAS tokens (`maskSASToken(String)`) and AWS keys (`maskAWSSecret(String)`.

Parameters:
  `text` - Text which may contain secrets
Returns:
  Masked string

#### filterAccessTokens

    public static String filterAccessTokens(String message)

Filter access tokens that might be buried in JSON. Currently only used to filter the scopedCreds passed for XP binary downloads

Parameters:
  `message` - the message text which may contain secrets
Returns:
  Return filtered message