-
Notifications
You must be signed in to change notification settings - Fork 13
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
Updating gateway doc for authentication support #165
base: master
Are you sure you want to change the base?
Conversation
- 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. |
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.
Is 1000 ms a MUST?
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.
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"}` |
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.
Do we need a comment on what creds
may contain?
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.
That would depend on the implementation of the Firewall that is being used.
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.
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 |
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.
returning Error
makes sense for some languages, other places it is throwing error. Do we need to define it as a return value?
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.
As discussed in #167, can't do this generally.
@@ -37,6 +43,7 @@ All fjåge Gateway implementations should implement the following classes and me | |||
|
|||
### `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 |
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.
Do we want to go update all gateways to throw exceptions?
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.
As discussed in #167, can't do this generally.
39da9e2
to
38b02e9
Compare
28154c5
to
1dabc1f
Compare
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 :
authenticate
method on the Gatewayreceive
method will return either theMessage|Error|null
where the Error(AuthorizationError) can be returned if there was an{auth: false}
when a certain message was received.{auth: false}
and must returnError
in 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?