Permalink
Browse files

fix test and deprecated messages

  • Loading branch information...
Asaduzzaman Pavel
Asaduzzaman Pavel committed Oct 16, 2018
1 parent 5babe03 commit 36fca93fd60c00c78878550eebc6cc03481a78cd
@@ -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 {
@@ -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"
@@ -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"
)
@@ -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"
)
@@ -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"
@@ -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
@@ -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
}
@@ -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"
)
@@ -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"
)
@@ -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"
)
@@ -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 {
@@ -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"
)
@@ -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
@@ -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) {
@@ -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"
@@ -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"
@@ -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 (
@@ -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"
)
@@ -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"
@@ -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"
@@ -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
@@ -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
@@ -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"
@@ -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
@@ -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"
@@ -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"
)
@@ -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"
)
@@ -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
Oops, something went wrong.

0 comments on commit 36fca93

Please sign in to comment.