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

Adding support for HTTPBasicAuth Property from AccountService.v1_15 Schema #77

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions redfish_protocol_validator/service_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,34 @@ def test_odata_version_header(sut: SystemUnderTest):
test_header_value(sut, header, '4.0', uri, method, response,
Assertion.RESP_HEADERS_ODATA_VERSION)

def test_www_authenticate_requirement(sut: SystemUnderTest):
"""Check for HTTPBasicAuth Property"""
response = sut.get_response('GET', sut.account_service_uri)

if response.ok:
data = response.json()
key = 'HTTPBasicAuth'
if key in data:
if data[key] != "Enabled":
# could be either Disabled or Unadvertised
return False
else:
return True
# Any Failure will be considered as HTTPBasicAuth not present
return True



def test_www_authenticate_header(sut: SystemUnderTest):
"""Perform tests for Assertion.RESP_HEADERS_WWW_AUTHENTICATE."""

if(False == test_www_authenticate_requirement(sut)):
msg = ('The WWW-Authenticate header is not tested because value of HTTPBasicAuth '
'is either Disabled or Unadvertised ')
sut.log(Result.NOT_TESTED, '', '', '',
Assertion.RESP_HEADERS_WWW_AUTHENTICATE, msg)
return

# a selection of URis to test
uris = [sut.sessions_uri, sut.mgr_net_proto_uri, sut.systems_uri,
sut.accounts_uri, sut.account_service_uri,
Expand Down