Skip to content

Commit

Permalink
rename all the code
Browse files Browse the repository at this point in the history
  • Loading branch information
rybit committed Mar 6, 2017
1 parent 1729605 commit ff2197a
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 47 deletions.
6 changes: 3 additions & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion api/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/http"

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

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/migrate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
8 changes: 4 additions & 4 deletions cmd/serve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
5 changes: 2 additions & 3 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions mailer/mailer.go
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

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

func main() {
Expand Down
2 changes: 1 addition & 1 deletion models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions storage/dial/dial.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions storage/mongo/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions storage/mongo/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
6 changes: 3 additions & 3 deletions storage/sql/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
8 changes: 4 additions & 4 deletions storage/sql/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion storage/sql/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package storage

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

type Connection interface {
Close() error
Expand Down
4 changes: 2 additions & 2 deletions storage/test/storage_suite.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down

0 comments on commit ff2197a

Please sign in to comment.