def _prepare_auth(version, args, conn):
    """
    :param str version:
        Auth version: "0.0", "1.0", or "2.0". "0.0" indicates "no auth".
    :param args:
        :class:`argparse.Namespace` instance, with attributes representing the
        various authentication parameters
    :param conn:
        :class:`ZeroCloudConnection` instance.
    """
    version = str(float(version))
    auth = {'version': version}
    if version == '0.0':
        auth['swiftUrl'] = conn.url
    elif version == '1.0':
        auth['authUrl'] = args.auth
        auth['username'] = args.user
        auth['password'] = args.key
    else:
        # TODO(mg): inserting the username and password in the
        # uploaded file makes testing easy, but should not be done in
        # production. See issue #46.
        auth['authUrl'] = args.os_auth_url
        auth['tenant'] = args.os_tenant_name
        auth['username'] = args.os_username
        auth['password'] = args.os_password
    return auth