Skip to content
Snippets Groups Projects
Commit aa218b58 authored by Johana Supíková's avatar Johana Supíková
Browse files

feat: extend check_saml with logout

parent 89860003
Branches
Tags
1 merge request!32feat: extend check_saml with logout
Pipeline #281532 passed
...@@ -114,28 +114,29 @@ def get_args(): ...@@ -114,28 +114,29 @@ def get_args():
help="string to expect after successful authentication", help="string to expect after successful authentication",
default="OSCIS", default="OSCIS",
) )
parser.add_argument("--idp-host", help="hostname of IdP", default="id.muni.cz")
parser.add_argument( parser.add_argument(
"--hosts", "--logout-url",
nargs="*", help="URL to trigger logout",
default=[], default="https://inet.muni.cz/pub/appctl/logout",
help="space separated list of hostname:ip or hostname:hostname pairs "
+ "for replacing in all URLs",
) )
"""
parser.add_argument( parser.add_argument(
"--other-urls", "--postlogout-string",
nargs="*", help="String to expect after successful logout",
default=[], default="successfully signed out",
help="list of more services for testing single sign-on",
) )
parser.add_argument( parser.add_argument(
"--other-urls-final", "--skip-logout-check",
action="store_true",
help="skip logout check",
)
parser.add_argument("--idp-host", help="hostname of IdP", default="id.muni.cz")
parser.add_argument(
"--hosts",
nargs="*", nargs="*",
default=[], default=[],
help="list of final URLs of the other services for testing single sign-on", help="space separated list of hostname:ip or hostname:hostname pairs "
+ "for replacing in all URLs",
) )
"""
parser.add_argument( parser.add_argument(
"--warn-time", "--warn-time",
type=int, type=int,
...@@ -507,6 +508,19 @@ class SAMLChecker: ...@@ -507,6 +508,19 @@ class SAMLChecker:
"WARNING", "WARNING",
) )
if not self.args.skip_logout_check:
# test logout
logout_html, logout_url = self.initial_request(self.args.logout_url)
if self.args.verbose >= 3:
print(logout_html)
if self.args.postlogout_string not in logout_html:
self.finish(
"Missing the testing string {} in the logout response.".format(
self.args.postlogout_string
),
"CRITICAL",
)
self.finish( self.finish(
"Authentication took {:.2f} seconds".format(elapsed_seconds), "Authentication took {:.2f} seconds".format(elapsed_seconds),
status, status,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment