Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
d603304e
Commit
d603304e
authored
Nov 09, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: cookie attribute match is case-insensitive.
parent
a0dfb228
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
bt5/erp5_oauth_facebook_login/TestTemplateItem/portal_components/test.erp5.testFacebookLogin.py
...lateItem/portal_components/test.erp5.testFacebookLogin.py
+3
-3
bt5/erp5_oauth_google_login/TestTemplateItem/portal_components/test.erp5.testGoogleLogin.py
...mplateItem/portal_components/test.erp5.testGoogleLogin.py
+3
-3
bt5/erp5_openid_connect_client_login/TestTemplateItem/portal_components/test.erp5.testOpenIdConnectLogin.py
...tem/portal_components/test.erp5.testOpenIdConnectLogin.py
+3
-3
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+1
-1
No files found.
bt5/erp5_oauth_facebook_login/TestTemplateItem/portal_components/test.erp5.testFacebookLogin.py
View file @
d603304e
...
@@ -166,9 +166,9 @@ class TestFacebookLogin(ERP5TypeTestCase):
...
@@ -166,9 +166,9 @@ class TestFacebookLogin(ERP5TypeTestCase):
self
.
portal
.
ERP5Site_callbackFacebookLogin
(
code
=
CODE
)
self
.
portal
.
ERP5Site_callbackFacebookLogin
(
code
=
CODE
)
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_facebook_hash='
in
v
]
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_facebook_hash='
in
v
]
self
.
assertIn
(
';
Secure'
,
ac_cookie
)
self
.
assertIn
(
';
secure'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
HttpOnly'
,
ac_cookie
)
self
.
assertIn
(
';
httponly'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
SameSite=Lax'
,
ac_cookie
)
self
.
assertIn
(
';
samesite=lax'
,
ac_cookie
.
lower
()
)
def
test_create_user_in_ERP5Site_createFacebookUserToOAuth
(
self
):
def
test_create_user_in_ERP5Site_createFacebookUserToOAuth
(
self
):
"""
"""
...
...
bt5/erp5_oauth_google_login/TestTemplateItem/portal_components/test.erp5.testGoogleLogin.py
View file @
d603304e
...
@@ -215,9 +215,9 @@ class TestGoogleLogin(GoogleLoginTestCase):
...
@@ -215,9 +215,9 @@ class TestGoogleLogin(GoogleLoginTestCase):
getUserEntry_mock
.
assert_called_once
()
getUserEntry_mock
.
assert_called_once
()
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_google_hash='
in
v
]
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_google_hash='
in
v
]
self
.
assertIn
(
';
Secure'
,
ac_cookie
)
self
.
assertIn
(
';
secure'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
HttpOnly'
,
ac_cookie
)
self
.
assertIn
(
';
httponly'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
SameSite=Lax'
,
ac_cookie
)
self
.
assertIn
(
';
samesite=lax'
,
ac_cookie
.
lower
()
)
def
test_create_user_in_ERP5Site_createGoogleUserToOAuth
(
self
):
def
test_create_user_in_ERP5Site_createGoogleUserToOAuth
(
self
):
"""
"""
...
...
bt5/erp5_openid_connect_client_login/TestTemplateItem/portal_components/test.erp5.testOpenIdConnectLogin.py
View file @
d603304e
...
@@ -134,9 +134,9 @@ class TestOpenIdConnectLogin(OpenIdConnectLoginTestCase):
...
@@ -134,9 +134,9 @@ class TestOpenIdConnectLogin(OpenIdConnectLoginTestCase):
getUserEntry_mock
.
assert_called_once
()
getUserEntry_mock
.
assert_called_once
()
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_openidconnect_hash='
in
v
]
ac_cookie
,
=
[
v
for
(
k
,
v
)
in
response
.
listHeaders
()
if
k
.
lower
()
==
'set-cookie'
and
'__ac_openidconnect_hash='
in
v
]
self
.
assertIn
(
';
Secure'
,
ac_cookie
)
self
.
assertIn
(
';
secure'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
HttpOnly'
,
ac_cookie
)
self
.
assertIn
(
';
httponly'
,
ac_cookie
.
lower
()
)
self
.
assertIn
(
';
SameSite=Lax'
,
ac_cookie
)
self
.
assertIn
(
';
samesite=lax'
,
ac_cookie
.
lower
()
)
def
test_existing_user
(
self
):
def
test_existing_user
(
self
):
state
=
uuid
.
uuid4
().
hex
state
=
uuid
.
uuid4
().
hex
...
...
product/ERP5Security/tests/testERP5Security.py
View file @
d603304e
...
@@ -1586,7 +1586,7 @@ class TestAuthenticationCookie(UserManagementTestCase):
...
@@ -1586,7 +1586,7 @@ class TestAuthenticationCookie(UserManagementTestCase):
self
.
assertIn
(
'; Secure'
,
ac_cookie
)
self
.
assertIn
(
'; Secure'
,
ac_cookie
)
# HttpOnly flag so that javascript cannot access cookie
# HttpOnly flag so that javascript cannot access cookie
self
.
assertIn
(
';
HttpOnly'
,
ac_cookie
)
self
.
assertIn
(
';
httponly'
,
ac_cookie
.
lower
()
)
# SameSite=Lax flag so that cookie is not sent on cross origin requests.
# SameSite=Lax flag so that cookie is not sent on cross origin requests.
# We set Lax (and not strict) so that opening a link to ERP5 from an
# We set Lax (and not strict) so that opening a link to ERP5 from an
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment