-
Notifications
You must be signed in to change notification settings - Fork 33
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
Session ID and constructor #400
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9ae6018
set host and port from client if available
jburel dbf00ab
set session from client
jburel 72d735c
do not close session associated to client
jburel ee24282
remove uncessary check
jburel f30d62a
raise exception if hosts and ports do not match
jburel 65f9d94
fix syntax
jburel 150803b
set the parameters explicitly
jburel 489c78b
set secure flag from client
jburel dd97de9
return correct flag using isSecure
jburel 704e50f
set session ID only
jburel e2025ed
reset sessionUuid
jburel 88d2453
return secure flag
jburel a91f391
check if it is the same session
jburel 4dc40d6
remove comment
jburel e989c33
remove conditional
jburel 2474872
review how secure flag is set
jburel 01fc825
revert to original implementation
jburel 64bf1f9
check compatibility of secure flag
jburel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that modifying the contract of the API before a connection happens e.g. in a scenario like the following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raises another question in that case
When a client is not specified, a
secure
client is created regardless of thesecure
parameter specified. But when a client is specified, it can be secured or unsecured.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial connection will (and should) always use an encrypted client. But
omero-py/src/omero/gateway/__init__.py
Line 2074 in 4dc40d6
_createSession
might create an unencrypted client depending on the state ofsecure
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i get that
but as I said the client specified could be insecured and in that case even if
secure=True
is passedconn.isSecure()
will befalse
.Do we want in that case to enforce a "secure" client specified during init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the scenario we are discussing is
Interestingly, part of the changes proposed here are to throw an exception on the following use cases
My feeling would be to say
secure
should behave in the same way i.e. if the constructor receives conflicting information from its inputs, an exception should be sent back to the caller. Unlikehost
andport
the default ofsecure
isFalse
. A possible (untested) solution would be to change the default toNone
to cater for this scenario (and internally default toFalse
if no client object is passed).