File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
## [ unreleased]
10
10
11
11
12
+ ## Fixes
13
+
14
+ - Anti csrf check should happen only when access token is passed while session is optional
15
+
12
16
## [ 0.14.6] - 2023-06-22
13
17
14
18
### Changes and fixes
Original file line number Diff line number Diff line change @@ -719,7 +719,7 @@ async def test_that_verify_session_doesnt_always_call_core():
719
719
assert session3 .refresh_token is not None
720
720
721
721
assert (
722
- AllowedProcessStates .CALLING_SERVICE_IN_VERIFYG
722
+ AllowedProcessStates .CALLING_SERVICE_IN_VERIFY
723
723
not in ProcessState .get_instance ().history
724
724
)
725
725
@@ -741,11 +741,13 @@ async def test_that_verify_session_doesnt_always_call_core():
741
741
async def test_anti_csrf_header_via_custom_header_check_happens_only_when_access_token_is_provided (
742
742
driver_config_client : TestClient ,
743
743
):
744
- args = get_st_init_args ([session .init (anti_csrf = "VIA_CUSTOM_HEADER" , get_token_transfer_method = lambda * _ : "cookie" )]) # type: ignore
744
+ args = get_st_init_args ([session .init (anti_csrf = "VIA_CUSTOM_HEADER" , get_token_transfer_method = lambda * _ : "cookie" )]) # type: ignore
745
745
init (** args ) # type: ignore
746
746
start_st ()
747
747
748
- response = driver_config_client .post ("/create" )
748
+ response = driver_config_client .post (
749
+ "/create"
750
+ )
749
751
assert response .status_code == 200
750
752
751
753
# With access token:
@@ -755,8 +757,7 @@ async def test_anti_csrf_header_via_custom_header_check_happens_only_when_access
755
757
assert response .json () == {"message" : "try refresh token" }
756
758
757
759
# with RID:
758
- response = driver_config_client .post (
759
- "/sessioninfo-optional" ,
760
+ response = driver_config_client .post ("/sessioninfo-optional" ,
760
761
headers = {
761
762
"rid" : "session" ,
762
763
},
You can’t perform that action at this time.
0 commit comments