Skip to content

Commit

Permalink
check that the secure is coming from client if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jburel committed Apr 2, 2024
1 parent 20d9230 commit 22d6857
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,20 @@ def testConnectWithSessionId(self, gatewaywrapper):
sid = client.getSessionId()
with BlitzGateway(client_obj=client) as conn:
assert conn.connect(sUuid=sid), "Should be connected"

def testSecure(self, gatewaywrapper):
gatewaywrapper.loginAsAdmin()
username = "secure_test_user"
password = "foobar"
last_name = "secure"
test_user = dbhelpers.UserEntry(username, password,
firstname='User',
lastname=last_name)
test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd)
gatewaywrapper.doDisconnect()

client = omero.client()
client.createSession(username, password)
assert not client.isSecure()
with BlitzGateway(client_obj=client, secure=True) as conn:
assert not conn.isSecure()

0 comments on commit 22d6857

Please sign in to comment.