# 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
    claims = {'admin' : True, 'package' : 'gold'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims
    custom_token = auth.create_custom_token(new_user.uid)
    id_token = _sign_in(custom_token, api_key)
    dev_claims = auth.verify_id_token(id_token)
    for key, value in claims.items():
        assert dev_claims[key] == value

def test_update_custom_user_claims(new_user):
    assert new_user.custom_claims is None
    claims = {'admin' : True, 'package' : 'gold'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims

    claims = {'admin' : False, 'subscription' : 'guest'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims

    auth.set_custom_user_claims(new_user.uid, None)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims is None

def test_disable_user(new_user_with_params):
    user = auth.update_user(
        new_user_with_params.uid,
        display_name=auth.DELETE_ATTRIBUTE,

# 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

    claims = {'admin' : True, 'package' : 'gold'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims
    custom_token = auth.create_custom_token(new_user.uid)
    id_token = _sign_in(custom_token, api_key)
    dev_claims = auth.verify_id_token(id_token)
    for key, value in claims.items():
        assert dev_claims[key] == value

def test_update_custom_user_claims(new_user):
    assert new_user.custom_claims is None
    claims = {'admin' : True, 'package' : 'gold'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims

    claims = {'admin' : False, 'subscription' : 'guest'}
    auth.set_custom_user_claims(new_user.uid, claims)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims == claims

    auth.set_custom_user_claims(new_user.uid, None)
    user = auth.get_user(new_user.uid)
    assert user.custom_claims is None

def test_disable_user(new_user_with_params):
    user = auth.update_user(
        new_user_with_params.uid,
        display_name=auth.DELETE_ATTRIBUTE,

        photo_url=auth.DELETE_ATTRIBUTE,