Skip to content
Permalink
Browse files

rename all the code

  • Loading branch information
rybit committed Mar 6, 2017
1 parent 1729605 commit ff2197aa9f2d1f06d9598c1db936d6feab7df107
@@ -8,9 +8,9 @@ import (

"github.com/dgrijalva/jwt-go"
"github.com/guregu/kami"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/mailer"
"github.com/netlify/netlify-auth/storage"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/mailer"
"github.com/netlify/gotrue/storage"
"github.com/rs/cors"
)

@@ -6,7 +6,7 @@ import (
"fmt"
"net/http"

"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
)

// RecoverParams holds the parameters for a password recovery request
@@ -7,7 +7,7 @@ import (
"fmt"
"net/http"

"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
)

// SignupParams are the parameters the Signup endpoint accepts
@@ -8,7 +8,7 @@ import (
"time"

"github.com/dgrijalva/jwt-go"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
)

// AccessTokenResponse represents an OAuth2 success response
@@ -7,7 +7,7 @@ import (
"net/http"

"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
)

// UserUpdateParams parameters for updating a user
@@ -6,7 +6,7 @@ import (
"fmt"
"net/http"

"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
)

const (
@@ -2,8 +2,8 @@ package cmd

import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/storage/dial"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/storage/dial"
"github.com/spf13/cobra"
)

@@ -4,11 +4,11 @@ import (
"github.com/Sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/netlify/netlify-auth/conf"
"github.com/netlify/gotrue/conf"
)

var rootCmd = cobra.Command{
Use: "netlify-auth",
Use: "gotrue",
Run: func(cmd *cobra.Command, args []string) {
execWithConfig(cmd, serve)
},
@@ -4,10 +4,10 @@ import (
"fmt"

"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/api"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/mailer"
"github.com/netlify/netlify-auth/storage/dial"
"github.com/netlify/gotrue/api"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/mailer"
"github.com/netlify/gotrue/storage/dial"
"github.com/spf13/cobra"
)

@@ -30,7 +30,7 @@ type JWTConfiguration struct {
AdminGroupDisabled bool `json:"admin_group_disabled"`
}

// Configuration holds all the confiruation for netlify-auth
// Configuration holds all the confiruation for gotrue
type Configuration struct {
JWT JWTConfiguration `json:"jwt"`
DB DBConfiguration `json:"db"`
@@ -78,8 +78,7 @@ func LoadConfig(cmd *cobra.Command) (*Configuration, error) {
} else {
viper.SetConfigName("config")
viper.AddConfigPath("./")
viper.AddConfigPath("$HOME/.netlify/authlify/") // keep backwards compatibility
viper.AddConfigPath("$HOME/.netlify/netlify-auth/")
viper.AddConfigPath("$HOME/.netlify/gotrue/") // keep backwards compatibility
}

if err := viper.ReadInConfig(); err != nil && !os.IsNotExist(err) {
@@ -1,4 +1,4 @@
package: github.com/netlify/netlify-auth
package: github.com/netlify/gotrue
import:
- package: github.com/dgrijalva/jwt-go
version: v2.7.0
@@ -1,9 +1,9 @@
package mailer

import (
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/models"
"github.com/netlify/mailme"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
)

const DefaultConfirmationMail = `<h2>Confirm your signup</h2>
@@ -35,7 +35,7 @@ type MailSubjects struct {
RecoveryMail string
}

// NewMailer returns a new netlify-auth mailer
// NewMailer returns a new gotrue mailer
func NewMailer(conf *conf.Configuration) *Mailer {
mailConf := conf.Mailer
return &Mailer{
@@ -3,7 +3,7 @@ package main
import (
"log"

"github.com/netlify/netlify-auth/cmd"
"github.com/netlify/gotrue/cmd"
)

func main() {
@@ -4,7 +4,7 @@ import (
"strings"
"time"

"github.com/netlify/netlify-auth/crypto"
"github.com/netlify/gotrue/crypto"
"github.com/pborman/uuid"

"golang.org/x/crypto/bcrypt"
@@ -1,11 +1,11 @@
package dial

import (
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/netlify-auth/storage"
"github.com/netlify/netlify-auth/storage/mongo"
"github.com/netlify/netlify-auth/storage/sql"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/models"
"github.com/netlify/gotrue/storage"
"github.com/netlify/gotrue/storage/mongo"
"github.com/netlify/gotrue/storage/sql"
)

// Dial will connect to that storage engine
@@ -2,9 +2,9 @@ package mongo

import (
"github.com/Sirupsen/logrus"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/crypto"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/crypto"
"github.com/netlify/gotrue/models"
"github.com/pkg/errors"
mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
@@ -4,9 +4,9 @@ import (
"os"
"testing"

"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/netlify-auth/storage/test"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/models"
"github.com/netlify/gotrue/storage/test"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)
@@ -8,9 +8,9 @@ import (
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/crypto"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/crypto"
"github.com/netlify/gotrue/models"
"github.com/pkg/errors"
)

@@ -5,17 +5,17 @@ import (
"os"
"testing"

"github.com/netlify/netlify-auth/conf"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/netlify-auth/storage/test"
"github.com/netlify/gotrue/conf"
"github.com/netlify/gotrue/models"
"github.com/netlify/gotrue/storage/test"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

var conn *Connection

func TestSQLTestSuite(t *testing.T) {
f, err := ioutil.TempFile("", "netlify-auth-test-")
f, err := ioutil.TempFile("", "gotrue-test-")
require.NoError(t, err)

defer os.Remove(f.Name())
@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/jinzhu/gorm"
"github.com/netlify/netlify-auth/models"
"github.com/netlify/gotrue/models"
"github.com/pkg/errors"
)

@@ -1,6 +1,6 @@
package storage

import "github.com/netlify/netlify-auth/models"
import "github.com/netlify/gotrue/models"

type Connection interface {
Close() error
@@ -1,8 +1,8 @@
package test

import (
"github.com/netlify/netlify-auth/models"
"github.com/netlify/netlify-auth/storage"
"github.com/netlify/gotrue/models"
"github.com/netlify/gotrue/storage"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

0 comments on commit ff2197a

Please sign in to comment.
You can’t perform that action at this time.