import warnings


def _get_secret_keys(config, secrets_config_key='SECRETS', secrets_list=None):
    """
    Finds all of the configuration values that should be secret
    """
    keys = []
    if secrets_config_key is not None:
        configuration_keys = config.get(secrets_config_key)
        if configuration_keys is None:
            warnings.warn('ultra-config was unable to find any configuration for '
                          '{0}.  Please set {0}=[] in your configuration or pass '
                          '`secrets_config_key=None` if you wish to manually set '
                          'the configuration keys to decrypt'.format(secrets_config_key))
            configuration_keys = []
        keys.extend(configuration_keys)
    secrets_list = secrets_list or []
    keys.extend(secrets_list)
    return keys