Github docs + self notes

This commit is contained in:
turt2live 2017-06-11 00:06:34 -06:00
parent 27a5191ebe
commit 91ac5bb3b0
2 changed files with 64 additions and 1 deletions

View File

@ -60,17 +60,45 @@ TODO
}
```
### `GET /api/v1/dimension/integrations/{roomId}/{type}/{integrationType}/state`
### `GET /api/v1/dimension/integrations/{roomId}/{type}/{integrationType}/state?scalar_token=your_token_here`
**Parameters**
* `{roomId}` - The room ID to get the integration state in
* `{type}` - The integration type (eg: `bot`, `complex-bot`, `bridge`, etc)
* `{integrationType}` - The integration subtype (eg: `irc`, `rssbot`, `giphy`, etc)
* `scalar_token` - The scalar (dimension) token to authenticate with
**Response**
An object representing the integration-specific state. See the documentation for the desired integration for more information.
### `GET /api/v1/dimension/{type}/{integrationType}/oauth/url?redirect=your_url_here&scalar_token=your_token_here`
**Parameters**
* `{type}` - The integration type (eg: `bot`, `complex-bot`, `bridge`, etc)
* `{integrationType}` - The integration subtype (eg: `irc`, `rssbot`, `giphy`, etc)
* `redirect` - The URL to redirect to when complete
* `scalar_token` - The scalar (dimension) token to authenticate with
**Example Response**
```
{
"url": "https://github.com/somewhere?with=params"
}
```
### `DELETE /api/v1/dimension/{type}/{integrationType}/oauth?scalar_token=your_token_here`
**Parameters**
* `{type}` - The integration type (eg: `bot`, `complex-bot`, `bridge`, etc)
* `{integrationType}` - The integration subtype (eg: `irc`, `rssbot`, `giphy`, etc)
* `scalar_token` - The scalar (dimension) token to authenticate with
**Example Response**
```
{}
```
## Integration State Information
### Simple Bots
@ -96,6 +124,31 @@ Do not hold state.
}
```
#### Github
```
{
// Mutable using state API
"repositories": {
"turt2live/matrix-dimension": ["push", "pull_request", "issues", "issue_comment", "pull_request_review_comment", "labels", "milestones", "assignments"],
"turt2live/matrix-voyager-bot": []
},
// Read only.
"authenticated": true
}
```
*Unauthenticated response*
```
{
// Read only.
"repositories": {},
// Read only.
"authenticated": false
}
```
### Bridges
#### IRC

10
docs/notes/github.md Normal file
View File

@ -0,0 +1,10 @@
# Config dialog
* Can enable bot without auth.
* Can set default repo without auth.
* Auth is only required for repository notifications.
* Auth URL generation should use Dimension as the final redirect. Use param to indicate config dialog to open on success
* Use current iframe (if possible) for auth. Avoid popups.
**Note**: In-chat auth links won't work. That's [#2](https://github.com/turt2live/matrix-dimension/issues/2).