# Path: firebase_admin/auth.py
# _AUTH_ATTRIBUTE = '_auth'
# DELETE_ATTRIBUTE = _user_mgt.DELETE_ATTRIBUTE
# def _get_client(app):
# def create_custom_token(uid, developer_claims=None, app=None):
# def verify_id_token(id_token, app=None, check_revoked=False):
# def create_session_cookie(id_token, expires_in, app=None):
# def verify_session_cookie(session_cookie, check_revoked=False, app=None):
# def revoke_refresh_tokens(uid, app=None):
# def get_user(uid, app=None):
# def get_user_by_email(email, app=None):
# def get_user_by_phone_number(phone_number, app=None):
# def get_users(identifiers, app=None):
# def list_users(page_token=None, max_results=_user_mgt.MAX_LIST_USERS_RESULTS, app=None):
# def create_user(**kwargs): # pylint: disable=differing-param-doc
# def update_user(uid, **kwargs): # pylint: disable=differing-param-doc
# def set_custom_user_claims(uid, custom_claims, app=None):
# def delete_user(uid, app=None):
# def delete_users(uids, app=None):
# def import_users(users, hash_alg=None, app=None):
# def generate_password_reset_link(email, action_code_settings=None, app=None):
# def generate_email_verification_link(email, action_code_settings=None, app=None):
# def generate_sign_in_with_email_link(email, action_code_settings, app=None):
# def get_oidc_provider_config(provider_id, app=None):
# def create_oidc_provider_config(
#         provider_id, client_id, issuer, display_name=None, enabled=None, client_secret=None,
#         id_token_response_type=None, code_response_type=None, app=None):
# def update_oidc_provider_config(
#         provider_id, client_id=None, issuer=None, display_name=None, enabled=None,
#         client_secret=None, id_token_response_type=None, code_response_type=None, app=None):
# def delete_oidc_provider_config(provider_id, app=None):
# def list_oidc_provider_configs(
#         page_token=None, max_results=_auth_providers.MAX_LIST_CONFIGS_RESULTS, app=None):
# def get_saml_provider_config(provider_id, app=None):
# def create_saml_provider_config(
#         provider_id, idp_entity_id, sso_url, x509_certificates, rp_entity_id, callback_url,
#         display_name=None, enabled=None, app=None):
# def update_saml_provider_config(
#         provider_id, idp_entity_id=None, sso_url=None, x509_certificates=None,
#         rp_entity_id=None, callback_url=None, display_name=None, enabled=None, app=None):
# def delete_saml_provider_config(provider_id, app=None):
# def list_saml_provider_configs(
#         page_token=None, max_results=_auth_providers.MAX_LIST_CONFIGS_RESULTS, app=None):
# 
# Path: firebase_admin/credentials.py
# class Base:
# class Certificate(Base):
# class ApplicationDefault(Base):
# class RefreshToken(Base):
#     def get_access_token(self):
#     def get_credential(self):
#     def __init__(self, cert):
#     def project_id(self):
#     def signer(self):
#     def service_account_email(self):
#     def get_credential(self):
#     def __init__(self):
#     def get_credential(self):
#     def project_id(self):
#     def _load_credential(self):
#     def __init__(self, refresh_token):
#     def client_id(self):
#     def client_secret(self):
#     def refresh_token(self):
#     def get_credential(self):
# def _is_file_path(path):
#     _CREDENTIAL_TYPE = 'service_account'
#     _CREDENTIAL_TYPE = 'authorized_user'


import base64
import datetime
import random
import string
import time
import uuid
import google.oauth2.credentials
import pytest
import requests
import firebase_admin
from typing import List
from urllib import parse
from google.auth import transport
from firebase_admin import auth
from firebase_admin import credentials
    # raise an exception.
    with pytest.raises(auth.UserDisabledError) as excinfo:
        auth.verify_session_cookie(session_cookie, check_revoked=True)
    assert str(excinfo.value) == 'The user record is disabled.'

def test_import_users():
    uid, email = _random_id()
    user = auth.ImportUserRecord(uid=uid, email=email)
    result = auth.import_users([user])
    try:
        assert result.success_count == 1
        assert result.failure_count == 0
        saved_user = auth.get_user(uid)
        assert saved_user.email == email
    finally:
        auth.delete_user(uid)

def test_import_users_with_password(api_key):
    uid, email = _random_id()
    password_hash = base64.b64decode(
        'V358E8LdWJXAO7muq0CufVpEOXaj8aFiC7T/rcaGieN04q/ZPJ08WhJEHGjj9lz/2TT+/86N5VjVoc5DdBhBiw==')
    user = auth.ImportUserRecord(
        uid=uid, email=email, password_hash=password_hash, password_salt=b'NaCl')

    scrypt_key = base64.b64decode(
        'jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA==')
    salt_separator = base64.b64decode('Bw==')
    scrypt = auth.UserImportHash.scrypt(
        key=scrypt_key, salt_separator=salt_separator, rounds=8, memory_cost=14)
    result = auth.import_users([user], hash_alg=scrypt)

# Path: firebase_admin/auth.py
# _AUTH_ATTRIBUTE = '_auth'
# DELETE_ATTRIBUTE = _user_mgt.DELETE_ATTRIBUTE
# def _get_client(app):
# def create_custom_token(uid, developer_claims=None, app=None):
# def verify_id_token(id_token, app=None, check_revoked=False):
# def create_session_cookie(id_token, expires_in, app=None):
# def verify_session_cookie(session_cookie, check_revoked=False, app=None):
# def revoke_refresh_tokens(uid, app=None):
# def get_user(uid, app=None):
# def get_user_by_email(email, app=None):
# def get_user_by_phone_number(phone_number, app=None):
# def get_users(identifiers, app=None):
# def list_users(page_token=None, max_results=_user_mgt.MAX_LIST_USERS_RESULTS, app=None):
# def create_user(**kwargs): # pylint: disable=differing-param-doc
# def update_user(uid, **kwargs): # pylint: disable=differing-param-doc
# def set_custom_user_claims(uid, custom_claims, app=None):
# def delete_user(uid, app=None):
# def delete_users(uids, app=None):
# def import_users(users, hash_alg=None, app=None):
# def generate_password_reset_link(email, action_code_settings=None, app=None):
# def generate_email_verification_link(email, action_code_settings=None, app=None):
# def generate_sign_in_with_email_link(email, action_code_settings, app=None):
# def get_oidc_provider_config(provider_id, app=None):
# def create_oidc_provider_config(
#         provider_id, client_id, issuer, display_name=None, enabled=None, client_secret=None,
#         id_token_response_type=None, code_response_type=None, app=None):
# def update_oidc_provider_config(
#         provider_id, client_id=None, issuer=None, display_name=None, enabled=None,
#         client_secret=None, id_token_response_type=None, code_response_type=None, app=None):
# def delete_oidc_provider_config(provider_id, app=None):
# def list_oidc_provider_configs(
#         page_token=None, max_results=_auth_providers.MAX_LIST_CONFIGS_RESULTS, app=None):
# def get_saml_provider_config(provider_id, app=None):
# def create_saml_provider_config(
#         provider_id, idp_entity_id, sso_url, x509_certificates, rp_entity_id, callback_url,
#         display_name=None, enabled=None, app=None):
# def update_saml_provider_config(
#         provider_id, idp_entity_id=None, sso_url=None, x509_certificates=None,
#         rp_entity_id=None, callback_url=None, display_name=None, enabled=None, app=None):
# def delete_saml_provider_config(provider_id, app=None):
# def list_saml_provider_configs(
#         page_token=None, max_results=_auth_providers.MAX_LIST_CONFIGS_RESULTS, app=None):
# 
# Path: firebase_admin/credentials.py
# class Base:
# class Certificate(Base):
# class ApplicationDefault(Base):
# class RefreshToken(Base):
#     def get_access_token(self):
#     def get_credential(self):
#     def __init__(self, cert):
#     def project_id(self):
#     def signer(self):
#     def service_account_email(self):
#     def get_credential(self):
#     def __init__(self):
#     def get_credential(self):
#     def project_id(self):
#     def _load_credential(self):
#     def __init__(self, refresh_token):
#     def client_id(self):
#     def client_secret(self):
#     def refresh_token(self):
#     def get_credential(self):
# def _is_file_path(path):
#     _CREDENTIAL_TYPE = 'service_account'
#     _CREDENTIAL_TYPE = 'authorized_user'


# Path: integration/test_auth.py
import base64
import datetime
import random
import string
import time
import uuid
import google.oauth2.credentials
import pytest
import requests
import firebase_admin
from typing import List
from urllib import parse
from google.auth import transport
from firebase_admin import auth
from firebase_admin import credentials

    # raise an exception.
    with pytest.raises(auth.UserDisabledError) as excinfo:
        auth.verify_session_cookie(session_cookie, check_revoked=True)
    assert str(excinfo.value) == 'The user record is disabled.'

def test_import_users():
    uid, email = _random_id()
    user = auth.ImportUserRecord(uid=uid, email=email)
    result = auth.import_users([user])
    try:
        assert result.success_count == 1
        assert result.failure_count == 0
        saved_user = auth.get_user(uid)
        assert saved_user.email == email
    finally:
        auth.delete_user(uid)

def test_import_users_with_password(api_key):
    uid, email = _random_id()
    password_hash = base64.b64decode(
        'V358E8LdWJXAO7muq0CufVpEOXaj8aFiC7T/rcaGieN04q/ZPJ08WhJEHGjj9lz/2TT+/86N5VjVoc5DdBhBiw==')
    user = auth.ImportUserRecord(
        uid=uid, email=email, password_hash=password_hash, password_salt=b'NaCl')

    scrypt_key = base64.b64decode(
        'jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA==')
    salt_separator = base64.b64decode('Bw==')
    scrypt = auth.UserImportHash.scrypt(
        key=scrypt_key, salt_separator=salt_separator, rounds=8, memory_cost=14)
    result = auth.import_users([user], hash_alg=scrypt)

    try: