Conversation
mchitre
reviewed
Jan 22, 2021
| - Tries to authenticate the Gateway connection with the master container. | ||
| - Must send the credential string using command `{"action":"auth","creds":"boo"}` | ||
| - Must wait for a the first `{"auth": true}` or `{"auth": false}` received from the master and return the result. | ||
| - Must default timeout to 1000 millisecond. |
Collaborator
Author
There was a problem hiding this comment.
Good point. Will change to a suggestion.
| ### `getAgentID()` :: Void -> AgentID | ||
| ### `authenticate` :: String credentials -> Boolean | ||
| - Tries to authenticate the Gateway connection with the master container. | ||
| - Must send the credential string using command `{"action":"auth","creds":"boo"}` |
Member
There was a problem hiding this comment.
Do we need a comment on what creds may contain?
Collaborator
Author
There was a problem hiding this comment.
That would depend on the implementation of the Firewall that is being used.
Member
There was a problem hiding this comment.
Yes, but just a comment on this to state so?
| - Sends a _Message_ to the recipient indicated in the message. | ||
|
|
||
| ### `receive()` :: (Object filter), (Int timeout) -> Message | ||
| ### `receive()` :: (Object filter), (Int timeout) -> Message | Error |
Member
There was a problem hiding this comment.
returning Error makes sense for some languages, other places it is throwing error. Do we need to define it as a return value?
|
|
||
| ### `request()` :: Message, (Int timeout) -> Message | ||
| - Sends a request and waits for a response. | ||
| - May return an `Error` of type `AuthorizationError` if a `{"auth": false}` is seen while waiting for the response |
Member
There was a problem hiding this comment.
Do we want to go update all gateways to throw exceptions?
5 tasks
39da9e2 to
38b02e9
Compare
28154c5 to
1dabc1f
Compare
4824fe8 to
57295e1
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With the added support for "auth" (Authentication/Authorization) in fjage's protocol, I have updated the Gateway.md document which documents the requirements for Gateways.
Summary :
authenticatemethod on the Gatewayreceivemethod will return either theMessage|Error|nullwhere the Error(AuthorizationError) can be returned if there was an{auth: false}when a certain message was received.{auth: false}and must returnErrorin that caseDiscussion :
{auth: false}, especially if multiple messages are sent.send, and the messages gets an{auth: false}response, it will be ignored. Is that OK?