Commit graph

18 commits

Author SHA1 Message Date
Eric Chiang
b02a3a3163 *: add "groups" scope 2016-07-19 11:23:04 -07:00
Bobby Rullo
09e889e7bc client: add public client to data model 2016-06-20 11:27:47 -07:00
Bobby Rullo
32a1994a5e refresh tokens: store and validate scopes.
A refresh request must fail if it asks for scopes that were not
originally granted when the refresh token was obtained.

This Commit:

* changes repo to store scopes with tokens
* changes repo interface signatures so that scopes can be stored and
  verified
* updates dependent code to pass along scopes
2016-06-14 14:14:36 -07:00
Bobby Rullo
f9dbc8a3d2 db, client: add data model for trusted peers
Trusted Peers are clients that are authorized to mint tokens
for another client.
2016-06-07 17:16:09 -07:00
Eric Chiang
875d5d09bf db: regenerate migrations 2016-03-02 14:47:17 -08:00
Eric Chiang
4feaae98b0 db: add better comment about migration 2016-03-02 14:47:00 -08:00
Eric Chiang
2a0cc47419 db: generate in-memory migration assets 2016-03-01 10:59:25 -08:00
Eric Chiang
f738188c13 db: switch migration source to use in-memory migration
When reading migrations from files, sql-migrate attempts to split
SQL statements. The parsing logic does not handle $BODY$ statements
and broke when the migration included one.

Replace go-bindata with a small migration generation script and use
in memory migrations instead.
2016-03-01 10:55:05 -08:00
Eric Chiang
9bc68edae7 *: add migration to convert all emails to lowercase
Fixes #338
2016-03-01 10:51:50 -08:00
Eric Chiang
9796a1e648 *: add migration to update JSON fields and require postgres 9.4+
The "redirectURLs" field in the client metadata has been updated
to the correct "redirect_uris". To allow backwards compatibility
use Postgres' JSON features to update the actual JSON in the text
field.

json_build_object was introduced in Postgres 9.4. So update the
documentations to require at least this version.
2016-01-12 17:19:07 -08:00
Bobby Rullo
c1f8effe1a db, functional: make value column in key not pkey
go-oidc increased the size of the generated keys, which were too large
to be used as primary keys in postgres.
2015-12-28 16:02:16 -08:00
Eric Chiang
a7138b3cfd db: rebuild miration assets using go generate 2015-12-21 09:45:53 -08:00
Eric Chiang
6cb3146b09 build,db: don't call go-bindata on every build
Add go generate rule to generate migration assets.
2015-12-21 09:43:45 -08:00
Joe Bowers
60a36e2c2e server,db: flag for disabling user login 2015-09-25 14:25:06 -07:00
Yifan Gu
44c6cb44f5 refresh: bcrypt raw bytes rather than base64 encoded string.
This enables us to control the length of the bytes that will be bcrypted,
by default it's 64.

Also changed the token's stored form from string('text') to []byte('bytea')
and added some test cases for different types of invalid tokens.
2015-09-02 14:23:20 -07:00
Yifan Gu
066fd859ec session: add 'scope' field in session. 2015-08-31 13:51:59 -07:00
Bobby Rullo
4ce5a36d08 db: initialize bigint, boolean columns
gorp hates nil.
2015-08-20 12:38:15 -07:00
Bobby Rullo
c16e3b5a10 db: add DB migration code and scripts. 2015-08-20 11:44:43 -07:00