Kegan Dougal
aea0e3a104
Split up github service into 2 services
One for commands/expansions, the other for webhooks. Call the type 'github-webhook'.
8 years ago
Kegsay
dc9872bbd8
Merge pull request #48 from matrix-org/kegan/giphy
Add Giphy integration
8 years ago
Kegan Dougal
b2e301651b
Be less excited about logging; use res.ContentLength
8 years ago
Kegan Dougal
fcd4b5adc7
Comments
8 years ago
Kegan Dougal
6f2d9dc72c
Add giphy integration
8 years ago
Kegsay
16e7bf3957
Merge pull request #47 from matrix-org/kegan/bot-options
Support bot options and implement github bot options for default repos
8 years ago
Kegan Dougal
d100d8ddd4
Don't share the matchingGroups array across multiple functions because that's insane
8 years ago
Kegan Dougal
95d8f86fa4
Combine together short and long form regexp matching to avoid expanding twice on long form
8 years ago
Kegan Dougal
8b44f3658c
Support bot options and implement github bot options for default repos
- Add a new `bot_options` table
- Allow github expansions/commands to omit the owner/repo and use a default if set
8 years ago
Kegan Dougal
15dc39dedc
Add an inviter key when joining rooms
8 years ago
Kegsay
761823d423
Merge pull request #46 from matrix-org/kegan/github-join-room-on-register
Join webhook rooms on Register()
8 years ago
Kegsay
35f83a6c67
Merge pull request #45 from matrix-org/kegan/github-remove-hooks-on-webhook-event
Delete webhooks when receive webhook events for no known repository
8 years ago
Kegan Dougal
6924f44379
Merge branch 'kegan/github-mutex-on-register' into kegan/github-remove-hooks-on-webhook-event
8 years ago
Kegsay
324231cf00
Merge pull request #44 from matrix-org/kegan/github-mutex-on-register
Mutex-guard services with the same ID being modified concurrently
8 years ago
Kegan Dougal
0e5716da1a
Add TODO explaining why the mutex storage is bad and what a better solution is
8 years ago
Kegan Dougal
4772d10cbd
Join webhook rooms on Register()
Also fix a NPE when there was no old service.
8 years ago
Kegan Dougal
b32cb06b74
Delete webhooks when receive webhook events for no known repository
8 years ago
Kegan Dougal
26a17ab3d6
Mutex-guard services with the same ID being modified concurrently
Also treat 422 "already exists" errors as success.
8 years ago
Kegsay
313c4ed92a
Merge pull request #43 from matrix-org/kegan/github-make-webhooks-on-register
Create delta webhooks in GithubService.Register()
8 years ago
Kegan Dougal
0f60be3ffc
Create delta webhooks in GithubService.Register()
Remove PostRegister() as it isn't used for anything anymore. Add TODO marker
for guarding against race conditions.
8 years ago
Kegan Dougal
5ac36551a6
Block comment on Github Register() to explain semantics and edge cases
8 years ago
Kegsay
9b649f001d
Merge pull request #39 from matrix-org/kegan/gh-service-client-id-is-opt
Client ID is optional when creating Github services
8 years ago
Kegan Dougal
569587aa6b
Log for nonsensical configs
8 years ago
Kegan Dougal
0ad4fc6135
Add TODO to parse the rest of the config to make sure no webhook config was supplied
8 years ago
Kegan Dougal
699b003c15
Client ID is optional when creating Github services
We only use it for making webhooks (to determine which GH account to load up).
We need it to be optional for the global GH bot to work (which has no account
and uses the account of whoever issued the !command to do the work).
8 years ago
Kegsay
d662d2e678
Merge pull request #38 from matrix-org/kegan/sync-on-startup
Start client sync streams on startup
8 years ago
Kegan Dougal
c7114907f6
Auto-join rooms if set in config
8 years ago
Kegan Dougal
8f8dec5539
Sync rooms on startup
8 years ago
Kegsay
42b547a5c5
Merge pull request #36 from matrix-org/kegan/github-cmd-expan-service
Change how Services are notified for incoming !commands and expansions
8 years ago
Kegan Dougal
b923d364ed
Indexes!
8 years ago
Kegan Dougal
97a292c65f
Change how Services are notified for incoming !commands and expansions
Previously, we would notify `Services` based on matching the `room_id` of the
event with a list of `RoomIDs()` which the service returned.
Now we notify `Services` based on matching the `user_id` of the client listening
for events. This means that the service will receive more events because there
isn't a filter on a set of room IDs.
This is required in order to implement "auto-join on invite" semantics for
Services, as the room ID is not known at that point in time.
8 years ago
Kegan Dougal
b45afac270
Add flags to control if the GH Service should handle expansions/commands
8 years ago
Kegan Dougal
25fb7ca0d9
Return Location headers on 302s
WriteHeader must come AFTER Header().Set() else it does nothing, yay!
8 years ago
Kegan Dougal
b643b8c797
Redirect even if already authed if a redirect URL is given
8 years ago
Kegan Dougal
de3dc5f33c
More logging
8 years ago
Kegan Dougal
479055748c
Log what the clients send us for debugging purposes
8 years ago
Kegan Dougal
cacdc632a4
More logging
8 years ago
Kegan Dougal
4d9574e6da
More logging
8 years ago
Kegan Dougal
ec9e462eab
Linting
8 years ago
Kegan Dougal
17824f74dc
Don't spam github with webhook creation requests which uses up our request rate limits
8 years ago
Kegan Dougal
cc076d0e9e
Paginate repo list
8 years ago
Kegan Dougal
6e2f35d463
Actually specify scopes...
8 years ago
Kegan Dougal
c3aabd57ea
Check for a valid session before exchanging codes
8 years ago
Kegsay
c38cf48b26
Merge pull request #35 from matrix-org/kegan/base64-paths
Base64 redirect and webhook paths
8 years ago
Kegan Dougal
24a2ffc6bb
Also apply base64 encoding to realm redirect paths and use URL-safe base64
8 years ago
Kegan Dougal
8e6955efd5
Base64 encode the service ID in the webhook path
We don't put any restrictions on the format of the Service ID so we need to
base64 it to prevent potentially losing data when it is inserted as a path
parameter (e.g. due to weird escaping rules).
Also, only remove webhooks if there was an old service to begin with.
8 years ago
Kegsay
8ddd4e83d0
Merge pull request #33 from matrix-org/kegan/jira-redirect
Add redirect URL for JIRA auth
8 years ago
Kegsay
d3ef0276fc
Merge pull request #32 from matrix-org/kegan/expand-with-groups
Change Expansion.Expand to include matching groups rather than just the match
8 years ago
Kegan Dougal
233e85eeee
Add redirect URL for JIRA auth
8 years ago
Kegsay
62e6ca7ce6
Merge pull request #31 from matrix-org/kegan/redirect
Add RedirectURL param when requesting GH auth sessions
8 years ago