Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions keywords/MobileRestClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ def get_auth_type(auth):
if auth is None:
return AuthType.none

print("\nauth type in get auth: ", auth)
if isinstance(auth, tuple) and auth[0] == "SyncGatewaySession":
auth_type = AuthType.session
else:
auth_type = AuthType.http_basic
print("\nauth type return in get auth: ", auth_type)

logging.debug("Using auth type: {}".format(auth_type))
return auth_type
Expand Down Expand Up @@ -1531,16 +1533,20 @@ def get_all_docs(self, url, db, auth=None, include_docs=False):
""" Get all docs for a database via _all_docs """

auth_type = get_auth_type(auth)
print("\nauth type: ", auth_type)

params = {}
if include_docs:
params["include_docs"] = "true"

if auth_type == AuthType.session:
print("\nauth type session")
resp = self._session.get("{}/{}/_all_docs".format(url, db), params=params, cookies=dict(SyncGatewaySession=auth[1]))
elif auth_type == AuthType.http_basic:
print("\nauth type basic")
resp = self._session.get("{}/{}/_all_docs".format(url, db), params=params, auth=auth)
else:
print("\nno auth type")
resp = self._session.get("{}/{}/_all_docs".format(url, db), params=params)

log_r(resp)
Expand Down
2 changes: 2 additions & 0 deletions testsuites/CBLTester/upgrade_tests/test_cbl_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def test_upgrade_cbl(params_from_base_suite_setup):
c.reset(sg_config_path=sg_config)

auth = need_sgw_admin_auth and (RBAC_FULL_ADMIN['user'], RBAC_FULL_ADMIN['pwd']) or None
print("\nauth top: ", auth)
sg_client.create_user(sg_admin_url, sg_db, username, password, channels=["*"], auth=auth)
authenticator = Authenticator(base_url)
cookie, session_id = sg_client.create_session(sg_admin_url, sg_db, username, auth=auth)
Expand Down Expand Up @@ -244,6 +245,7 @@ def test_upgrade_cbl(params_from_base_suite_setup):
replicator.stop(repl)

new_cbl_doc_ids = db.getDocIds(cbl_db, limit=40000)
print("\nauthorization: ", auth)
cbs_docs = sg_client.get_all_docs(sg_admin_url, sg_db, session, auth=auth)["rows"]
cbs_doc_ids = [doc["id"] for doc in cbs_docs]
for new_doc_id in new_doc_ids:
Expand Down