# Path: google/oauth2/service_account.py
# _DEFAULT_TOKEN_LIFETIME_SECS = 3600  # 1 hour in seconds
# _GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
# class Credentials(
#     credentials.Signing, credentials.Scoped, credentials.CredentialsWithQuotaProject
# ):
# class IDTokenCredentials(credentials.Signing, credentials.CredentialsWithQuotaProject):
#     def __init__(
#         self,
#         signer,
#         service_account_email,
#         token_uri,
#         scopes=None,
#         default_scopes=None,
#         subject=None,
#         project_id=None,
#         quota_project_id=None,
#         additional_claims=None,
#         always_use_jwt_access=False,
#     ):
#     def _from_signer_and_info(cls, signer, info, **kwargs):
#     def from_service_account_info(cls, info, **kwargs):
#     def from_service_account_file(cls, filename, **kwargs):
#     def service_account_email(self):
#     def project_id(self):
#     def requires_scopes(self):
#     def with_scopes(self, scopes, default_scopes=None):
#     def with_always_use_jwt_access(self, always_use_jwt_access):
#     def with_subject(self, subject):
#     def with_claims(self, additional_claims):
#     def with_quota_project(self, quota_project_id):
#     def _make_authorization_grant_assertion(self):
#     def refresh(self, request):
#     def _create_self_signed_jwt(self, audience):
#     def sign_bytes(self, message):
#     def signer(self):
#     def signer_email(self):
#     def __init__(
#         self,
#         signer,
#         service_account_email,
#         token_uri,
#         target_audience,
#         additional_claims=None,
#         quota_project_id=None,
#     ):
#     def _from_signer_and_info(cls, signer, info, **kwargs):
#     def from_service_account_info(cls, info, **kwargs):
#     def from_service_account_file(cls, filename, **kwargs):
#     def with_target_audience(self, target_audience):
#     def with_quota_project(self, quota_project_id):
#     def _make_authorization_grant_assertion(self):
#     def refresh(self, request):
#     def service_account_email(self):
#     def sign_bytes(self, message):
#     def signer(self):
#     def signer_email(self):


import json
import os
import socket
import threading
import sys
import google.auth
import pytest
from tempfile import NamedTemporaryFile
from googleapiclient import discovery
from six.moves import BaseHTTPServer
from google.oauth2 import service_account
from mock import patch

@pytest.fixture(params=[dns_access_direct, dns_access_client_library])
def dns_access(request, http_request, service_account_info):
    # Fill in the fixtures on the functions,
    # so that we don't have to fill in the parameters manually.
    def wrapper():
        return request.param(http_request, service_account_info["project_id"])

    yield wrapper


@pytest.fixture
def oidc_credentials(service_account_file, http_request):
    result = service_account.IDTokenCredentials.from_service_account_file(
        service_account_file, target_audience=_AUDIENCE_OIDC
    )
    result.refresh(http_request)
    yield result


@pytest.fixture
def service_account_info(service_account_file):
    with open(service_account_file) as f:
        yield json.load(f)


@pytest.fixture
def aws_oidc_credentials(
    service_account_file, service_account_info, authenticated_request
):

# Path: google/oauth2/service_account.py
# _DEFAULT_TOKEN_LIFETIME_SECS = 3600  # 1 hour in seconds
# _GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
# class Credentials(
#     credentials.Signing, credentials.Scoped, credentials.CredentialsWithQuotaProject
# ):
# class IDTokenCredentials(credentials.Signing, credentials.CredentialsWithQuotaProject):
#     def __init__(
#         self,
#         signer,
#         service_account_email,
#         token_uri,
#         scopes=None,
#         default_scopes=None,
#         subject=None,
#         project_id=None,
#         quota_project_id=None,
#         additional_claims=None,
#         always_use_jwt_access=False,
#     ):
#     def _from_signer_and_info(cls, signer, info, **kwargs):
#     def from_service_account_info(cls, info, **kwargs):
#     def from_service_account_file(cls, filename, **kwargs):
#     def service_account_email(self):
#     def project_id(self):
#     def requires_scopes(self):
#     def with_scopes(self, scopes, default_scopes=None):
#     def with_always_use_jwt_access(self, always_use_jwt_access):
#     def with_subject(self, subject):
#     def with_claims(self, additional_claims):
#     def with_quota_project(self, quota_project_id):
#     def _make_authorization_grant_assertion(self):
#     def refresh(self, request):
#     def _create_self_signed_jwt(self, audience):
#     def sign_bytes(self, message):
#     def signer(self):
#     def signer_email(self):
#     def __init__(
#         self,
#         signer,
#         service_account_email,
#         token_uri,
#         target_audience,
#         additional_claims=None,
#         quota_project_id=None,
#     ):
#     def _from_signer_and_info(cls, signer, info, **kwargs):
#     def from_service_account_info(cls, info, **kwargs):
#     def from_service_account_file(cls, filename, **kwargs):
#     def with_target_audience(self, target_audience):
#     def with_quota_project(self, quota_project_id):
#     def _make_authorization_grant_assertion(self):
#     def refresh(self, request):
#     def service_account_email(self):
#     def sign_bytes(self, message):
#     def signer(self):
#     def signer_email(self):


# Path: system_tests/system_tests_sync/test_external_accounts.py
import json
import os
import socket
import threading
import sys
import google.auth
import pytest
from tempfile import NamedTemporaryFile
from googleapiclient import discovery
from six.moves import BaseHTTPServer
from google.oauth2 import service_account
from mock import patch


@pytest.fixture(params=[dns_access_direct, dns_access_client_library])
def dns_access(request, http_request, service_account_info):
    # Fill in the fixtures on the functions,
    # so that we don't have to fill in the parameters manually.
    def wrapper():
        return request.param(http_request, service_account_info["project_id"])

    yield wrapper


@pytest.fixture
def oidc_credentials(service_account_file, http_request):
    result = service_account.IDTokenCredentials.from_service_account_file(
        service_account_file, target_audience=_AUDIENCE_OIDC
    )
    result.refresh(http_request)
    yield result


@pytest.fixture
def service_account_info(service_account_file):
    with open(service_account_file) as f:
        yield json.load(f)


@pytest.fixture
def aws_oidc_credentials(
    service_account_file, service_account_info, authenticated_request
):

    credentials = service_account.Credentials.from_service_account_file(