def get_raw_secret_value(
    secret_line,
    secret,
    plugin_settings,
    filename,
):
    """
    :type secret_line: str
    :param secret_line: the line on which the secret is found

    :type secret: dict
    :param secret: see caller's docstring

    :type plugin_settings: list
    :param plugin_settings: see caller's docstring

    :type filename: str
    :param filename: this is needed, because PotentialSecret uses this
        as a means of comparing whether two secrets are equal.
    """
    plugin = initialize.from_secret_type(
        secret['type'],
        plugin_settings,
    )

    for raw_secret in raw_secret_generator(
        plugin,
        secret_line,
        filetype=determine_file_type(filename),
    ):
        secret_obj = PotentialSecret(
            plugin.secret_type,
            filename,
            secret=raw_secret,
        )

        # There could be more than two secrets on the same line.
        # We only want to highlight the right one.
        if secret_obj.secret_hash == secret['hashed_secret']:
            return raw_secret
    else:
        raise SecretNotFoundOnSpecifiedLineError(secret['line_number'])
:type secret_line: str
    :param secret_line: the line on which the secret is found

    :type secret: dict
    :param secret: see caller's docstring

    :type plugin_settings: list
    :param plugin_settings: see caller's docstring

    :type filename: str
    :param filename: this is needed, because PotentialSecret uses this
        as a means of comparing whether two secrets are equal.