Kegan Dougal
52f3fc853d
More inlining
8 years ago
Kegan Dougal
f928b4c84e
Review comments
8 years ago
Kegan Dougal
8937e031c0
Implement processing of !jira create commands
This involves looking up JIRA realms and then auth sessions for the user.
Does not handle starter links yet.
8 years ago
Kegsay
a15312e7a0
Merge pull request #17 from matrix-org/kegan/jira-auth-sessions
Implement JIRA OAuth1 flow
8 years ago
Kegan Dougal
ca798c94ea
Inline some err/if checks
8 years ago
Kegan Dougal
7e047e68be
Finish implementing auth in JIRA. Access tokens are now stored.
Added redirectURL to the factory function for AuthRealms.
8 years ago
Kegan Dougal
4fdc0c3912
Add JIRA session and requests for OAuth. Redirect not handled yet.
8 years ago
Kegsay
a64427efdb
Merge pull request #16 from matrix-org/kegan/jira-auth
Allow JIRA auth realms to be configured
8 years ago
Kegan Dougal
c6483215f6
Twiddle order of test table fields
8 years ago
Kegan Dougal
9fe0512d9f
s/nil/null/
8 years ago
Kegan Dougal
4507b696a7
More things to insert
8 years ago
Kegan Dougal
59f7fd12a3
Formalise the response JSON to /configureAuthRealm for JIRA
8 years ago
Kegan Dougal
513c9318fb
Allow the creation of [un]authenticated JIRA clients
8 years ago
Kegan Dougal
ab58c2b2a4
Merge branch 'master' into kegan/jira-auth
8 years ago
Kegan Dougal
2d27fa43c1
Add oauth1 dependency
8 years ago
Kegan Dougal
f9f1e28407
Merge branch 'master' into kegan/jira-auth
8 years ago
Kegan Dougal
4bd5ca3003
Add go-jira dependency
8 years ago
Kegan Dougal
d82036adda
Parse messy JIRA URLs into a canonicalised format
8 years ago
Kegsay
477c054588
Merge pull request #15 from matrix-org/kegan/jira-realm
Add a JIRA Realm
8 years ago
Kegan Dougal
5e375283c2
Remove password TODO
8 years ago
Kegan Dougal
a0d3180ba8
Parse out the public key
8 years ago
Kegan Dougal
0948f59a1a
Add JiraRealm type. Add Register() function to AuthRealms
Verify that PrivateKeyPEM is indeed a PEM formatted block in Register()
8 years ago
Kegsay
dea6c1d293
Update README.md
8 years ago
Kegsay
f953539228
Merge pull request #14 from matrix-org/kegan/webhook-endpoint-fn
Pass in the webhook endpoint URL for each service
8 years ago
Kegan Dougal
32ebe92535
Pass in the webhook endpoint URL for each service
Get the base URL from an env var 'BASE_URL' and pass it through to CreateService.
8 years ago
Kegsay
8e1ce1830c
Add GH service curl
8 years ago
Kegsay
c453f6b5ba
Merge pull request #13 from matrix-org/kegan/github-webhook-creation
Create webhooks in the Github Service
8 years ago
Kegan Dougal
cc0325f4ff
Explain what the ping event does
8 years ago
Kegan Dougal
4b41bfb484
Add TODO for order of operations
8 years ago
Kegan Dougal
28f26e61dd
Formatting
8 years ago
Kegan Dougal
33b5abb84b
Add Service.PostRegister(oldService) and implement GH webhook creation
- `PostRegister` is called after the new Service is stored in the database.
It exists so Services can do post-creation actions like hit remote services
using information from old services, if any.
- The `GithubService` uses the `PostRegister()` function to remove old webhooks.
8 years ago
Kegan Dougal
d8cce6367f
Change github service config format to include owner/repo filtering on webhooks
8 years ago
Kegsay
0aa72b59a5
Merge pull request #12 from matrix-org/kegan/github-cmds
Implement `!github create owner/repo title`
8 years ago
Kegan Dougal
b89c3ef776
Length check the ownerRepo array
8 years ago
Kegan Dougal
8beb8fda7f
Implement `!github create owner/repo title`
8 years ago
Kegsay
97e2ace55d
Merge pull request #11 from matrix-org/kegan/github-service
Make GithubService construct authenticated github clients
8 years ago
Kegan Dougal
55fda3c115
Grab access tokens from the GithubService and use them
Currently only an authenticated client is used to lookup expansion issues.
9 years ago
Kegan Dougal
55f857db96
Add Register() function to Services
Fix plugin_tests and make them a bit more intelligible.
9 years ago
Kegsay
375391738e
Merge pull request #10 from matrix-org/kegan/github-auth
Perform Github OAuth and store resulting tokens
9 years ago
Kegan Dougal
f15afa4780
Use non-panicking type assertion
9 years ago
Kegan Dougal
a56d2b1866
s/id/session_id/
9 years ago
Kegan Dougal
1045458642
Update README to include stuff on github
9 years ago
Kegan Dougal
ba803ccd00
Store access_tokens in the DB
9 years ago
Kegan Dougal
71be73a721
Add ID field to AuthSessions so redirects can lookup based off this key
Required for Github OAuth redirect requests and just is generally useful to
have. Add UNIQUE constraints on realm/user and realm/id to prevent multiple
users getting the same ID.
9 years ago
Kegan Dougal
9adb89c24d
Start parsing out redirect requests for github realms
9 years ago
Kegan Dougal
036cd7e7b4
Add redirect handler for AuthRealms
Add state param generation for githubRealm.
9 years ago
Kegsay
306d0f9caa
Merge pull request #9 from matrix-org/kegan/auth-session-api-tweak
Tweak the auth session API to be more transactional
9 years ago
Kegan Dougal
51bf830632
Tweak the auth session API to be more transactional
- Rename the path from /configureAuthSession to /requestAuthSession
- Add a global getter/setter for the `ServiceDB` : this avoids cyclical deps
because now the Realm wants access to the database, and due to the factory
pattern it would mean `types.go` would need to import `database`, but
`database` is already doing so to invoke the factory function in `schema.go`.
- Modify how `AuthSession` is loaded/stored in the database. Now it is just
a blunt JSON store for Public fields. It is initialised via a new Realm
interface function `AuthSession(userID, realmID)` which is there to return
the right `struct` so stuff can be unmarshalled into it.
- Add a new Realm interface function `RequestAuthSession` which is invoked
when `/requestAuthSession` is hit. It is a direct request/response mapping,
a JSON blob goes in as a param, and a JSON blob comes out as the return.
The Realm is free to create/load/update/delete `AuthSessions` inside the
function. This allows better control over when new sessions are made (or
whether to return an existing session).
9 years ago
Kegsay
54c586e6e5
Merge pull request #8 from matrix-org/kegan/auth-session
Add concept of AuthSessions
9 years ago
Kegan Dougal
11df0fe3c9
Decode the realm JSON before calling methods on it
9 years ago