-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,24 @@ All fjåge Gateway implementations should implement the following classes and me | |
- Must return a `null` if the connection to master container fails on the first attempt. | ||
- May support auto-reconnect, where, once a connection with the master container is established if the connection fails, the Gateway tries to reconnect automatically. | ||
|
||
### `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"}` | ||
- 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Will change to a suggestion. |
||
|
||
### `getAgentID()` :: Void -> AgentID | Error | ||
- Returns the _AgentID_ associated with the gateway. | ||
- May be implemented as a property `agentID` on the _Gateway_. | ||
|
||
### `close()` :: Void -> Void | ||
- Closes the _Gateway_. | ||
- Must send a `{"alive": false}` message to the master container before closing. | ||
|
||
### `send()` :: Message -> Boolean | ||
### `send()` :: Message -> Boolean | ||
- 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 commentThe reason will be displayed to describe this comment to others. Learn more. returning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in #167, can't do this generally. |
||
- Returns a _Message_ received by the agent. | ||
- May accept optional filter and timeout arguments. | ||
- May support filter of type `MessageClass class` to filter for a message of a specific class. | ||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in #167, can't do this generally. |
||
- Must not **block** if timeout is 0. | ||
- Must **block** indefinitely if timeout is -1. | ||
- Must **block** for timeout milliseconds otherwise. | ||
|
@@ -62,12 +69,14 @@ All fjåge Gateway implementations should implement the following classes and me | |
### `unsubscribe()` :: AgentID -> Boolean | ||
- Unsubscribes the gateway from a given topic. | ||
|
||
### `agentForService()` :: String -> AgentID | ||
### `agentForService()` :: String -> AgentID | Error | ||
- Finds an agent that provides a named service. | ||
- Must default timeout to 1000 millisecond. | ||
|
||
### `agentsForService()` :: String -> [AgentID] | ||
### `agentsForService()` :: String -> [AgentID] | Error | ||
- Find all agents that provides a named service. | ||
- Returns an array/list. | ||
- Must default timeout to 1000 millisecond. | ||
|
||
### `flush()` :: Void -> Void | ||
- Flushes the incoming queue in the `Gateway`. | ||
|
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?