Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAL2 Changes #383

Merged
merged 77 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
883f250
AAL2 Changes
NautiyalVikas1 Jul 29, 2024
332ab30
AAL2 Changes
NautiyalVikas1 Jul 29, 2024
4e244a2
AAL2 Changes
NautiyalVikas1 Jul 29, 2024
afdd215
AAL2 Changes
NautiyalVikas1 Jul 29, 2024
095366e
AAL2 Changes
NautiyalVikas1 Jul 30, 2024
d0c36ba
AAL2 Changes
NautiyalVikas1 Jul 30, 2024
d7b2ba8
AAL2 Changes
NautiyalVikas1 Jul 30, 2024
9c4e38a
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
7cf56fe
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
4a01e03
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
66170d6
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
b8b401f
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
6ddc90b
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
08d3e69
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
cfa73b8
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
0de382a
AAL2 Changes
NautiyalVikas1 Jul 31, 2024
bcf0a1c
AAL2 Changes
NautiyalVikas1 Aug 2, 2024
3de53c4
AAL2 Changes
NautiyalVikas1 Aug 2, 2024
3e6e1de
AAL2 Changes
NautiyalVikas1 Aug 2, 2024
0338875
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
b208285
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
dccc436
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
92e8132
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
48f17a9
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
031ae72
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
fc7c686
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
545f5ae
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
5a9134e
AAL2 Changes
NautiyalVikas1 Aug 5, 2024
1a97c83
Test case failure in attach logging due to assert isseue
NautiyalVikas1 Aug 5, 2024
3c71e4a
Test case failure in attach logging due to assert isseue
NautiyalVikas1 Aug 5, 2024
074c51b
APM-5429 get auth level for token exchange and update config for inte…
sophieclayton12-nhs Aug 6, 2024
911de12
APM-5429 internal-dev-int fix
sophieclayton12-nhs Aug 6, 2024
6e2ca8d
Test case failure
NautiyalVikas1 Aug 6, 2024
c7a42f7
APM-5429 backchannel logout parametrize test fixes
sophieclayton12-nhs Aug 6, 2024
fb282a4
Pytest Version Update
NautiyalVikas1 Aug 6, 2024
13d6428
Pytest Version Update
NautiyalVikas1 Aug 6, 2024
f3f6070
Pytest Version Update
NautiyalVikas1 Aug 6, 2024
8ac4e9c
Pytest Version Update
NautiyalVikas1 Aug 6, 2024
c7d6300
Updated Test Cases for test_token_exchange
NautiyalVikas1 Aug 6, 2024
8b03065
Updated Test Cases for test_token_exchange
NautiyalVikas1 Aug 6, 2024
4a95ed6
Updated Test Cases for test_attach_logging_field
NautiyalVikas1 Aug 6, 2024
a96882c
Updated Test Cases for test_attach_logging_field
NautiyalVikas1 Aug 6, 2024
f871ebb
Updated Test Cases for Splunk_Logging
NautiyalVikas1 Aug 7, 2024
4148834
Pushing latest PyJWT
NautiyalVikas1 Aug 7, 2024
2b89493
Removing Duplicate for Sonar Quality Gate Issue
NautiyalVikas1 Aug 7, 2024
f7dc210
Removing Duplicate for Sonar Quality Gate Issue
NautiyalVikas1 Aug 7, 2024
4e025a2
Removing Duplicate for Sonar Quality Gate Issue
NautiyalVikas1 Aug 7, 2024
73647dc
Removing Duplicate for Sonar Quality Gate Issue
NautiyalVikas1 Aug 7, 2024
da09c48
Removing Duplicate for Sonar Quality Gate Issue
NautiyalVikas1 Aug 8, 2024
4d74d2c
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
824e3ce
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
aa75310
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
79d14fb
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
5fb1de4
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
e7caafe
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
d4a3214
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
f1bb15e
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
d4f9af7
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
f889a8e
test_splunk_logging update
NautiyalVikas1 Aug 8, 2024
ee1933f
Resolve Client Cred Test
NautiyalVikas1 Aug 9, 2024
c47eabc
Resolve Client Cred Test
NautiyalVikas1 Aug 9, 2024
dd388f1
Resolve Client Cred Test
NautiyalVikas1 Aug 9, 2024
f74dfed
Resolve Client Cred Test
NautiyalVikas1 Aug 9, 2024
019a2dc
Resolve Client Cred Test
NautiyalVikas1 Aug 12, 2024
cdcff24
Resolve Client Cred Test
NautiyalVikas1 Aug 12, 2024
409bd4e
APM-5429 use symmetric key when testing HS algorithms
sophieclayton12-nhs Aug 12, 2024
d9e667f
APM-5429 formatting
sophieclayton12-nhs Aug 12, 2024
908d582
APM-5429 additional test fix for symmetric alg
sophieclayton12-nhs Aug 12, 2024
327853d
APM-5429 fixed parametrize issue
sophieclayton12-nhs Aug 12, 2024
7ef6cbe
APM-5429 test _token _exchange issue fix
NautiyalVikas1 Aug 12, 2024
b29fed1
APM-5429 correct redirect URL for PR CIS2
sophieclayton12-nhs Aug 13, 2024
06aafa4
APM-5429 forward acr_values parameter for combined CIS2 auth
sophieclayton12-nhs Aug 20, 2024
b15bfde
APM-5429 ignore unresolved var
sophieclayton12-nhs Aug 20, 2024
05ca747
APM-5429 added product scope tests for different auth levels
sophieclayton12-nhs Aug 21, 2024
6177f2e
APM-5429 test clean up
sophieclayton12-nhs Aug 21, 2024
1816a31
APM-5429 test clean up
sophieclayton12-nhs Aug 21, 2024
06b5add
APM-5429 update test_product_scopes.py to be clearer when testing aal3
sophieclayton12-nhs Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/tests/logging/test_attach_logging_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ def test_access_token_fields_for_logging(
token_attributes = self.get_token_details(token_data)

for attribute, _ in expected_token_attributes.items():
assert token_attributes[attribute] == expected_token_attributes[attribute]
assert token_attributes[attribute] == expected_token_attributes[attribute]
65 changes: 50 additions & 15 deletions e2e/tests/logging/test_splunk_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

class TestSplunkLoggingFields:
"""Test suite for testing logging fields are sent to splunk"""
# We are on our second generation of mock identity provider for
# healthcare_worker access (CIS2). This allows you to log-in using a
# username.
MOCK_CIS2_USERNAMES = {
"aal1": ["656005750110"],
"aal2": ["656005750109", "656005750111", "656005750112"],
"aal3": ["656005750104", "656005750105", "656005750106"],
}

@pytest.mark.happy_path
@pytest.mark.logging
Expand All @@ -24,15 +32,24 @@ class TestSplunkLoggingFields:
# CIS2
pytest.param(
False,
"656005750104",
username,
"apim-mock-nhs-cis2",
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
level=level,
login_form={"username": username},
force_new_token=True,
),
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
@pytest.mark.happy_path
@pytest.mark.logging
@pytest.mark.parametrize(
"is_nhs_login,username,provider",
[
# NHS Login
pytest.param(
True,
Expand Down Expand Up @@ -95,16 +112,25 @@ def test_splunk_fields_for_authorize_endpoint(
# CIS2
pytest.param(
False,
"656005750104",
username,
"apim-mock-nhs-cis2",
"aal3",
level,
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
level=level,
login_form={"username": username},
force_new_token=True,
),
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
]
)
@pytest.mark.happy_path
@pytest.mark.logging
@pytest.mark.parametrize(
"is_nhs_login,username,provider,level",
[
# NHS Login
pytest.param(
True,
Expand Down Expand Up @@ -170,16 +196,25 @@ def test_splunk_fields_for_callback_endpoint(
# CIS2
pytest.param(
False,
"656005750104",
username,
"apim-mock-nhs-cis2",
"aal3",
level,
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
level=level,
login_form={"username": username},
force_new_token=True,
),
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
@pytest.mark.happy_path
@pytest.mark.logging
@pytest.mark.parametrize(
"is_nhs_login,username,provider,level",
[
# NHS Login
pytest.param(
True,
Expand All @@ -192,7 +227,7 @@ def test_splunk_fields_for_callback_endpoint(
login_form={"username": "9912003071"},
force_new_token=True,
),
),
)
],
)
def test_splunk_fields_for_token_endpoint_authorization_code(
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/oauth/test_authorization_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,4 +1256,4 @@ def test_nhs_login_refresh_tokens_generated_with_expected_expiry_combined_auth(
Test that refresh tokens generated via NHS Login have an expiry time of 1 hour for combined authentication.
"""
assert _nhsd_apim_auth_token_data["expires_in"] == "599"
assert _nhsd_apim_auth_token_data["refresh_token_expires_in"] == "3599"
assert _nhsd_apim_auth_token_data["refresh_token_expires_in"] == "3599"
80 changes: 60 additions & 20 deletions e2e/tests/oauth/test_backchannel_logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

class TestBackChannelLogout:
"""A test suite for back-channel logout functionality"""
# We are on our second generation of mock identity provider for
# healthcare_worker access (CIS2). This allows you to log-in using a
# username.
MOCK_CIS2_USERNAMES = {
"aal1": ["656005750110"],
"aal2": ["656005750109", "656005750111", "656005750112"],
"aal3": ["656005750104", "656005750105", "656005750106"],
}

def create_logout_token(
self,
Expand Down Expand Up @@ -60,11 +68,19 @@ def create_logout_token(
return logout_token_jwt

@pytest.mark.happy_path
@pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
force_new_token=True,
@pytest.mark.parametrize(
[
pytest.param(
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level=level,
login_form={"username": username},
force_new_token=True,
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
def test_backchannel_logout_happy_path(
self, _nhsd_apim_auth_token_data, nhsd_apim_proxy_url
Expand Down Expand Up @@ -100,11 +116,19 @@ def test_backchannel_logout_happy_path(
assert userinfo_resp.status_code == 401

@pytest.mark.happy_path
@pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
force_new_token=True,
@pytest.mark.parametrize(
[
pytest.param(
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level=level,
login_form={"username": username},
force_new_token=True,
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
def test_backchannel_logout_user_refresh_token(
self, _nhsd_apim_auth_token_data, nhsd_apim_proxy_url, _test_app_credentials
Expand Down Expand Up @@ -164,11 +188,19 @@ def test_backchannel_logout_user_refresh_token(
assert post_refresh_userinfo_resp.status_code == 401

# Request sends a JWT has missing or invalid claims of the following problems, returns a 400
@pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
force_new_token=True,
@pytest.mark.parametrize(
[
pytest.param(
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level=level,
login_form={"username": username},
force_new_token=True,
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
@pytest.mark.parametrize(
"claims,status_code,error_message",
Expand Down Expand Up @@ -318,11 +350,19 @@ def test_claims(
assert back_channel_resp.json()["error_description"] == error_message

# Request sends JWT that cannot be verified returns a 400
@pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level="aal3",
login_form={"username": "656005750104"},
force_new_token=True,
@pytest.mark.parametrize(
[
pytest.param(
marks=pytest.mark.nhsd_apim_authorization(
access="healthcare_worker",
level=level,
login_form={"username": username},
force_new_token=True,
),
)
for level, usernames in MOCK_CIS2_USERNAMES.items()
for username in usernames
],
)
def test_invalid_jwt(self, _nhsd_apim_auth_token_data, nhsd_apim_proxy_url):
access_token = _nhsd_apim_auth_token_data["access_token"]
Expand Down
Loading
Loading