From 5babe03d2b0557a64026efca92012dafb015d818 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 02:12:56 +0600 Subject: [PATCH 01/12] upgrade gobuffalo/pop, fix migrations --- glide.lock | 124 +++++++++++++++++++++------------ glide.yaml | 4 +- models/audit_log_entry.go | 11 +++ models/instance.go | 11 +++ models/refresh_token.go | 12 ++++ models/user.go | 11 +++ storage/dial.go | 6 +- storage/namespace/namespace.go | 11 +++ 8 files changed, 140 insertions(+), 50 deletions(-) create mode 100755 storage/namespace/namespace.go diff --git a/glide.lock b/glide.lock index 7041ab9c2..6ebaf4a9a 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 05d2217d85659023cf588c253b283746102c7fc32211b1a8dc11fd6a66832c6d -updated: 2018-08-21T18:55:10.665441904+02:00 +hash: 051dbaa04c205b74acc1b486c22d8f12431465029106f6ee58d23dadb95d55c6 +updated: 2018-10-17T01:29:41.8356134+06:00 imports: - name: cloud.google.com/go version: 98f5696b1026056a47f114c4451dbc4703d67191 @@ -15,12 +15,16 @@ imports: - errors - name: github.com/bugsnag/panicwrap version: dd8df9a3778aaebc569794383e5c4ce87d6fd89e -- name: github.com/daviddengcn/go-colortext - version: 17e75f6184bc9e727756cd0d82e0af58b1fc7191 +- name: github.com/cockroachdb/cockroach-go + version: e0a95dfd547cc9c3ebaaba1a12c2afe4bf621ac5 + subpackages: + - crdb - name: github.com/dgrijalva/jwt-go version: d2709f9f1f31ebcda9651b03077758c1f3a0018c - name: github.com/fatih/color version: 5df930a27be2502f99b292b7cc09ebad4d0891f4 +- name: github.com/fatih/structs + version: 878a968ab22548362a09bdb3322f98b00f470d46 - name: github.com/fsnotify/fsnotify version: f12c6236fe7b5cf6bcf30e5935d08cb079d78334 - name: github.com/go-chi/chi @@ -31,12 +35,48 @@ imports: version: a0583e0143b1624142adab07e0e97fe106d99561 - name: github.com/gobuffalo/envy version: a1789093e51b497900a240e15b39d8a97bfbc5d0 +- name: github.com/gobuffalo/fizz + version: 2ee389a202a50a7ace33ad8f97b9f0b27932e264 + subpackages: + - translators +- name: github.com/gobuffalo/flect + version: ae7ed6bfe683063bab833454fa8a95a789139f3f + subpackages: + - name +- name: github.com/gobuffalo/github_flavored_markdown + version: 99b77ecb08795b8b2cf87f687633f95e8f40c651 + subpackages: + - internal/russross/blackfriday +- name: github.com/gobuffalo/makr + version: bfe537384e6f4cf8a4d9d149bae4f519b186c9fe - name: github.com/gobuffalo/packr version: 7458c919b2ddc10bfb5588b6645b7aefd1c60418 +- name: github.com/gobuffalo/plush + version: 1c2f6e358d7ed2cca00d3a43796c665a11151597 + subpackages: + - ast + - lexer + - parser + - token - name: github.com/gobuffalo/pop - version: 11447b06bdc024968c2c62c96d1de29b9b846b48 + version: 585d7fb894f4c14a7a0c90cc74b87188b4afc361 subpackages: + - associations - columns + - fix + - logging + - nulls +- name: github.com/gobuffalo/tags + version: da5de2a6b4fdd40153789f7efff1330616e28de7 + subpackages: + - form + - form/bootstrap +- name: github.com/gobuffalo/uuid + version: 2a766f2b8b8299437782042f22bfe3e153ff945e +- name: github.com/gobuffalo/validate + version: 35866c4badf3a9f3a87db5ade6159e6ecf148d2a + subpackages: + - validators - name: github.com/gogo/protobuf version: 616a82ed12d78d24d4839363e8f3c5d3f20627cf subpackages: @@ -70,6 +110,14 @@ imports: version: 3e95a51e0639b4cf372f2ccf74c86749d747fbdc - name: github.com/inconshreveable/mousetrap version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 +- name: github.com/jackc/pgx + version: 20eaa7963b9d714bfaf678dcb2448fbd1e3671b9 + subpackages: + - chunkreader + - internal/sanitize + - pgio + - pgproto3 + - pgtype - name: github.com/jmoiron/sqlx version: de8647470aafe4854c976707c431dbe1eb2822c6 subpackages: @@ -80,6 +128,8 @@ imports: version: e7c6d408fd5c44ee1e1d8b79ae32b426afae1f28 - name: github.com/kardianos/osext version: ae77be60afb1dcacde03767a8c37337fad28ac14 +- name: github.com/kballard/go-shellquote + version: 95032a82bc518f77982ea72343cc1ade730072f0 - name: github.com/kelseyhightower/envconfig version: f611eb38b3875cc3bd991ca91c51d06446afa14c - name: github.com/kr/fs @@ -97,48 +147,10 @@ imports: subpackages: - defaults - randx - - wait - name: github.com/markbates/inflect version: a12c3aec81a6a938bf584a4bac567afed9256586 -- name: github.com/markbates/pop - version: 11447b06bdc024968c2c62c96d1de29b9b846b48 - subpackages: - - columns - - fizz - - fizz/translators -- name: github.com/markbates/validate - version: cd8cc34c703420d6b084fbbfd5085e8e71c5b830 -- name: github.com/mattn/anko - version: 3b446c7d031bdd754fc0183f599af173cd996715 - subpackages: - - ast - - builtins - - builtins/encoding/json - - builtins/errors - - builtins/flag - - builtins/fmt - - builtins/github.com/daviddengcn/go-colortext - - builtins/io - - builtins/io/ioutil - - builtins/math - - builtins/math/big - - builtins/math/rand - - builtins/net - - builtins/net/http - - builtins/net/url - - builtins/os - - builtins/os/exec - - builtins/os/signal - - builtins/path - - builtins/path/filepath - - builtins/regexp - - builtins/runtime - - builtins/sort - - builtins/strconv - - builtins/strings - - builtins/time - - parser - - vm +- name: github.com/markbates/oncer + version: 05fccaae8fc423476d98fd4c3e4699ba0fbbde48 - name: github.com/mattn/go-colorable version: 5411d3eea5978e6cdc258b30de592b60df6aba96 repo: https://github.com/mattn/go-colorable @@ -147,6 +159,8 @@ imports: repo: https://github.com/mattn/go-isatty - name: github.com/mattn/go-sqlite3 version: 3b3f1d01b2696af5501697c35629048c227586ab +- name: github.com/microcosm-cc/bluemonday + version: 82c7118e8ccf7403d4860175d97bb635e8e28239 - name: github.com/mitchellh/go-homedir version: b8bc1bf767474819792c23f32d8286a45736f1c6 - name: github.com/mitchellh/mapstructure @@ -200,8 +214,22 @@ imports: version: 36e9d2ebbde5e3f13ab2e25625fd453271d6522e - name: github.com/sebest/xff version: 6c115e0ffa35d6a2e3f7a9e797c9cf07f0da4b9f +- name: github.com/serenize/snaker + version: a683aaf2d516deecd70cad0c72e3ca773ecfcef0 +- name: github.com/sergi/go-diff + version: da645544ed44df016359bd4c0e3dc60ee3a0da43 + subpackages: + - diffmatchpatch - name: github.com/shopify/logrus-bugsnag version: 6dbc35f2c30d1e37549f9673dd07912452ab28a5 +- name: github.com/shurcooL/highlight_diff + version: 09bb4053de1b1d872a9f25dc21378fa71dca4e4e +- name: github.com/shurcooL/highlight_go + version: 78fb10f4a5f89e812a5e26ab723b954a51226086 +- name: github.com/shurcooL/octicon + version: c42b0e3b24d96976ecac81ef691662777b39ef64 +- name: github.com/shurcooL/sanitized_anchor_name + version: 86672fcb3f950f35f2e675df2240550f2a50762f - name: github.com/signalfx/com_signalfx_metrics_protobuf version: 93e507b42f43f458a109ca278d1542a26a0b87fc - name: github.com/signalfx/gohistogram @@ -218,6 +246,10 @@ imports: - timekeeper - name: github.com/sirupsen/logrus version: f006c2ac4710855cf0f916dd6b77acf6b048dc6e +- name: github.com/sourcegraph/annotate + version: f4cad6c6324d3f584e1743d8b3e0e017a5f3a636 +- name: github.com/sourcegraph/syntaxhighlight + version: bd320f5d308e1a3c4314c678d8227a0d72574ae7 - name: github.com/spf13/afero version: 20500e2abd0d1f4564a499e83d11d6c73cd58c27 subpackages: @@ -258,6 +290,8 @@ imports: subpackages: - context - context/ctxhttp + - html + - html/atom - name: golang.org/x/oauth2 version: 9a379c6b3e95a790ffc43293c2a78dee0d7b6e20 subpackages: diff --git a/glide.yaml b/glide.yaml index d375d4d98..28021548e 100644 --- a/glide.yaml +++ b/glide.yaml @@ -24,6 +24,8 @@ import: subpackages: - bitbucket - github + - facebook + - google - package: github.com/sirupsen/logrus version: v1.0.3 - package: github.com/spf13/cobra @@ -50,7 +52,7 @@ import: - package: github.com/joho/godotenv version: v1.2.0 - package: github.com/gobuffalo/pop - version: 3.42.1 + version: v4.8.4 - package: github.com/russellhaering/gosaml2 version: ~0.3.1 - package: github.com/russellhaering/goxmldsig diff --git a/models/audit_log_entry.go b/models/audit_log_entry.go index cce31ecfb..405415fda 100644 --- a/models/audit_log_entry.go +++ b/models/audit_log_entry.go @@ -6,6 +6,7 @@ import ( "time" "github.com/netlify/gotrue/storage" + "github.com/netlify/gotrue/storage/namespace" "github.com/pkg/errors" uuid "github.com/satori/go.uuid" ) @@ -54,6 +55,16 @@ type AuditLogEntry struct { CreatedAt time.Time `json:"created_at" db:"created_at"` } +func (a *AuditLogEntry) TableName() string { + tableName := "audit_log_entries" + + if namespace.GetNamespace() != "" { + return namespace.GetNamespace() + "_" + tableName + } + + return tableName +} + func NewAuditLogEntry(tx *storage.Connection, instanceID uuid.UUID, actor *User, action AuditAction, traits map[string]interface{}) error { id, err := uuid.NewV4() if err != nil { diff --git a/models/instance.go b/models/instance.go index cde87be9b..948b5dd1c 100644 --- a/models/instance.go +++ b/models/instance.go @@ -1,6 +1,7 @@ package models import ( + "github.com/netlify/gotrue/storage/namespace" "database/sql" "time" @@ -24,6 +25,16 @@ type Instance struct { UpdatedAt time.Time `json:"updated_at" db:"updated_at"` } +func (i *Instance) TableName() string { + tableName := "instances" + + if namespace.GetNamespace() != "" { + return namespace.GetNamespace() + "_" + tableName + } + + return tableName +} + // Config loads the the base configuration values with defaults. func (i *Instance) Config() (*conf.Configuration, error) { if i.BaseConfig == nil { diff --git a/models/refresh_token.go b/models/refresh_token.go index 9d35ba94c..3e097e3d0 100644 --- a/models/refresh_token.go +++ b/models/refresh_token.go @@ -1,6 +1,7 @@ package models import ( + "github.com/netlify/gotrue/storage/namespace" "time" "github.com/gobuffalo/pop" @@ -24,6 +25,17 @@ type RefreshToken struct { UpdatedAt time.Time `db:"updated_at"` } + +func (rt *RefreshToken) TableName() string { + tableName := "refresh_tokens" + + if namespace.GetNamespace() != "" { + return namespace.GetNamespace() + "_" + tableName + } + + return tableName +} + // GrantAuthenticatedUser creates a refresh token for the provided user. func GrantAuthenticatedUser(tx *storage.Connection, user *User) (*RefreshToken, error) { return createRefreshToken(tx, user) diff --git a/models/user.go b/models/user.go index fca3a432c..fb95f29c7 100644 --- a/models/user.go +++ b/models/user.go @@ -7,6 +7,7 @@ import ( "github.com/gobuffalo/pop" "github.com/netlify/gotrue/storage" + "github.com/netlify/gotrue/storage/namespace" "github.com/pkg/errors" "github.com/satori/go.uuid" "golang.org/x/crypto/bcrypt" @@ -80,6 +81,16 @@ func NewSystemUser(instanceID uuid.UUID, aud string) *User { } } +func (u *User) TableName() string { + tableName := "users" + + if namespace.GetNamespace() != "" { + return namespace.GetNamespace() + "_" + tableName + } + + return tableName +} + func (u *User) BeforeCreate(tx *pop.Connection) error { return u.BeforeUpdate(tx) } diff --git a/storage/dial.go b/storage/dial.go index 305a49658..24d64d15b 100644 --- a/storage/dial.go +++ b/storage/dial.go @@ -9,6 +9,7 @@ import ( "github.com/gobuffalo/pop" "github.com/gobuffalo/pop/columns" "github.com/netlify/gotrue/conf" + "github.com/netlify/gotrue/storage/namespace" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -40,10 +41,7 @@ func Dial(config *conf.GlobalConfiguration) (*Connection, error) { } if config.DB.Namespace != "" { - pop.MapTableName("User", config.DB.Namespace+"_users") - pop.MapTableName("RefreshToken", config.DB.Namespace+"_refresh_tokens") - pop.MapTableName("Instance", config.DB.Namespace+"_instances") - pop.MapTableName("AuditLogEntry", config.DB.Namespace+"_audit_log_entries") + namespace.SetNamespace(config.DB.Namespace) } if logrus.StandardLogger().Level == logrus.DebugLevel { diff --git a/storage/namespace/namespace.go b/storage/namespace/namespace.go new file mode 100755 index 000000000..a2ade7c2a --- /dev/null +++ b/storage/namespace/namespace.go @@ -0,0 +1,11 @@ +package namespace + +var namespace string + +func SetNamespace(ns string) { + namespace = ns +} + +func GetNamespace() string { + return namespace +} From 36fca93fd60c00c78878550eebc6cc03481a78cd Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 03:08:59 +0600 Subject: [PATCH 02/12] fix test and deprecated messages --- api/admin.go | 2 +- api/admin_test.go | 2 +- api/api.go | 2 +- api/api_test.go | 2 +- api/audit_test.go | 2 +- api/context.go | 2 +- api/errors.go | 4 +- api/external.go | 2 +- api/external_saml_test.go | 2 +- api/external_test.go | 2 +- api/helpers.go | 2 +- api/hook_test.go | 2 +- api/hooks.go | 4 +- api/instance.go | 2 +- api/instance_test.go | 2 +- api/invite_test.go | 2 +- api/middleware.go | 2 +- api/provider/saml.go | 2 +- api/recover_test.go | 2 +- api/signup_test.go | 2 +- api/token.go | 4 +- api/user.go | 2 +- api/user_test.go | 2 +- api/verify.go | 2 +- api/verify_test.go | 2 +- cmd/admin_cmd.go | 2 +- cmd/serve_cmd.go | 2 +- example.env | 14 +- go.mod | 105 +++++++++++++++ go.sum | 240 +++++++++++++++++++++++++++++++++++ hack/migrations/schema.sql | 0 metering/record.go | 2 +- migrations/schema.sql | 131 ------------------- models/audit_log_entry.go | 2 +- models/instance.go | 2 +- models/refresh_token.go | 2 +- models/refresh_token_test.go | 2 +- models/user.go | 2 +- models/user_test.go | 2 +- storage/dial.go | 2 +- storage/dial_test.go | 2 +- 41 files changed, 391 insertions(+), 177 deletions(-) create mode 100755 go.mod create mode 100755 go.sum create mode 100644 hack/migrations/schema.sql diff --git a/api/admin.go b/api/admin.go index 38a2057a3..e8d3c400d 100644 --- a/api/admin.go +++ b/api/admin.go @@ -8,7 +8,7 @@ import ( "github.com/go-chi/chi" "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) type adminUserParams struct { diff --git a/api/admin_test.go b/api/admin_test.go index 865a22c92..f4908a0f0 100644 --- a/api/admin_test.go +++ b/api/admin_test.go @@ -12,7 +12,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/api.go b/api/api.go index e6c982cbb..a06e3631f 100644 --- a/api/api.go +++ b/api/api.go @@ -12,7 +12,7 @@ import ( "github.com/netlify/gotrue/storage" "github.com/netlify/netlify-commons/graceful" "github.com/rs/cors" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sebest/xff" "github.com/sirupsen/logrus" ) diff --git a/api/api_test.go b/api/api_test.go index bbfb69111..b0c2db61b 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -10,7 +10,7 @@ import ( "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" "github.com/netlify/gotrue/storage/test" - "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/require" ) diff --git a/api/audit_test.go b/api/audit_test.go index bd53bc897..ab0496b36 100644 --- a/api/audit_test.go +++ b/api/audit_test.go @@ -11,7 +11,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/context.go b/api/context.go index 9c8f887ce..22e385360 100644 --- a/api/context.go +++ b/api/context.go @@ -6,7 +6,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) type contextKey string diff --git a/api/errors.go b/api/errors.go index 81d0e95c6..53107ca09 100644 --- a/api/errors.go +++ b/api/errors.go @@ -39,7 +39,7 @@ func (e *OAuthError) WithInternalError(err error) *OAuthError { // WithInternalMessage adds internal message information to the error func (e *OAuthError) WithInternalMessage(fmtString string, args ...interface{}) *OAuthError { - e.InternalMessage = fmt.Sprintf(fmtString, args) + e.InternalMessage = fmt.Sprintf(fmtString, args...) return e } @@ -111,7 +111,7 @@ func (e *HTTPError) WithInternalError(err error) *HTTPError { // WithInternalMessage adds internal message information to the error func (e *HTTPError) WithInternalMessage(fmtString string, args ...interface{}) *HTTPError { - e.InternalMessage = fmt.Sprintf(fmtString, args) + e.InternalMessage = fmt.Sprintf(fmtString, args...) return e } diff --git a/api/external.go b/api/external.go index 0866120de..5e5d6178b 100644 --- a/api/external.go +++ b/api/external.go @@ -13,7 +13,7 @@ import ( "github.com/netlify/gotrue/api/provider" "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sirupsen/logrus" ) diff --git a/api/external_saml_test.go b/api/external_saml_test.go index 954eb3f36..c68159a78 100644 --- a/api/external_saml_test.go +++ b/api/external_saml_test.go @@ -20,7 +20,7 @@ import ( "github.com/netlify/gotrue/models" "github.com/russellhaering/gosaml2/types" dsig "github.com/russellhaering/goxmldsig" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/api/external_test.go b/api/external_test.go index 538dd75c2..d765a376f 100644 --- a/api/external_test.go +++ b/api/external_test.go @@ -10,7 +10,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/api/helpers.go b/api/helpers.go index 6e4839d46..7ec3d5eb7 100644 --- a/api/helpers.go +++ b/api/helpers.go @@ -11,7 +11,7 @@ import ( "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" "github.com/pkg/errors" - "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) func addRequestID(globalConfig *conf.GlobalConfiguration) middlewareHandler { diff --git a/api/hook_test.go b/api/hook_test.go index 79d0348bd..3cf834bb2 100644 --- a/api/hook_test.go +++ b/api/hook_test.go @@ -12,7 +12,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage/test" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/api/hooks.go b/api/hooks.go index 098126e4c..40b693e18 100644 --- a/api/hooks.go +++ b/api/hooks.go @@ -15,7 +15,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sirupsen/logrus" "github.com/netlify/gotrue/conf" @@ -103,7 +103,7 @@ func (w *Webhook) trigger() (io.ReadCloser, error) { // timed out - try again? if i == w.Retries-1 { closeBody(rsp) - return nil, httpError(http.StatusGatewayTimeout, "Failed to perform webhook in time frame (%d seconds)", timeout.Seconds()) + return nil, httpError(http.StatusGatewayTimeout, "Failed to perform webhook in time frame (%v seconds)", timeout.Seconds()) } hooklog.Info("Request timed out") continue diff --git a/api/instance.go b/api/instance.go index d87666289..fb3cb23a0 100644 --- a/api/instance.go +++ b/api/instance.go @@ -9,7 +9,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" "github.com/pkg/errors" - "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) func (a *API) loadInstance(w http.ResponseWriter, r *http.Request) (context.Context, error) { diff --git a/api/instance_test.go b/api/instance_test.go index 102f513cc..7f8552cf5 100644 --- a/api/instance_test.go +++ b/api/instance_test.go @@ -7,7 +7,7 @@ import ( "net/http/httptest" "testing" - "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" diff --git a/api/invite_test.go b/api/invite_test.go index df6d25bdf..c6ac6873a 100644 --- a/api/invite_test.go +++ b/api/invite_test.go @@ -13,7 +13,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/middleware.go b/api/middleware.go index 3c9e74b59..9d8e07fdc 100644 --- a/api/middleware.go +++ b/api/middleware.go @@ -9,7 +9,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) const ( diff --git a/api/provider/saml.go b/api/provider/saml.go index deccfe65d..00e3edfc8 100644 --- a/api/provider/saml.go +++ b/api/provider/saml.go @@ -24,7 +24,7 @@ import ( saml2 "github.com/russellhaering/gosaml2" "github.com/russellhaering/gosaml2/types" dsig "github.com/russellhaering/goxmldsig" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "golang.org/x/oauth2" ) diff --git a/api/recover_test.go b/api/recover_test.go index d26ab45d1..656db7752 100644 --- a/api/recover_test.go +++ b/api/recover_test.go @@ -10,7 +10,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/signup_test.go b/api/signup_test.go index 1c7a88748..4f86a8faa 100644 --- a/api/signup_test.go +++ b/api/signup_test.go @@ -12,7 +12,7 @@ import ( jwt "github.com/dgrijalva/jwt-go" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/token.go b/api/token.go index 6c86df0f6..d82486773 100644 --- a/api/token.go +++ b/api/token.go @@ -88,7 +88,7 @@ func (a *API) ResourceOwnerPasswordGrant(ctx context.Context, w http.ResponseWri if cookie != "" && config.Cookie.Duration > 0 { if terr = a.setCookieToken(config, token.Token, cookie == useSessionCookie, w); terr != nil { - return internalServerError("Failed to set JWT cookie", terr) + return internalServerError("Failed to set JWT cookie. %s", terr) } } return nil @@ -145,7 +145,7 @@ func (a *API) RefreshTokenGrant(ctx context.Context, w http.ResponseWriter, r *h if cookie != "" && config.Cookie.Duration > 0 { if terr = a.setCookieToken(config, tokenString, cookie == useSessionCookie, w); terr != nil { - return internalServerError("Failed to set JWT cookie", terr) + return internalServerError("Failed to set JWT cookie. %s", terr) } } return nil diff --git a/api/user.go b/api/user.go index bae79e579..6bf8de4a9 100644 --- a/api/user.go +++ b/api/user.go @@ -6,7 +6,7 @@ import ( "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) // UserUpdateParams parameters for updating a user diff --git a/api/user_test.go b/api/user_test.go index 7d34191b6..85d6ed54a 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -11,7 +11,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/api/verify.go b/api/verify.go index 1f68bf01a..00711af65 100644 --- a/api/verify.go +++ b/api/verify.go @@ -65,7 +65,7 @@ func (a *API) Verify(w http.ResponseWriter, r *http.Request) error { if cookie != "" && config.Cookie.Duration > 0 { if terr = a.setCookieToken(config, token.Token, cookie == useSessionCookie, w); terr != nil { - return internalServerError("Failed to set JWT cookie", terr) + return internalServerError("Failed to set JWT cookie. %s", terr) } } return nil diff --git a/api/verify_test.go b/api/verify_test.go index 7610bc74b..16e6aaadb 100644 --- a/api/verify_test.go +++ b/api/verify_test.go @@ -10,7 +10,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/cmd/admin_cmd.go b/cmd/admin_cmd.go index eececb753..651daad15 100644 --- a/cmd/admin_cmd.go +++ b/cmd/admin_cmd.go @@ -4,7 +4,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/models" "github.com/netlify/gotrue/storage" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/cmd/serve_cmd.go b/cmd/serve_cmd.go index 996a319ad..429f1c2b0 100644 --- a/cmd/serve_cmd.go +++ b/cmd/serve_cmd.go @@ -7,7 +7,7 @@ import ( "github.com/netlify/gotrue/api" "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/storage" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/example.env b/example.env index 6f943e313..83ca96213 100644 --- a/example.env +++ b/example.env @@ -1,18 +1,18 @@ -GOTRUE_JWT_SECRET="CHANGE-THIS! VERY IMPORTANT!" +GOTRUE_JWT_SECRET="m1HIQZxYScoiKkTp1DTv45WFiyt7r92p" GOTRUE_JWT_EXP=3600 GOTRUE_JWT_AUD=api.netlify.com GOTRUE_DB_DRIVER=mysql -DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true" +DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true&multiStatements=true" GOTRUE_API_HOST=localhost PORT=9999 GOTRUE_SITE_URL=https://my-jam-site.example.com -GOTRUE_SMTP_HOST=smtp.mandrillapp.com +GOTRUE_SMTP_HOST=smtp.sendgrid.net GOTRUE_SMTP_PORT=587 -GOTRUE_SMTP_USER=test@example.com -GOTRUE_SMTP_PASS=super-secret-password -GOTRUE_SMTP_ADMIN_EMAIL=admin@example.com +GOTRUE_SMTP_USER=apikey +GOTRUE_SMTP_PASS=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 +GOTRUE_SMTP_ADMIN_EMAIL=noreply@coinread.com GOTRUE_MAILER_SUBJECTS_CONFIRMATION="Welcome to GoTrue!" GOTRUE_MAILER_SUBJECTS_RECOVERY="Reset your GoTrue password!" GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://localhost:9999/callback GOTRUE_LOG_LEVEL=DEBUG -GOTRUE_OPERATOR_TOKEN=super-secret-operator-token +GOTRUE_OPERATOR_TOKEN=NZ4qIdsRXuuIAEYiUPGsQ6lx3av7cCdX diff --git a/go.mod b/go.mod new file mode 100755 index 000000000..3a7b60009 --- /dev/null +++ b/go.mod @@ -0,0 +1,105 @@ +module github.com/netlify/gotrue + +require ( + cloud.google.com/go v0.0.0-20170822200954-98f5696b1026 + github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20170623214735-571947b0f240 + github.com/badoux/checkmail v0.0.0-20170203135005-d0a759655d62 + github.com/beevik/etree v0.0.0-20180609182452-90dafc1e1f11 + github.com/bugsnag/bugsnag-go v1.3.0 + github.com/bugsnag/panicwrap v0.0.0-20170829152406-dd8df9a3778a + github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c + github.com/dgrijalva/jwt-go v3.0.0+incompatible + github.com/fatih/color v0.0.0-20170926111411-5df930a27be2 + github.com/fatih/structs v1.0.0 + github.com/fsnotify/fsnotify v1.4.7 + github.com/go-chi/chi v3.1.4+incompatible + github.com/go-sql-driver/mysql v1.4.0 + github.com/gobuffalo/envy v1.6.4 + github.com/gobuffalo/fizz v1.0.12 + github.com/gobuffalo/flect v0.0.0-20181007231023-ae7ed6bfe683 + github.com/gobuffalo/github_flavored_markdown v1.0.5 + github.com/gobuffalo/makr v1.1.5 + github.com/gobuffalo/packr v1.10.0 + github.com/gobuffalo/plush v3.7.20+incompatible + github.com/gobuffalo/pop v4.8.4+incompatible + github.com/gobuffalo/tags v2.0.11+incompatible + github.com/gobuffalo/uuid v2.0.3+incompatible + github.com/gobuffalo/validate v2.0.3+incompatible + github.com/gogo/protobuf v0.0.0-20171109181519-616a82ed12d7 + github.com/golang/protobuf v1.2.0 + github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd + github.com/imdario/mergo v0.0.0-20160216103600-3e95a51e0639 + github.com/inconshreveable/mousetrap v1.0.0 + github.com/jackc/pgx v0.0.0-20181010125647-20eaa7963b9d + github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 + github.com/joho/godotenv v1.3.0 + github.com/jonboulle/clockwork v0.0.0-20180716110948-e7c6d408fd5c + github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 + github.com/kelseyhightower/envconfig v1.3.0 + github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 + github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 + github.com/lib/pq v1.0.0 + github.com/magiconair/properties v0.0.0-20160908093658-0723e352fa35 + github.com/markbates/going v1.0.1 + github.com/markbates/inflect v1.0.0 + github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4 + github.com/mattn/go-colorable v0.0.0-20170210172801-5411d3eea597 + github.com/mattn/go-isatty v0.0.0-20170307163044-57fdcb988a5c + github.com/mattn/go-sqlite3 v1.9.0 + github.com/microcosm-cc/bluemonday v1.0.1 + github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747 + github.com/mitchellh/mapstructure v0.0.0-20170125051937-db1efb556f84 + github.com/nats-io/go-nats v1.3.0 + github.com/nats-io/go-nats-streaming v0.3.4 + github.com/nats-io/nuid v0.0.0-20170303150224-3cf34f9fca4e + github.com/netlify/mailme v0.0.0-20170821082834-c4a76ce443c1 + github.com/netlify/netlify-commons v0.7.7 + github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa + github.com/pelletier/go-buffruneio v0.1.0 + github.com/pelletier/go-toml v0.0.0-20160906202557-31055c2ff0bb + github.com/pkg/errors v0.8.0 + github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073 + github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d + github.com/russellhaering/gosaml2 v0.3.1 + github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 + github.com/satori/go.uuid v0.0.0-20180103174451-36e9d2ebbde5 + github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35 + github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 + github.com/sergi/go-diff v1.0.0 + github.com/shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d + github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b + github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8 + github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9 + github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 + github.com/signalfx/com_signalfx_metrics_protobuf v0.0.0-20170330202426-93e507b42f43 + github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 + github.com/signalfx/golib v1.0.0 + github.com/sirupsen/logrus v1.0.3 + github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d + github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e + github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d + github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a + github.com/spf13/cobra v0.0.0-20170228191748-fcd0c5a1df88 + github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80 + github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff + github.com/spf13/viper v1.0.0 + github.com/streadway/amqp v0.0.0-20170707203015-2cbfe40c9341 + github.com/stretchr/testify v1.2.2 + golang.org/x/crypto v0.0.0-20180127211104-1875d0a70c90 + golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 + golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95 + golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f + golang.org/x/sys v0.0.0-20180927150500-dad3d9fb7b6e + golang.org/x/text v0.3.0 + google.golang.org/api v0.0.0-20170821230356-dd6bdadc5852 + google.golang.org/appengine v1.2.0 + gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc + gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect + gopkg.in/gomail.v2 v2.0.0-20150902115704-41f357289737 + gopkg.in/logfmt.v0 v0.3.0 + gopkg.in/stack.v1 v1.6.0 + gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 // indirect + gopkg.in/yaml.v2 v2.2.1 +) diff --git a/go.sum b/go.sum new file mode 100755 index 000000000..1d7d4e6d8 --- /dev/null +++ b/go.sum @@ -0,0 +1,240 @@ +cloud.google.com/go v0.0.0-20170822200954-98f5696b1026 h1:h51R+fYV+r8EoCQei90mcXqCDhDaUHiMI2nmZAl9Y8U= +cloud.google.com/go v0.0.0-20170822200954-98f5696b1026/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20170623214735-571947b0f240 h1:bCOIpv1VinSRhS5ezZeCEGG82gib2WtXfiJOHmMSuls= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20170623214735-571947b0f240/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= +github.com/badoux/checkmail v0.0.0-20170203135005-d0a759655d62 h1:vMqcPzLT1/mbYew0gM6EJy4/sCNy9lY9rmlFO+pPwhY= +github.com/badoux/checkmail v0.0.0-20170203135005-d0a759655d62/go.mod h1:r5ZalvRl3tXevRNJkwIB6DC4DD3DMjIlY9NEU1XGoaQ= +github.com/beevik/etree v0.0.0-20180609182452-90dafc1e1f11 h1:C2jA9xWe9gk/WFMzvR6q0tT/TNNnIJUyeowUO1Y2/VQ= +github.com/beevik/etree v0.0.0-20180609182452-90dafc1e1f11/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= +github.com/bugsnag/bugsnag-go v1.3.0 h1:vIHdYCVDBtzRcj5wvxljvbnFduWpYGPt3esulAsX/Vk= +github.com/bugsnag/bugsnag-go v1.3.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/panicwrap v0.0.0-20170829152406-dd8df9a3778a h1:PCdP9urEqpfeUml5st/Yn3GoL2QBaECdTlh7faGj1KA= +github.com/bugsnag/panicwrap v0.0.0-20170829152406-dd8df9a3778a/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c h1:2zRrJWIt/f9c9HhNHAgrRgq0San5gRRUJTBXLkchal0= +github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.0.0+incompatible h1:nfVqwkkhaRUethVJaQf5TUFdFr3YUF4lJBTf/F2XwVI= +github.com/dgrijalva/jwt-go v3.0.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/fatih/color v0.0.0-20170926111411-5df930a27be2 h1:40J76vs1Y7oiHFqTrQHQ6A5u8vbXJdLaMkC9iHU/uMw= +github.com/fatih/color v0.0.0-20170926111411-5df930a27be2/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structs v0.0.0-20181010231757-878a968ab225/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= +github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fsnotify/fsnotify v0.0.0-20160816051541-f12c6236fe7b/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/go-chi/chi v3.1.4+incompatible h1:LZzu7MOZa3YkL+u2j94DZSotXAIAO2KW5xRZ6SGaF+A= +github.com/go-chi/chi v3.1.4+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/gobuffalo/envy v0.0.0-20171219192953-a1789093e51b/go.mod h1:gOxUQY+OEwqH1a2m25Sqax1GIhj31tPNOIdFzj8QThs= +github.com/gobuffalo/envy v1.6.4 h1:kxamN+VYjPMzEdjc2mn4CIKiuYXGxc8VIwXJNixFlNY= +github.com/gobuffalo/envy v1.6.4/go.mod h1:Abh+Jfw475/NWtYMEt+hnJWRiC8INKWibIMyNt1w2Mc= +github.com/gobuffalo/fizz v1.0.12 h1:JJOkmlStog5AiBL434UoGMJ896p3MnTnzedFVaZSF3k= +github.com/gobuffalo/fizz v1.0.12/go.mod h1:C0sltPxpYK8Ftvf64kbsQa2yiCZY4RZviurNxXdAKwc= +github.com/gobuffalo/flect v0.0.0-20181007231023-ae7ed6bfe683 h1:uHrn7kCcU0zQ8snv1ogsNttxXZagNBr/gtYUf9LPr4Q= +github.com/gobuffalo/flect v0.0.0-20181007231023-ae7ed6bfe683/go.mod h1:rCiQgmAE4axgBNl3jZWzS5rETRYTGOsrixTRaCPzNdA= +github.com/gobuffalo/github_flavored_markdown v1.0.5 h1:YvGVf7yj1akgsb+qc64Q0WX8uhpuZSibChbqOMRSAqE= +github.com/gobuffalo/github_flavored_markdown v1.0.5/go.mod h1:U0643QShPF+OF2tJvYNiYDLDGDuQmJZXsf/bHOJPsMY= +github.com/gobuffalo/makr v1.1.5 h1:lOlpv2iz0dNa4qse0ZYQgbtT+ybwVxWEAcOZbcPmeYc= +github.com/gobuffalo/makr v1.1.5/go.mod h1:Y+o0btAH1kYAMDJW/TX3+oAXEu0bmSLLoC9mIFxtzOw= +github.com/gobuffalo/packr v1.10.0 h1:Aym0Vng0Ews9gz7WxB9O2IMqIZLwtnpQSgu1/b9sNWE= +github.com/gobuffalo/packr v1.10.0/go.mod h1:rYwMLC6NXbAbkKb+9j3NTKbxSswkKLlelZYccr4HYVw= +github.com/gobuffalo/plush v3.7.16+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= +github.com/gobuffalo/plush v3.7.20+incompatible h1:FgLKw/zwd8IY8lAqfSuVNuHopR7jKVSs6yjJKeBajzU= +github.com/gobuffalo/plush v3.7.20+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= +github.com/gobuffalo/pop v4.8.4+incompatible h1:5v15ZgICK3MFTU90QRqCaqDUf4wcriIbws1hqpYL2Xo= +github.com/gobuffalo/pop v4.8.4+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcVDpJWGsxjVjMPnkiThWg= +github.com/gobuffalo/tags v2.0.11+incompatible h1:zLkaontB8lWefU+DX38mzPLRKFGTJL8FKb9JnKMt0Z0= +github.com/gobuffalo/tags v2.0.11+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= +github.com/gobuffalo/uuid v0.0.0-20180818155429-2a766f2b8b82/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/uuid v2.0.3+incompatible h1:W83ymTRbzM+XNntIsjC8j63FyzGytcfKTudU1Cg6xyk= +github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/validate v0.0.0-20180818155506-35866c4badf3/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= +github.com/gobuffalo/validate v2.0.3+incompatible h1:6f4JCEz11Zi6iIlexMv7Jz10RBPvgI795AOaubtCwTE= +github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= +github.com/gogo/protobuf v0.0.0-20171109181519-616a82ed12d7 h1:wUh9BSaLyofkj2q6c4+F4NlHHw2fkMArhOUBOTgTQdk= +github.com/gogo/protobuf v0.0.0-20171109181519-616a82ed12d7/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/protobuf v0.0.0-20170816001514-ab9f9a6dab16/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd h1:84QdurP28/GTPuAXatiouvNyhN9dflZY9KtMbatmupI= +github.com/hashicorp/hcl v0.0.0-20160902165219-99df0eb941dd/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/imdario/mergo v0.0.0-20160216103600-3e95a51e0639 h1:VMd01CgpBpmLpuERyY4Oibn2PpcVS1fK9sjh5UZG8+o= +github.com/imdario/mergo v0.0.0-20160216103600-3e95a51e0639/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/pgx v0.0.0-20181010125647-20eaa7963b9d h1:hdxkXtTSKU/t+ClVSk3Lx6eiGT6D2WwVXpUJhoF75Yw= +github.com/jackc/pgx v0.0.0-20181010125647-20eaa7963b9d/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jmoiron/sqlx v0.0.0-20171211234905-de8647470aaf/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= +github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 h1:5B0uxl2lzNRVkJVg+uGHxWtRt4C0Wjc6kJKo5XYx8xE= +github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= +github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.0.0-20180716110948-e7c6d408fd5c h1:P2BrTyxPK1DQLq5+Y5LQ0BWli1oO+ebRi7J6ojFhykE= +github.com/jonboulle/clockwork v0.0.0-20180716110948-e7c6d408fd5c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro= +github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kelseyhightower/envconfig v1.3.0 h1:IvRS4f2VcIQy6j4ORGIf9145T/AsUB+oY8LyvN8BXNM= +github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 h1:YUrU1/jxRqnt0PSrKj1Uj/wEjk/fjnE80QFfi2Zlj7Q= +github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169/go.mod h1:glhvuHOU9Hy7/8PwwdtnarXqLagOX0b/TbZx2zLMqEg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v0.0.0-20170306183709-ca5bc43047f2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/magiconair/properties v0.0.0-20160908093658-0723e352fa35 h1:lKVye3pqP9/O2EuIorT0CivWJM3vMzS63kStsgONluY= +github.com/magiconair/properties v0.0.0-20160908093658-0723e352fa35/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/markbates/going v1.0.1 h1:IFDakPS7ROqx1rESYPSZmURUTwI4HWuM5waQIFCUZZQ= +github.com/markbates/going v1.0.1/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA= +github.com/markbates/inflect v0.0.0-20171215194931-a12c3aec81a6/go.mod h1:oTeZL2KHA7CUX6X+fovmK9OvIOFuqu0TwdQrZjLTh88= +github.com/markbates/inflect v1.0.0 h1:gTffXSQCc+WaIvBcI/IItJQMOemietXr5EIKLXDYqI4= +github.com/markbates/inflect v1.0.0/go.mod h1:oTeZL2KHA7CUX6X+fovmK9OvIOFuqu0TwdQrZjLTh88= +github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4 h1:Mlji5gkcpzkqTROyE4ZxZ8hN7osunMb2RuGVrbvMvCc= +github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/mattn/go-colorable v0.0.0-20170210172801-5411d3eea597 h1:hGizH4aMDFFt1iOA4HNKC13lqIBoCyxIjWcAnWIy7aU= +github.com/mattn/go-colorable v0.0.0-20170210172801-5411d3eea597/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.0-20170307163044-57fdcb988a5c h1:AHfQR/s6GNi92TOh+kfGworqDvTxj2rMsS+Hca87nck= +github.com/mattn/go-isatty v0.0.0-20170307163044-57fdcb988a5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-sqlite3 v1.1.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/microcosm-cc/bluemonday v1.0.1 h1:SIYunPjnlXcW+gVfvm0IlSeR5U3WZUOLfVmqg85Go44= +github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= +github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v0.0.0-20170125051937-db1efb556f84 h1:rrg06yhhsqEELubsnYWqadxdi0CYJ97s899oUXDIrkY= +github.com/mitchellh/mapstructure v0.0.0-20170125051937-db1efb556f84/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/nats-io/go-nats v1.3.0 h1:CrvnAwoB2A2Yma+PcM+5tC++3/wswhcy8OvzqbsUXZQ= +github.com/nats-io/go-nats v1.3.0/go.mod h1:+t7RHT5ApZebkrQdnn6AhQJmhJJiKAvJUio1PiiCtj0= +github.com/nats-io/go-nats-streaming v0.3.4 h1:4z1stoQQfetddeodZ4huO24LK0QY75Mg4r9037J90MI= +github.com/nats-io/go-nats-streaming v0.3.4/go.mod h1:gfq4R3c9sKAINOpelo0gn/b9QDMBZnmrttcsNF+lqyo= +github.com/nats-io/nuid v0.0.0-20170303150224-3cf34f9fca4e h1:OMRBwfCdd+UhckVO+3OGdxnuaKD4IILn0aIJu9JRRbY= +github.com/nats-io/nuid v0.0.0-20170303150224-3cf34f9fca4e/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/netlify/mailme v0.0.0-20170821082834-c4a76ce443c1 h1:M2ZOTs3pghyh9s/FfCcp0FfsrVCgiDG76b4RAYTxBbE= +github.com/netlify/mailme v0.0.0-20170821082834-c4a76ce443c1/go.mod h1:/rGcC/hqh7XMtEAf3TGo/ZDKgtZ52ece1va5F+86HvI= +github.com/netlify/netlify-commons v0.7.7 h1:9U0abHrARBk7CiHTcSXV9cN262PAhzDLKP8LtlEDJzM= +github.com/netlify/netlify-commons v0.7.7/go.mod h1:yaQkVHTO9MTOpvR+Y+Pae8VF3bWoFbk54xULGuY2z0o= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/pelletier/go-buffruneio v0.1.0 h1:ig6N9Cg71k/P+UUbhwdOFtJWz+qa8/3by7AzMprMWBM= +github.com/pelletier/go-buffruneio v0.1.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= +github.com/pelletier/go-toml v0.0.0-20160906202557-31055c2ff0bb h1:71gxLeWANf91zBbHOiSh9oZnAnjJvS6TdROIMKCxmNg= +github.com/pelletier/go-toml v0.0.0-20160906202557-31055c2ff0bb/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073 h1:9PqYQCzKEbilrPJl3LDO16HdbA25Yqc3I25aUfgFaCs= +github.com/pkg/sftp v0.0.0-20160908100035-8197a2e58073/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d h1:573lGU02rfWK16h656qmmul1zPul8WPPCDekyq+keVs= +github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russellhaering/gosaml2 v0.3.1 h1:vfw9Kt7cdXsCImYmLBnMO/JxFVTa+x/Eoj7Jx+Th4vw= +github.com/russellhaering/gosaml2 v0.3.1/go.mod h1:niieRtQaw+opTVp9jzZo1nAAoksI2eNpd+weDcjZ+Mk= +github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 h1:J4AOUcOh/t1XbQcJfkEqhzgvMJ2tDxdCVvmHxW5QXao= +github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7/go.mod h1:Oz4y6ImuOQZxynhbSXk7btjEfNBtGlj2dcaOvXl2FSM= +github.com/satori/go.uuid v0.0.0-20180103174451-36e9d2ebbde5 h1:tfcGHuraNSEY9xRb9ckCMqMD7xAjzrYI1WpD7DA+nz8= +github.com/satori/go.uuid v0.0.0-20180103174451-36e9d2ebbde5/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35 h1:eajwn6K3weW5cd1ZXLu2sJ4pvwlBiCWY4uDejOr73gM= +github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35/go.mod h1:wozgYq9WEBQBaIJe4YZ0qTSFAMxmcwBhQH0fO0R34Z0= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +github.com/sergi/go-diff v0.0.0-20180205163309-da645544ed44/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d h1:sbFYt64AiE+03DzfiQJBEowP+C8hVnEbKwCCy5HlVdc= +github.com/shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:DmcHeT/UuSDXaCVb8IijmL+fHX+FK9TLy98W7mfDXXg= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b h1:vYEG87HxbU6dXj5npkeulCS96Dtz5xg3jcfCgpcvbIw= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= +github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8 h1:xLQlo0Ghg8zBaQi+tjpK+z/WLjbg/BhAWP9pYgqo/LQ= +github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9 h1:j3cAp1j8k/tSLaCcDiXIpVJ8FzSJ9g1eeOAPRJYM75k= +github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/signalfx/com_signalfx_metrics_protobuf v0.0.0-20170330202426-93e507b42f43 h1:JRmIUcy6IKEDUV0SHg7393Fh8DomnKRfz6qDto43hx8= +github.com/signalfx/com_signalfx_metrics_protobuf v0.0.0-20170330202426-93e507b42f43/go.mod h1:muYA2clvwCdj7nzAJ5vJIXYpJsUumhAl4Uu1wUNpWzA= +github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 h1:WsShHmu12ZztYPfh9b+I+VjYD1o8iOHhB67WZCMEEE8= +github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083/go.mod h1:adPDS6s7WaajdFBV9mQ7i0dKfQ8xiDnF9ZNETVPpp7c= +github.com/signalfx/golib v1.0.0 h1:83rjhi/Av0ANt8Jhfdk0eg5o/z3KzaZ4G2sP93DRxQI= +github.com/signalfx/golib v1.0.0/go.mod h1:nWYefOwlUKWm/SpN/LgVSBnyH1T9NpT1ANlmgRIi1Cs= +github.com/sirupsen/logrus v1.0.3 h1:B5C/igNWoiULof20pKfY4VntcIPqKuwEmoLZrabbUrc= +github.com/sirupsen/logrus v1.0.3/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= +github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d h1:sd1qRX4NJPdIHizg+E7cK0kFaJRjwfJFQyUJUguwIak= +github.com/spf13/afero v0.0.0-20160821083612-20500e2abd0d/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a h1:tPI5RnYZJhcXj0LhJ9pi7PS7gqOhuFR+4HEKyDz3BnQ= +github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cobra v0.0.0-20170228191748-fcd0c5a1df88 h1:gtQhsEOuPoLkS8vHv0VGgyonGFFj7vqDH9plPHSdulg= +github.com/spf13/cobra v0.0.0-20170228191748-fcd0c5a1df88/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80 h1:evyGXhHMrxKBDkdlSPv9HMWV2o53o+Ibhm28BGc0450= +github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff h1:VARhShG49tiji6mdRNp7JTNDtJ0FhuprF93GBQ37xGU= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I= +github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/streadway/amqp v0.0.0-20170707203015-2cbfe40c9341 h1:Pt0+LCXmuNNCiVJu1fDjydxdqSicM9nv3E+6aq/0eQU= +github.com/streadway/amqp v0.0.0-20170707203015-2cbfe40c9341/go.mod h1:1WNBiOZtZQLpVAyu0iTduoJL9hEsMloAK5XWrtW0xdY= +github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20180127211104-1875d0a70c90 h1:DNyuYmiOz3AH2rGH1n4YsZUvxVhkeMvSs8s31jiWpm0= +golang.org/x/crypto v0.0.0-20180127211104-1875d0a70c90/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20170303215036-d379faa25cbd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0= +golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95 h1:RS+wSrhdVci7CsPwJaMN8exaP3UTuQU0qB34R/E/JD0= +golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20171101214715-fd80eb99c8f6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180927150500-dad3d9fb7b6e h1:AqqkRhkzWTerVplYmF0GrGl2ri2S5+F5xhJfDSc/SJY= +golang.org/x/sys v0.0.0-20180927150500-dad3d9fb7b6e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.0.0-20170303005346-f28f36722d5e/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/api v0.0.0-20170821230356-dd6bdadc5852 h1:8m8eq+cjxNeY7X4z1lAx4a/bvw17NXWalnzXTRrDQHE= +google.golang.org/api v0.0.0-20170821230356-dd6bdadc5852/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/appengine v0.0.0-20170814190942-d9a072cfa7b9/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/gomail.v2 v2.0.0-20150902115704-41f357289737 h1:NvePS/smRcFQ4bMtTddFtknbGCtoBkJxGmpSpVRafCc= +gopkg.in/gomail.v2 v2.0.0-20150902115704-41f357289737/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= +gopkg.in/logfmt.v0 v0.3.0 h1:SiZDwieL7v5NrIXHyGir38XvjZuyPFy8HUvNjRwnBc4= +gopkg.in/logfmt.v0 v0.3.0/go.mod h1:mRLMcMLrml5h2Ux/H+4zccFOlVCiRvOvndsolsJoU8Q= +gopkg.in/stack.v1 v1.6.0 h1:WkfFeTqPHn0dtlW3InvWjpVVIb0to4vZ3Qoy8PMTV80= +gopkg.in/stack.v1 v1.6.0/go.mod h1:QtWz4C5wbvhA63ngux3942W/ppRxtyYjHvvhz02s7+M= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= +gopkg.in/yaml.v2 v2.0.0-20170208141851-a3f3340b5840/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/hack/migrations/schema.sql b/hack/migrations/schema.sql new file mode 100644 index 000000000..e69de29bb diff --git a/metering/record.go b/metering/record.go index 835aa132c..db1857cef 100644 --- a/metering/record.go +++ b/metering/record.go @@ -1,7 +1,7 @@ package metering import ( - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/sirupsen/logrus" ) diff --git a/migrations/schema.sql b/migrations/schema.sql index 12197a470..e69de29bb 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -1,131 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.19, for osx10.13 (x86_64) --- --- Host: 127.0.0.1 Database: gotrue_development --- ------------------------------------------------------ --- Server version 5.7.20 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `audit_log_entries` --- - -DROP TABLE IF EXISTS `audit_log_entries`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `audit_log_entries` ( - `instance_id` varchar(255) DEFAULT NULL, - `id` varchar(255) NOT NULL, - `payload` json DEFAULT NULL, - `created_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `audit_logs_instance_id_idx` (`instance_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `instances` --- - -DROP TABLE IF EXISTS `instances`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `instances` ( - `id` varchar(255) NOT NULL, - `uuid` varchar(255) DEFAULT NULL, - `raw_base_config` longtext, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `refresh_tokens` --- - -DROP TABLE IF EXISTS `refresh_tokens`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `refresh_tokens` ( - `instance_id` varchar(255) DEFAULT NULL, - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `token` varchar(255) DEFAULT NULL, - `user_id` varchar(255) DEFAULT NULL, - `revoked` tinyint(1) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `refresh_tokens_instance_id_idx` (`instance_id`), - KEY `refresh_tokens_instance_id_user_id_idx` (`instance_id`,`user_id`), - KEY `refresh_tokens_token_idx` (`token`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `schema_migration` --- - -DROP TABLE IF EXISTS `schema_migration`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `schema_migration` ( - `version` varchar(255) NOT NULL, - UNIQUE KEY `version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `users` --- - -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users` ( - `instance_id` varchar(255) DEFAULT NULL, - `id` varchar(255) NOT NULL, - `aud` varchar(255) DEFAULT NULL, - `role` varchar(255) DEFAULT NULL, - `email` varchar(255) DEFAULT NULL, - `encrypted_password` varchar(255) DEFAULT NULL, - `confirmed_at` timestamp NULL DEFAULT NULL, - `invited_at` timestamp NULL DEFAULT NULL, - `confirmation_token` varchar(255) DEFAULT NULL, - `confirmation_sent_at` timestamp NULL DEFAULT NULL, - `recovery_token` varchar(255) DEFAULT NULL, - `recovery_sent_at` timestamp NULL DEFAULT NULL, - `email_change_token` varchar(255) DEFAULT NULL, - `email_change` varchar(255) DEFAULT NULL, - `email_change_sent_at` timestamp NULL DEFAULT NULL, - `last_sign_in_at` timestamp NULL DEFAULT NULL, - `raw_app_meta_data` json DEFAULT NULL, - `raw_user_meta_data` json DEFAULT NULL, - `is_super_admin` tinyint(1) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `users_instance_id_idx` (`instance_id`), - KEY `users_instance_id_email_idx` (`instance_id`,`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2018-01-19 17:00:48 diff --git a/models/audit_log_entry.go b/models/audit_log_entry.go index 405415fda..ffc43a3bd 100644 --- a/models/audit_log_entry.go +++ b/models/audit_log_entry.go @@ -8,7 +8,7 @@ import ( "github.com/netlify/gotrue/storage" "github.com/netlify/gotrue/storage/namespace" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) type AuditAction string diff --git a/models/instance.go b/models/instance.go index 948b5dd1c..4eaee45a4 100644 --- a/models/instance.go +++ b/models/instance.go @@ -9,7 +9,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/storage" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) const baseConfigKey = "" diff --git a/models/refresh_token.go b/models/refresh_token.go index 3e097e3d0..09178d8a4 100644 --- a/models/refresh_token.go +++ b/models/refresh_token.go @@ -8,7 +8,7 @@ import ( "github.com/netlify/gotrue/crypto" "github.com/netlify/gotrue/storage" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" ) // RefreshToken is the database model for refresh tokens. diff --git a/models/refresh_token_test.go b/models/refresh_token_test.go index 7d1e83d5e..152076672 100644 --- a/models/refresh_token_test.go +++ b/models/refresh_token_test.go @@ -6,7 +6,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/storage" "github.com/netlify/gotrue/storage/test" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/models/user.go b/models/user.go index fb95f29c7..c1b462884 100644 --- a/models/user.go +++ b/models/user.go @@ -9,7 +9,7 @@ import ( "github.com/netlify/gotrue/storage" "github.com/netlify/gotrue/storage/namespace" "github.com/pkg/errors" - "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "golang.org/x/crypto/bcrypt" ) diff --git a/models/user_test.go b/models/user_test.go index f04c9f8d6..078ef023b 100644 --- a/models/user_test.go +++ b/models/user_test.go @@ -6,7 +6,7 @@ import ( "github.com/netlify/gotrue/conf" "github.com/netlify/gotrue/storage" "github.com/netlify/gotrue/storage/test" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/storage/dial.go b/storage/dial.go index 24d64d15b..4b8c9678f 100644 --- a/storage/dial.go +++ b/storage/dial.go @@ -68,7 +68,7 @@ func getExcludedColumns(model interface{}, includeColumns ...string) ([]string, } // get all columns and remove included to get excluded set - cols := columns.ColumnsForStructWithAlias(model, sm.TableName(), sm.As) + cols := columns.ForStructWithAlias(model, sm.TableName(), sm.As) for _, f := range includeColumns { if _, ok := cols.Cols[f]; !ok { return nil, errors.Errorf("Invalid column name %s", f) diff --git a/storage/dial_test.go b/storage/dial_test.go index dd694d7a6..31509af7d 100644 --- a/storage/dial_test.go +++ b/storage/dial_test.go @@ -3,7 +3,7 @@ package storage import ( "testing" - uuid "github.com/satori/go.uuid" + "github.com/gobuffalo/uuid" "github.com/stretchr/testify/require" ) From b1ff415921ada1ab083fc5f3635370ea87457e9a Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 03:18:45 +0600 Subject: [PATCH 03/12] remove glide --- glide.lock | 356 ------------------------------------- glide.yaml | 58 ------ hack/migrations/schema.sql | 0 3 files changed, 414 deletions(-) delete mode 100644 glide.lock delete mode 100644 glide.yaml delete mode 100644 hack/migrations/schema.sql diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 6ebaf4a9a..000000000 --- a/glide.lock +++ /dev/null @@ -1,356 +0,0 @@ -hash: 051dbaa04c205b74acc1b486c22d8f12431465029106f6ee58d23dadb95d55c6 -updated: 2018-10-17T01:29:41.8356134+06:00 -imports: -- name: cloud.google.com/go - version: 98f5696b1026056a47f114c4451dbc4703d67191 - subpackages: - - compute/metadata -- name: github.com/badoux/checkmail - version: d0a759655d62bcdc95c50a0676f3e9702ed59453 -- name: github.com/beevik/etree - version: 90dafc1e1f114dfb9576218bb43c03fb854d1b34 -- name: github.com/bugsnag/bugsnag-go - version: 036f1af2a63f8133e596d1c127c86100b4642ba1 - subpackages: - - errors -- name: github.com/bugsnag/panicwrap - version: dd8df9a3778aaebc569794383e5c4ce87d6fd89e -- name: github.com/cockroachdb/cockroach-go - version: e0a95dfd547cc9c3ebaaba1a12c2afe4bf621ac5 - subpackages: - - crdb -- name: github.com/dgrijalva/jwt-go - version: d2709f9f1f31ebcda9651b03077758c1f3a0018c -- name: github.com/fatih/color - version: 5df930a27be2502f99b292b7cc09ebad4d0891f4 -- name: github.com/fatih/structs - version: 878a968ab22548362a09bdb3322f98b00f470d46 -- name: github.com/fsnotify/fsnotify - version: f12c6236fe7b5cf6bcf30e5935d08cb079d78334 -- name: github.com/go-chi/chi - version: b8567b6442e27704bfeb725095091581cbe82a00 - subpackages: - - middleware -- name: github.com/go-sql-driver/mysql - version: a0583e0143b1624142adab07e0e97fe106d99561 -- name: github.com/gobuffalo/envy - version: a1789093e51b497900a240e15b39d8a97bfbc5d0 -- name: github.com/gobuffalo/fizz - version: 2ee389a202a50a7ace33ad8f97b9f0b27932e264 - subpackages: - - translators -- name: github.com/gobuffalo/flect - version: ae7ed6bfe683063bab833454fa8a95a789139f3f - subpackages: - - name -- name: github.com/gobuffalo/github_flavored_markdown - version: 99b77ecb08795b8b2cf87f687633f95e8f40c651 - subpackages: - - internal/russross/blackfriday -- name: github.com/gobuffalo/makr - version: bfe537384e6f4cf8a4d9d149bae4f519b186c9fe -- name: github.com/gobuffalo/packr - version: 7458c919b2ddc10bfb5588b6645b7aefd1c60418 -- name: github.com/gobuffalo/plush - version: 1c2f6e358d7ed2cca00d3a43796c665a11151597 - subpackages: - - ast - - lexer - - parser - - token -- name: github.com/gobuffalo/pop - version: 585d7fb894f4c14a7a0c90cc74b87188b4afc361 - subpackages: - - associations - - columns - - fix - - logging - - nulls -- name: github.com/gobuffalo/tags - version: da5de2a6b4fdd40153789f7efff1330616e28de7 - subpackages: - - form - - form/bootstrap -- name: github.com/gobuffalo/uuid - version: 2a766f2b8b8299437782042f22bfe3e153ff945e -- name: github.com/gobuffalo/validate - version: 35866c4badf3a9f3a87db5ade6159e6ecf148d2a - subpackages: - - validators -- name: github.com/gogo/protobuf - version: 616a82ed12d78d24d4839363e8f3c5d3f20627cf - subpackages: - - gogoproto - - proto - - protoc-gen-gogo/descriptor -- name: github.com/golang/protobuf - version: ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e - subpackages: - - proto -- name: github.com/GoogleCloudPlatform/cloudsql-proxy - version: 571947b0f240c8b2fa4d163065e5b155920ddfa9 - subpackages: - - logging - - proxy/certs - - proxy/dialers/mysql - - proxy/proxy - - proxy/util -- name: github.com/hashicorp/hcl - version: 99df0eb941dd8ddbc83d3f3605a34f6a686ac85e - subpackages: - - hcl/ast - - hcl/parser - - hcl/scanner - - hcl/strconv - - hcl/token - - json/parser - - json/scanner - - json/token -- name: github.com/imdario/mergo - version: 3e95a51e0639b4cf372f2ccf74c86749d747fbdc -- name: github.com/inconshreveable/mousetrap - version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -- name: github.com/jackc/pgx - version: 20eaa7963b9d714bfaf678dcb2448fbd1e3671b9 - subpackages: - - chunkreader - - internal/sanitize - - pgio - - pgproto3 - - pgtype -- name: github.com/jmoiron/sqlx - version: de8647470aafe4854c976707c431dbe1eb2822c6 - subpackages: - - reflectx -- name: github.com/joho/godotenv - version: a79fa1e548e2c689c241d10173efd51e5d689d5b -- name: github.com/jonboulle/clockwork - version: e7c6d408fd5c44ee1e1d8b79ae32b426afae1f28 -- name: github.com/kardianos/osext - version: ae77be60afb1dcacde03767a8c37337fad28ac14 -- name: github.com/kballard/go-shellquote - version: 95032a82bc518f77982ea72343cc1ade730072f0 -- name: github.com/kelseyhightower/envconfig - version: f611eb38b3875cc3bd991ca91c51d06446afa14c -- name: github.com/kr/fs - version: 2788f0dbd16903de03cb8186e5c7d97b69ad387b -- name: github.com/kr/logfmt - version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 -- name: github.com/lib/pq - version: ca5bc43047f2138703da0f3d3ca89a59f3d597f1 - subpackages: - - oid -- name: github.com/magiconair/properties - version: 0723e352fa358f9322c938cc2dadda874e9151a9 -- name: github.com/markbates/going - version: 0576708c56cea02331f864fe6e157ac7841923e4 - subpackages: - - defaults - - randx -- name: github.com/markbates/inflect - version: a12c3aec81a6a938bf584a4bac567afed9256586 -- name: github.com/markbates/oncer - version: 05fccaae8fc423476d98fd4c3e4699ba0fbbde48 -- name: github.com/mattn/go-colorable - version: 5411d3eea5978e6cdc258b30de592b60df6aba96 - repo: https://github.com/mattn/go-colorable -- name: github.com/mattn/go-isatty - version: 57fdcb988a5c543893cc61bce354a6e24ab70022 - repo: https://github.com/mattn/go-isatty -- name: github.com/mattn/go-sqlite3 - version: 3b3f1d01b2696af5501697c35629048c227586ab -- name: github.com/microcosm-cc/bluemonday - version: 82c7118e8ccf7403d4860175d97bb635e8e28239 -- name: github.com/mitchellh/go-homedir - version: b8bc1bf767474819792c23f32d8286a45736f1c6 -- name: github.com/mitchellh/mapstructure - version: db1efb556f84b25a0a13a04aad883943538ad2e0 -- name: github.com/nats-io/go-nats - version: 29f9728a183bf3fa7e809e14edac00b33be72088 - subpackages: - - encoders/builtin - - util -- name: github.com/nats-io/go-nats-streaming - version: 6e620057a207bd61e992c1c5b6a2de7b6a4cb010 - subpackages: - - pb -- name: github.com/nats-io/nuid - version: 3cf34f9fca4e88afa9da8eabd75e3326c9941b44 -- name: github.com/netlify/mailme - version: c4a76ce443c1122ead2518b28cc7ffaf1091cc9a -- name: github.com/netlify/netlify-commons - version: b08431ec3d35114c2ad8bbfc5f4d872dc265bd52 - subpackages: - - discovery - - graceful - - messaging - - metrics - - metrics/transport - - nconf - - tls -- name: github.com/pborman/uuid - version: a97ce2ca70fa5a848076093f05e639a89ca34d06 -- name: github.com/pelletier/go-buffruneio - version: df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d -- name: github.com/pelletier/go-toml - version: 31055c2ff0bb0c7f9095aec0d220aed21108121e -- name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d -- name: github.com/pkg/sftp - version: 8197a2e580736b78d704be0fc47b2324c0591a32 -- name: github.com/rs/cors - version: 8dd4211afb5d08dbb39a533b9bb9e4b486351df6 -- name: github.com/russellhaering/gosaml2 - version: 4f381189230874b6542a39d68f3f89dfd66f969d - subpackages: - - types - - uuid -- name: github.com/russellhaering/goxmldsig - version: 7acd5e4a6ef74fe1b082c20f119556adf70c3944 - subpackages: - - etreeutils - - types -- name: github.com/satori/go.uuid - version: 36e9d2ebbde5e3f13ab2e25625fd453271d6522e -- name: github.com/sebest/xff - version: 6c115e0ffa35d6a2e3f7a9e797c9cf07f0da4b9f -- name: github.com/serenize/snaker - version: a683aaf2d516deecd70cad0c72e3ca773ecfcef0 -- name: github.com/sergi/go-diff - version: da645544ed44df016359bd4c0e3dc60ee3a0da43 - subpackages: - - diffmatchpatch -- name: github.com/shopify/logrus-bugsnag - version: 6dbc35f2c30d1e37549f9673dd07912452ab28a5 -- name: github.com/shurcooL/highlight_diff - version: 09bb4053de1b1d872a9f25dc21378fa71dca4e4e -- name: github.com/shurcooL/highlight_go - version: 78fb10f4a5f89e812a5e26ab723b954a51226086 -- name: github.com/shurcooL/octicon - version: c42b0e3b24d96976ecac81ef691662777b39ef64 -- name: github.com/shurcooL/sanitized_anchor_name - version: 86672fcb3f950f35f2e675df2240550f2a50762f -- name: github.com/signalfx/com_signalfx_metrics_protobuf - version: 93e507b42f43f458a109ca278d1542a26a0b87fc -- name: github.com/signalfx/gohistogram - version: 1ccfd2ff508314074672f4450a917011a2060408 -- name: github.com/signalfx/golib - version: cb7680940d605b817db79790c241eed2a00fa6e6 - subpackages: - - datapoint - - errors - - event - - eventcounter - - log - - sfxclient - - timekeeper -- name: github.com/sirupsen/logrus - version: f006c2ac4710855cf0f916dd6b77acf6b048dc6e -- name: github.com/sourcegraph/annotate - version: f4cad6c6324d3f584e1743d8b3e0e017a5f3a636 -- name: github.com/sourcegraph/syntaxhighlight - version: bd320f5d308e1a3c4314c678d8227a0d72574ae7 -- name: github.com/spf13/afero - version: 20500e2abd0d1f4564a499e83d11d6c73cd58c27 - subpackages: - - mem - - sftp -- name: github.com/spf13/cast - version: e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63 -- name: github.com/spf13/cobra - version: fcd0c5a1df88f5d6784cb4feead962c3f3d0b66c -- name: github.com/spf13/jwalterweatherman - version: 33c24e77fb80341fe7130ee7c594256ff08ccc46 -- name: github.com/spf13/pflag - version: 9ff6c6923cfffbcd502984b8e0c80539a94968b7 -- name: github.com/spf13/viper - version: 25b30aa063fc18e48662b86996252eabdcf2f0c7 -- name: github.com/streadway/amqp - version: 2cbfe40c9341ad63ba23e53013b3ddc7989d801c -- name: github.com/stretchr/testify - version: b91bfb9ebec76498946beb6af7c0230c7cc7ba6c - subpackages: - - assert - - require - - suite -- name: golang.org/x/crypto - version: 1875d0a70c90e57f11972aefd42276df65e895b9 - subpackages: - - bcrypt - - blowfish - - curve25519 - - ed25519 - - ed25519/internal/edwards25519 - - internal/chacha20 - - poly1305 - - ssh - - ssh/terminal -- name: golang.org/x/net - version: d379faa25cbdc04d653984913a2ceb43b0bc46d7 - subpackages: - - context - - context/ctxhttp - - html - - html/atom -- name: golang.org/x/oauth2 - version: 9a379c6b3e95a790ffc43293c2a78dee0d7b6e20 - subpackages: - - bitbucket - - facebook - - github - - google - - internal - - jws - - jwt -- name: golang.org/x/sync - version: fd80eb99c8f653c847d294a001bdf2a3a6f768f5 - subpackages: - - errgroup -- name: golang.org/x/sys - version: 37707fdb30a5b38865cfb95e5aab41707daec7fd - subpackages: - - unix - - windows -- name: golang.org/x/text - version: f28f36722d5ef2f9655ad3de1f248e3e52ad5ebd - subpackages: - - transform - - unicode/norm -- name: google.golang.org/api - version: dd6bdadc5852eae2d133075a3690d6ad744add48 - subpackages: - - gensupport - - googleapi - - googleapi/internal/uritemplates - - sqladmin/v1beta4 -- name: google.golang.org/appengine - version: d9a072cfa7b9736e44311ef77b3e09d804bfa599 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: gopkg.in/alexcesaro/quotedprintable.v3 - version: 2caba252f4dc53eaf6b553000885530023f54623 -- name: gopkg.in/gomail.v2 - version: 41f3572897373c5538c50a2402db15db079fa4fd -- name: gopkg.in/logfmt.v0 - version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 -- name: gopkg.in/stack.v1 - version: 817915b46b97fd7bb80e8ab6b69f01a53ac3eebf -- name: gopkg.in/yaml.v2 - version: a3f3340b5840cee44f372bddb5880fcbc419b46a -testImports: -- name: github.com/davecgh/go-spew - version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 - subpackages: - - spew -- name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d - subpackages: - - difflib diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 28021548e..000000000 --- a/glide.yaml +++ /dev/null @@ -1,58 +0,0 @@ -package: github.com/netlify/gotrue -import: -- package: github.com/dgrijalva/jwt-go - version: v3.0.0 -- package: github.com/pborman/uuid - version: v1.0 -- package: github.com/rs/cors - version: v1.1 -- package: golang.org/x/crypto - version: 1875d0a70c90e57f11972aefd42276df65e895b9 - subpackages: - - bcrypt -- package: gopkg.in/gomail.v2 - version: 2.0.0 -- package: github.com/netlify/mailme -- package: github.com/stretchr/testify - version: v1.2.0 - subpackages: - - suite - - require - - assert -- package: github.com/badoux/checkmail -- package: golang.org/x/oauth2 - subpackages: - - bitbucket - - github - - facebook - - google -- package: github.com/sirupsen/logrus - version: v1.0.3 -- package: github.com/spf13/cobra -- package: github.com/pkg/errors - version: v0.8.0 -- package: github.com/go-sql-driver/mysql - version: v1.3 -- package: github.com/spf13/viper -- package: github.com/go-chi/chi - version: v3.1.4 -- package: github.com/netlify/netlify-commons - version: v0.7.7 - subpackages: - - graceful - - nconf -- package: github.com/imdario/mergo -- package: github.com/sebest/xff -- package: github.com/GoogleCloudPlatform/cloudsql-proxy - version: "1.10" - subpackages: - - proxy/dialers/mysql -- package: github.com/kelseyhightower/envconfig - version: v1.3.0 -- package: github.com/joho/godotenv - version: v1.2.0 -- package: github.com/gobuffalo/pop - version: v4.8.4 -- package: github.com/russellhaering/gosaml2 - version: ~0.3.1 -- package: github.com/russellhaering/goxmldsig diff --git a/hack/migrations/schema.sql b/hack/migrations/schema.sql deleted file mode 100644 index e69de29bb..000000000 From 40a834c76212c578d0515c2c9571c8d74efb99dd Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 03:40:28 +0600 Subject: [PATCH 04/12] attempt to fix test --- .travis.yml | 3 +-- Makefile | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7551620c7..546b54a4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: go go: - - 1.8 - - 1.9 + - 1.11.1 services: - docker diff --git a/Makefile b/Makefile index ac39c11ea..0858b470a 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,7 @@ build: ## Build the binary. deps: ## Install dependencies. @go get -u github.com/gobuffalo/pop/soda - @go get -u github.com/golang/lint/golint - @go get -u github.com/Masterminds/glide && glide install + @go get -u golang.org/x/lint/golint image: ## Build the Docker image. docker build . From db4283ef5d399dbc087f7f86620d0eb99edf6547 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 03:51:14 +0600 Subject: [PATCH 05/12] attempt to fix travis --- .travis.yml | 3 +++ Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 546b54a4c..5287d55a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ language: go go: - 1.11.1 +env: + - GO111MODULE=on + services: - docker before_install: diff --git a/Makefile b/Makefile index 0858b470a..9ec5c1ac8 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ build: ## Build the binary. deps: ## Install dependencies. @go get -u github.com/gobuffalo/pop/soda @go get -u golang.org/x/lint/golint + @go mod download image: ## Build the Docker image. docker build . From 7888500a5c4f0ca91f76112437a400b9255d70e4 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 04:18:07 +0600 Subject: [PATCH 06/12] undo changes of example.env --- example.env | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/example.env b/example.env index 83ca96213..6f943e313 100644 --- a/example.env +++ b/example.env @@ -1,18 +1,18 @@ -GOTRUE_JWT_SECRET="m1HIQZxYScoiKkTp1DTv45WFiyt7r92p" +GOTRUE_JWT_SECRET="CHANGE-THIS! VERY IMPORTANT!" GOTRUE_JWT_EXP=3600 GOTRUE_JWT_AUD=api.netlify.com GOTRUE_DB_DRIVER=mysql -DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true&multiStatements=true" +DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true" GOTRUE_API_HOST=localhost PORT=9999 GOTRUE_SITE_URL=https://my-jam-site.example.com -GOTRUE_SMTP_HOST=smtp.sendgrid.net +GOTRUE_SMTP_HOST=smtp.mandrillapp.com GOTRUE_SMTP_PORT=587 -GOTRUE_SMTP_USER=apikey -GOTRUE_SMTP_PASS=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 -GOTRUE_SMTP_ADMIN_EMAIL=noreply@coinread.com +GOTRUE_SMTP_USER=test@example.com +GOTRUE_SMTP_PASS=super-secret-password +GOTRUE_SMTP_ADMIN_EMAIL=admin@example.com GOTRUE_MAILER_SUBJECTS_CONFIRMATION="Welcome to GoTrue!" GOTRUE_MAILER_SUBJECTS_RECOVERY="Reset your GoTrue password!" GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://localhost:9999/callback GOTRUE_LOG_LEVEL=DEBUG -GOTRUE_OPERATOR_TOKEN=NZ4qIdsRXuuIAEYiUPGsQ6lx3av7cCdX +GOTRUE_OPERATOR_TOKEN=super-secret-operator-token From 33aa6bff0af3e483556ad36ff45f7971ecfda405 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 14:18:05 +0600 Subject: [PATCH 07/12] re-add context on the schema.sql --- migrations/schema.sql | 131 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) mode change 100644 => 100755 migrations/schema.sql diff --git a/migrations/schema.sql b/migrations/schema.sql old mode 100644 new mode 100755 index e69de29bb..91e1d4fe0 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -0,0 +1,131 @@ +-- MySQL dump 10.13 Distrib 5.7.19, for osx10.13 (x86_64) +-- +-- Host: 127.0.0.1 Database: gotrue_development +-- ------------------------------------------------------ +-- Server version 5.7.20 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `audit_log_entries` +-- + +DROP TABLE IF EXISTS `audit_log_entries`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `audit_log_entries` ( + `instance_id` varchar(255) DEFAULT NULL, + `id` varchar(255) NOT NULL, + `payload` json DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `audit_logs_instance_id_idx` (`instance_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `instances` +-- + +DROP TABLE IF EXISTS `instances`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `instances` ( + `id` varchar(255) NOT NULL, + `uuid` varchar(255) DEFAULT NULL, + `raw_base_config` longtext, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `refresh_tokens` +-- + +DROP TABLE IF EXISTS `refresh_tokens`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `refresh_tokens` ( + `instance_id` varchar(255) DEFAULT NULL, + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `token` varchar(255) DEFAULT NULL, + `user_id` varchar(255) DEFAULT NULL, + `revoked` tinyint(1) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `refresh_tokens_instance_id_idx` (`instance_id`), + KEY `refresh_tokens_instance_id_user_id_idx` (`instance_id`,`user_id`), + KEY `refresh_tokens_token_idx` (`token`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migration` +-- + +DROP TABLE IF EXISTS `schema_migration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `schema_migration` ( + `version` varchar(255) NOT NULL, + UNIQUE KEY `version_idx` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `instance_id` varchar(255) DEFAULT NULL, + `id` varchar(255) NOT NULL, + `aud` varchar(255) DEFAULT NULL, + `role` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `encrypted_password` varchar(255) DEFAULT NULL, + `confirmed_at` timestamp NULL DEFAULT NULL, + `invited_at` timestamp NULL DEFAULT NULL, + `confirmation_token` varchar(255) DEFAULT NULL, + `confirmation_sent_at` timestamp NULL DEFAULT NULL, + `recovery_token` varchar(255) DEFAULT NULL, + `recovery_sent_at` timestamp NULL DEFAULT NULL, + `email_change_token` varchar(255) DEFAULT NULL, + `email_change` varchar(255) DEFAULT NULL, + `email_change_sent_at` timestamp NULL DEFAULT NULL, + `last_sign_in_at` timestamp NULL DEFAULT NULL, + `raw_app_meta_data` json DEFAULT NULL, + `raw_user_meta_data` json DEFAULT NULL, + `is_super_admin` tinyint(1) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `users_instance_id_idx` (`instance_id`), + KEY `users_instance_id_email_idx` (`instance_id`,`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2018-01-19 17:00:48 \ No newline at end of file From 1b70dbef9f23eb4b87655705e0862a2758008da2 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 14:33:32 +0600 Subject: [PATCH 08/12] added multiStatements=true --- example.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 example.env diff --git a/example.env b/example.env old mode 100644 new mode 100755 index 6f943e313..0b8d42136 --- a/example.env +++ b/example.env @@ -2,7 +2,7 @@ GOTRUE_JWT_SECRET="CHANGE-THIS! VERY IMPORTANT!" GOTRUE_JWT_EXP=3600 GOTRUE_JWT_AUD=api.netlify.com GOTRUE_DB_DRIVER=mysql -DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true" +DATABASE_URL="root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true&multiStatements=true" GOTRUE_API_HOST=localhost PORT=9999 GOTRUE_SITE_URL=https://my-jam-site.example.com From 9081de77736ab8ea0f2e6960d5a5a17a6f798977 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 15:26:20 +0600 Subject: [PATCH 09/12] update CONTRIBUTING.md for go module --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 index c80c452f5..594e58bd7 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,9 +5,11 @@ please read the [code of conduct](CODE_OF_CONDUCT.md). ## Setup -> Install Go and Glide https://github.com/Masterminds/glide +> Install Go 1.11.1 > Install Docker to run tests +GoTrue uses the Go Modules support built into Go 1.11 to build. The easiest is to clone GoTrue in a directory outside of GOPATH, as in the following example: + ```sh $ git clone https://github.com/netlify/gotrue $ cd gotrue From b593aa2bc5d673319c22a063d4eae10ab8c22bde Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 16:49:29 +0600 Subject: [PATCH 10/12] update Dockerfile --- Dockerfile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c194d241..2957c363b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,26 @@ -FROM golang:1.9.2 +FROM golang:alpine as build +ENV GO111MODULE=on +ENV CGO_ENABLED=0 +ENV GOOS=linux + +RUN apk add --no-cache make git + WORKDIR /go/src/github.com/netlify/gotrue -COPY . /go/src/github.com/netlify/gotrue/ +COPY . /go/src/github.com/netlify/gotrue + +RUN ls -al RUN make deps build +RUN go build -a -installsuffix cgo -o gotrue + FROM alpine:3.7 +RUN adduser -D -u 1000 netlify + RUN apk add --no-cache ca-certificates -RUN adduser -D -u 1000 netlify && mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 -COPY --from=0 /go/src/github.com/netlify/gotrue/gotrue /usr/local/bin/gotrue -COPY --from=0 /go/src/github.com/netlify/gotrue/migrations /usr/local/etc/gotrue/migrations/ -RUN chown netlify:netlify /usr/local/bin/gotrue && chown -R netlify:netlify /usr/local/etc/gotrue +COPY --from=build /go/src/github.com/netlify/gotrue/gotrue /usr/local/bin/gotrue +COPY --from=build /go/src/github.com/netlify/gotrue/migrations /usr/local/etc/gotrue/migrations/ -USER netlify ENV GOTRUE_DB_MIGRATIONS_PATH /usr/local/etc/gotrue/migrations -CMD ["gotrue"] + +USER netlify +CMD ["gotrue"] \ No newline at end of file From 2cdcf437670d47b145d5bd3a8ed4a76bc6d1d234 Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Wed, 17 Oct 2018 16:55:51 +0600 Subject: [PATCH 11/12] remove debug from Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2957c363b..d9889d11c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN apk add --no-cache make git WORKDIR /go/src/github.com/netlify/gotrue COPY . /go/src/github.com/netlify/gotrue -RUN ls -al RUN make deps build RUN go build -a -installsuffix cgo -o gotrue From d7772d7e49b9bbded9fedf7c6adec744f1646faf Mon Sep 17 00:00:00 2001 From: Asaduzzaman Pavel Date: Thu, 18 Oct 2018 09:08:53 +0600 Subject: [PATCH 12/12] fix some linter warning --- api/errors.go | 2 +- api/external.go | 4 ++-- api/external_oauth.go | 2 +- api/hooks.go | 2 +- api/invite.go | 2 +- api/signup.go | 4 ++-- api/token.go | 1 + 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/api/errors.go b/api/errors.go index 53107ca09..1b427a070 100644 --- a/api/errors.go +++ b/api/errors.go @@ -8,7 +8,7 @@ import ( "runtime/debug" ) -var oauthErrorMap map[int]string = map[int]string{ +var oauthErrorMap = map[int]string{ http.StatusBadRequest: "invalid_request", http.StatusUnauthorized: "unauthorized_client", http.StatusForbidden: "access_denied", diff --git a/api/external.go b/api/external.go index 5e5d6178b..4f089ef64 100644 --- a/api/external.go +++ b/api/external.go @@ -96,7 +96,7 @@ func (a *API) internalExternalProviderCallback(w http.ResponseWriter, r *http.Re } userData = samlUserData } else { - oAuthUserData, err := a.oAuthCallback(r, ctx, providerType) + oAuthUserData, err := a.oAuthCallback(ctx, r, providerType) if err != nil { return err } @@ -135,7 +135,7 @@ func (a *API) internalExternalProviderCallback(w http.ResponseWriter, r *http.Re } } - user, terr = a.signupNewUser(tx, ctx, params) + user, terr = a.signupNewUser(ctx, tx, params) if terr != nil { return terr } diff --git a/api/external_oauth.go b/api/external_oauth.go index 544955f97..94342cd0b 100644 --- a/api/external_oauth.go +++ b/api/external_oauth.go @@ -20,7 +20,7 @@ func (a *API) loadOAuthState(w http.ResponseWriter, r *http.Request) (context.Co return a.loadExternalState(ctx, state) } -func (a *API) oAuthCallback(r *http.Request, ctx context.Context, providerType string) (*provider.UserProvidedData, error) { +func (a *API) oAuthCallback(ctx context.Context, r *http.Request, providerType string) (*provider.UserProvidedData, error) { rq := r.URL.Query() extError := rq.Get("error") diff --git a/api/hooks.go b/api/hooks.go index 40b693e18..c2ac6ead0 100644 --- a/api/hooks.go +++ b/api/hooks.go @@ -34,7 +34,7 @@ const ( LoginEvent = "login" ) -var defaultTimeout time.Duration = time.Second * 5 +var defaultTimeout = time.Second * 5 type webhookClaims struct { jwt.StandardClaims diff --git a/api/invite.go b/api/invite.go index 121aa83f5..8926350de 100644 --- a/api/invite.go +++ b/api/invite.go @@ -47,7 +47,7 @@ func (a *API) Invite(w http.ResponseWriter, r *http.Request) error { Aud: aud, Provider: "email", } - user, err = a.signupNewUser(tx, ctx, &signupParams) + user, err = a.signupNewUser(ctx, tx, &signupParams) if err != nil { return err } diff --git a/api/signup.go b/api/signup.go index 486f2f68e..96a1b28d1 100644 --- a/api/signup.go +++ b/api/signup.go @@ -60,7 +60,7 @@ func (a *API) Signup(w http.ResponseWriter, r *http.Request) error { } } else { params.Provider = "email" - user, terr = a.signupNewUser(tx, ctx, params) + user, terr = a.signupNewUser(ctx, tx, params) if terr != nil { return terr } @@ -93,7 +93,7 @@ func (a *API) Signup(w http.ResponseWriter, r *http.Request) error { return sendJSON(w, http.StatusOK, user) } -func (a *API) signupNewUser(conn *storage.Connection, ctx context.Context, params *SignupParams) (*models.User, error) { +func (a *API) signupNewUser(ctx context.Context, conn *storage.Connection, params *SignupParams) (*models.User, error) { instanceID := getInstanceID(ctx) config := a.getConfig(ctx) diff --git a/api/token.go b/api/token.go index d82486773..1622ffda4 100644 --- a/api/token.go +++ b/api/token.go @@ -12,6 +12,7 @@ import ( "github.com/netlify/gotrue/storage" ) +// GoTrueClaims is a struct thats used for JWT claims type GoTrueClaims struct { jwt.StandardClaims Email string `json:"email"`