Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
sso
Commits
48329ad3
Commit
48329ad3
authored
3 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
More py3 fixes
parent
90107820
No related branches found
No related tags found
1 merge request
!4
Drop Python 2 support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mod_sso/test/httpd_integration_test.py
+13
-13
13 additions, 13 deletions
src/mod_sso/test/httpd_integration_test.py
with
13 additions
and
13 deletions
src/mod_sso/test/httpd_integration_test.py
+
13
−
13
View file @
48329ad3
...
...
@@ -237,7 +237,7 @@ class HttpdIntegrationTestBase(unittest.TestCase):
"
status
"
:
401
}),
]
for
name
,
check
in
checks
:
for
i
in
x
range
(
repeats
):
for
i
in
range
(
repeats
):
print
(
'
CHECKING %s (%d of 10)
'
%
(
name
,
i
),
check
)
status
,
body
,
location
=
_query
(
check
[
"
url
"
],
host
=
check
.
get
(
"
http_host
"
),
...
...
@@ -250,7 +250,7 @@ class HttpdIntegrationTestBase(unittest.TestCase):
name
,
check
[
"
url
"
],
status
,
check
[
"
status
"
]))
if
"
body
"
in
check
:
self
.
assertTrue
(
check
[
"
body
"
]
in
body
,
check
[
"
body
"
]
.
encode
(
'
utf-8
'
)
in
body
,
"
test:
'
%s
'
\n
body mismatch for %s (exp
'
%s
'
)
"
%
(
name
,
check
[
"
url
"
],
check
[
"
body
"
]))
if
"
location
"
in
check
:
...
...
@@ -324,7 +324,7 @@ class HttpdIntegrationTest(HttpdIntegrationTestBase):
# between requests.
n
=
100
errors
=
0
for
i
in
x
range
(
n
):
for
i
in
range
(
n
):
cookie
=
'
SSO_test=%s
'
%
self
.
_ticket
()
status
,
body
,
location
=
_query
(
"
/index.html
"
,
cookie
=
cookie
)
self
.
assertEquals
(
200
,
status
)
...
...
@@ -336,10 +336,10 @@ class HttpdIntegrationTest(HttpdIntegrationTestBase):
cookie
=
mkcookie
(
tkt
))
self
.
assertEquals
(
200
,
status
)
self
.
assertTrue
(
body
)
self
.
assertTrue
(
"
REMOTE_USER=testuser
"
in
body
)
self
.
assertTrue
(
"
SSO_USER=testuser
"
in
body
)
self
.
assertTrue
(
"
SSO_SERVICE=service.example.com/
"
in
body
)
self
.
assertTrue
((
"
SSO_TICKET=
"
+
tkt
)
in
body
)
self
.
assertTrue
(
b
"
REMOTE_USER=testuser
"
in
body
)
self
.
assertTrue
(
b
"
SSO_USER=testuser
"
in
body
)
self
.
assertTrue
(
b
"
SSO_SERVICE=service.example.com/
"
in
body
)
self
.
assertTrue
((
b
"
SSO_TICKET=
"
+
tkt
.
encode
(
'
utf-8
'
)
)
in
body
)
def
test_sso_login
(
self
):
# Call the /sso_login endpoint, verify that it sets the local
...
...
@@ -374,7 +374,7 @@ class HttpdIntegrationTestWithNonces(HttpdIntegrationTestBase):
CONFIG
=
'
test-httpd-2.4-nonces.conf
'
def
setUp
(
self
):
with
open
(
'
session.key
'
,
'
w
'
)
as
fd
:
with
open
(
'
session.key
'
,
'
w
b
'
)
as
fd
:
fd
.
write
(
os
.
urandom
(
32
))
HttpdIntegrationTestBase
.
setUp
(
self
)
...
...
@@ -388,11 +388,11 @@ class HttpdIntegrationTestWithNonces(HttpdIntegrationTestBase):
cookie
=
mkcookie
(
tkt
))
self
.
assertEquals
(
200
,
status
)
self
.
assertTrue
(
body
)
self
.
assertTrue
(
"
REMOTE_USER=testuser
"
in
body
)
self
.
assertTrue
(
"
SSO_USER=testuser
"
in
body
)
self
.
assertTrue
(
"
SSO_SERVICE=service.example.com/
"
in
body
)
self
.
assertTrue
((
"
SSO_TICKET=
"
+
tkt
)
in
body
)
self
.
assertTrue
(
"
SSO_NONCE=NONCE1
"
in
body
)
self
.
assertTrue
(
b
"
REMOTE_USER=testuser
"
in
body
)
self
.
assertTrue
(
b
"
SSO_USER=testuser
"
in
body
)
self
.
assertTrue
(
b
"
SSO_SERVICE=service.example.com/
"
in
body
)
self
.
assertTrue
(
b
(
"
SSO_TICKET=
"
+
tkt
.
encode
(
'
utf-8
'
)
)
in
body
)
self
.
assertTrue
(
b
"
SSO_NONCE=NONCE1
"
in
body
)
def
test_login_workflow
(
self
):
self
.
_login_workflow
(
"
service.example.com
"
,
"
/protected-user/index.html
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment