Skip to content

Commit

Permalink
Patch the new location of auth code pkce random
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin-b committed Feb 14, 2024
1 parent 391de12 commit 7ecd221
Show file tree
Hide file tree
Showing 11 changed files with 371 additions and 122 deletions.
9 changes: 7 additions & 2 deletions tests/features/multi_auth/test_add_operator_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import httpx_auth
from httpx_auth.testing import BrowserMock, create_token, token_cache, browser_mock
import httpx_auth._oauth2.authorization_code_pkce


@pytest.mark.asyncio
Expand Down Expand Up @@ -408,7 +409,9 @@ async def test_oauth2_authorization_code_and_multiple_authentication_can_be_comb
async def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down Expand Up @@ -453,7 +456,9 @@ async def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
async def test_oauth2_pkce_and_multiple_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down
9 changes: 7 additions & 2 deletions tests/features/multi_auth/test_add_operator_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import httpx_auth
from httpx_auth.testing import BrowserMock, create_token, token_cache, browser_mock
import httpx_auth._oauth2.authorization_code_pkce


def test_basic_and_api_key_authentication_can_be_combined(httpx_mock: HTTPXMock):
Expand Down Expand Up @@ -394,7 +395,9 @@ def test_oauth2_authorization_code_and_multiple_authentication_can_be_combined(
def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down Expand Up @@ -438,7 +441,9 @@ def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
def test_oauth2_pkce_and_multiple_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down
9 changes: 7 additions & 2 deletions tests/features/multi_auth/test_and_operator_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import httpx_auth
from httpx_auth.testing import BrowserMock, create_token, token_cache, browser_mock
import httpx_auth._oauth2.authorization_code_pkce


@pytest.mark.asyncio
Expand Down Expand Up @@ -408,7 +409,9 @@ async def test_oauth2_authorization_code_and_multiple_authentication_can_be_comb
async def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down Expand Up @@ -453,7 +456,9 @@ async def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
async def test_oauth2_pkce_and_multiple_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down
9 changes: 7 additions & 2 deletions tests/features/multi_auth/test_and_operator_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import httpx_auth
from httpx_auth.testing import BrowserMock, create_token, token_cache, browser_mock
import httpx_auth._oauth2.authorization_code_pkce


def test_basic_and_api_key_authentication_can_be_combined(httpx_mock: HTTPXMock):
Expand Down Expand Up @@ -394,7 +395,9 @@ def test_oauth2_authorization_code_and_multiple_authentication_can_be_combined(
def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down Expand Up @@ -438,7 +441,9 @@ def test_oauth2_pkce_and_api_key_authentication_can_be_combined(
def test_oauth2_pkce_and_multiple_authentication_can_be_combined(
token_cache, httpx_mock: HTTPXMock, browser_mock: BrowserMock, monkeypatch
):
monkeypatch.setattr(httpx_auth.authentication.os, "urandom", lambda x: b"1" * 63)
monkeypatch.setattr(
httpx_auth._oauth2.authorization_code_pkce.os, "urandom", lambda x: b"1" * 63
)
pkce_auth = httpx_auth.OAuth2AuthorizationCodePKCE(
"https://provide_code", "https://provide_access_token"
)
Expand Down
Loading

0 comments on commit 7ecd221

Please sign in to comment.