# Path: atlassian_jwt_auth/tests/utils.py
# def get_new_rsa_private_key_in_pem_format():
# def get_public_key_pem_for_private_key_pem(private_key_pem):
# def get_example_jwt_auth_signer(**kwargs):
# def create_token(issuer, audience, key_id, private_key, subject=None):
#     def get_new_private_key_in_pem_format(self):
#     def algorithm(self):
#     def get_new_private_key_in_pem_format(self):
#     def algorithm(self):
#     def get_new_private_key_in_pem_format(self):
# class BaseJWTAlgorithmTestMixin(object):
# class RS256KeyTestMixin(object):
# class ES256KeyTestMixin(object):
# 
# Path: atlassian_jwt_auth/contrib/requests.py
# class JWTAuth(AuthBase, BaseJWTAuth):
#     """Adds a JWT bearer token to the request per the ASAP specification"""
# 
#     def __call__(self, r):
#         r.headers['Authorization'] = self._get_header_value()
#         return r
# 
# def create_jwt_auth(
#         issuer, key_identifier, private_key_pem, audience, **kwargs):
#     """Instantiate a JWTAuth while creating the signer inline"""
#     return JWTAuth.create(
#         issuer, key_identifier, private_key_pem, audience, **kwargs)


import unittest
import jwt
import atlassian_jwt_auth
from datetime import timedelta
from requests import Request
from atlassian_jwt_auth.tests import utils
from atlassian_jwt_auth.contrib.requests import JWTAuth, create_jwt_auth
        auth._signer.subject = 'not-' + auth._signer.subject
        self.assertNotEqual(auth_header, self._get_auth_header(auth))

    def test_do_not_reuse_jwt_if_additional_claims_change(self):
        auth = self.create_jwt_auth('issuer', 'issuer/key',
                                    self._private_key_pem.decode(), 'audience',
                                    algorithm=self.algorithm, reuse_jwts=True)
        auth_header = self._get_auth_header(auth)
        auth._additional_claims['foo'] = 'bar'
        self.assertNotEqual(auth_header, self._get_auth_header(auth))

    def test_reuse_jwt_with_additional_claims(self):
        # calculating the cache key with additional claims is non-trivial
        auth = self.create_jwt_auth('issuer', 'issuer/key',
                                    self._private_key_pem.decode(), 'audience',
                                    algorithm=self.algorithm, reuse_jwts=True)
        auth._additional_claims['foo'] = 'bar'
        auth._additional_claims['fool'] = 'blah'
        auth._additional_claims['foot'] = 'quux'
        auth_header = self._get_auth_header(auth)
        self.assertEqual(auth_header, self._get_auth_header(auth))


class RequestsRS256Test(BaseRequestsTest,
                        utils.RS256KeyTestMixin,
                        unittest.TestCase):
    pass


class RequestsES256Test(BaseRequestsTest,

# Path: atlassian_jwt_auth/tests/utils.py
# def get_new_rsa_private_key_in_pem_format():
# def get_public_key_pem_for_private_key_pem(private_key_pem):
# def get_example_jwt_auth_signer(**kwargs):
# def create_token(issuer, audience, key_id, private_key, subject=None):
#     def get_new_private_key_in_pem_format(self):
#     def algorithm(self):
#     def get_new_private_key_in_pem_format(self):
#     def algorithm(self):
#     def get_new_private_key_in_pem_format(self):
# class BaseJWTAlgorithmTestMixin(object):
# class RS256KeyTestMixin(object):
# class ES256KeyTestMixin(object):
# 
# Path: atlassian_jwt_auth/contrib/requests.py
# class JWTAuth(AuthBase, BaseJWTAuth):
#     """Adds a JWT bearer token to the request per the ASAP specification"""
# 
#     def __call__(self, r):
#         r.headers['Authorization'] = self._get_header_value()
#         return r
# 
# def create_jwt_auth(
#         issuer, key_identifier, private_key_pem, audience, **kwargs):
#     """Instantiate a JWTAuth while creating the signer inline"""
#     return JWTAuth.create(
#         issuer, key_identifier, private_key_pem, audience, **kwargs)


# Path: atlassian_jwt_auth/contrib/tests/test_requests.py
import unittest
import jwt
import atlassian_jwt_auth
from datetime import timedelta
from requests import Request
from atlassian_jwt_auth.tests import utils
from atlassian_jwt_auth.contrib.requests import JWTAuth, create_jwt_auth

        auth._signer.subject = 'not-' + auth._signer.subject
        self.assertNotEqual(auth_header, self._get_auth_header(auth))

    def test_do_not_reuse_jwt_if_additional_claims_change(self):
        auth = self.create_jwt_auth('issuer', 'issuer/key',
                                    self._private_key_pem.decode(), 'audience',
                                    algorithm=self.algorithm, reuse_jwts=True)
        auth_header = self._get_auth_header(auth)
        auth._additional_claims['foo'] = 'bar'
        self.assertNotEqual(auth_header, self._get_auth_header(auth))

    def test_reuse_jwt_with_additional_claims(self):
        # calculating the cache key with additional claims is non-trivial
        auth = self.create_jwt_auth('issuer', 'issuer/key',
                                    self._private_key_pem.decode(), 'audience',
                                    algorithm=self.algorithm, reuse_jwts=True)
        auth._additional_claims['foo'] = 'bar'
        auth._additional_claims['fool'] = 'blah'
        auth._additional_claims['foot'] = 'quux'
        auth_header = self._get_auth_header(auth)
        self.assertEqual(auth_header, self._get_auth_header(auth))


class RequestsRS256Test(BaseRequestsTest,
                        utils.RS256KeyTestMixin,
                        unittest.TestCase):
    pass


class RequestsES256Test(BaseRequestsTest,

                        utils.ES256KeyTestMixin,