import click


def rsa_required(config):
    """Get the value for 'auth.login.rsa_required' from the CLI
    configuration presented.  Process it as either a string or a
    boolean depending on which one is found.  If it is something else
    or not there, default to False.

    """
    rsa_req = config.get('auth.login.rsa_required', False)
    if not isinstance(rsa_req, (str,bool)):
        # Can't be sure what the user is going for by setting up a
        # non-string non-bool value here, so just go for false and be
        # done with it.
        click.echo("WARNING 'auth.login.rsa_required' is present and "
                   "neither a string nor a bool in the configuration, "
                   "assuming false."
        )
        rsa_req = False
    if isinstance(rsa_req, str):
        rsa_req = rsa_req.lower() == "true"
    return rsa_req