Move source code into internal directory to follow standard project layout.

https://github.com/golang-standards/project-layout
pull/448/head
Clement Michaud 2019-11-17 11:47:07 +01:00 committed by Clément Michaud
parent a06b69dd45
commit 3b2d733367
190 changed files with 188 additions and 323 deletions

View File

@ -8,7 +8,7 @@ import (
"os/exec" "os/exec"
"strings" "strings"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -19,6 +19,8 @@ type HostEntry struct {
} }
var hostEntries = []HostEntry{ var hostEntries = []HostEntry{
// For authelia backend
HostEntry{Domain: "authelia.example.com", IP: "192.168.240.50"},
// For common tests // For common tests
HostEntry{Domain: "login.example.com", IP: "192.168.240.100"}, HostEntry{Domain: "login.example.com", IP: "192.168.240.100"},
HostEntry{Domain: "admin.example.com", IP: "192.168.240.100"}, HostEntry{Domain: "admin.example.com", IP: "192.168.240.100"},

View File

@ -3,7 +3,7 @@ package main
import ( import (
"os" "os"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -6,7 +6,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,7 +3,7 @@ package main
import ( import (
"os" "os"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -11,8 +11,8 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/clems4ever/authelia/suites" "github.com/clems4ever/authelia/internal/suites"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -137,6 +137,8 @@ func runSuiteSetupTeardown(command string, suite string) error {
s := suites.GlobalRegistry.Get(selectedSuite) s := suites.GlobalRegistry.Get(selectedSuite)
cmd := utils.CommandWithStdout("go", "run", "cmd/authelia-suites/main.go", command, selectedSuite) cmd := utils.CommandWithStdout("go", "run", "cmd/authelia-suites/main.go", command, selectedSuite)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = os.Environ() cmd.Env = os.Environ()
return utils.RunCommandWithTimeout(cmd, s.SetUpTimeout) return utils.RunCommandWithTimeout(cmd, s.SetUpTimeout)
} }
@ -154,7 +156,10 @@ func setupSuite(suiteName string) error {
}() }()
if errSetup := runSuiteSetupTeardown("setup", suiteName); errSetup != nil || interrupted { if errSetup := runSuiteSetupTeardown("setup", suiteName); errSetup != nil || interrupted {
teardownSuite(suiteName) err := teardownSuite(suiteName)
if err != nil {
log.Error(err)
}
return errSetup return errSetup
} }
@ -226,12 +231,14 @@ func runSuiteTests(suiteName string, withEnv bool) error {
if suite.TestTimeout > 0 { if suite.TestTimeout > 0 {
timeout = fmt.Sprintf("%ds", int64(suite.TestTimeout/time.Second)) timeout = fmt.Sprintf("%ds", int64(suite.TestTimeout/time.Second))
} }
testCmdLine := fmt.Sprintf("go test ./suites -timeout %s -run '^(Test%sSuite)$'", timeout, suiteName) testCmdLine := fmt.Sprintf("go test ./internal/suites -timeout %s -run '^(Test%sSuite)$'", timeout, suiteName)
log.Infof("Running tests of suite %s...", suiteName) log.Infof("Running tests of suite %s...", suiteName)
log.Debugf("Running tests with command: %s", testCmdLine) log.Debugf("Running tests with command: %s", testCmdLine)
cmd := utils.CommandWithStdout("bash", "-c", testCmdLine) cmd := utils.CommandWithStdout("bash", "-c", testCmdLine)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = os.Environ() cmd.Env = os.Environ()
if headless { if headless {
cmd.Env = append(cmd.Env, "HEADLESS=y") cmd.Env = append(cmd.Env, "HEADLESS=y")
@ -240,7 +247,11 @@ func runSuiteTests(suiteName string, withEnv bool) error {
testErr := cmd.Run() testErr := cmd.Run()
if withEnv { if withEnv {
teardownSuite(suiteName) err := teardownSuite(suiteName)
if err != nil {
log.Error(err)
}
} }
return testErr return testErr

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
) )
// Docker a docker object // Docker a docker object

View File

@ -3,7 +3,7 @@
package main package main
import ( import (
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -4,8 +4,8 @@ import (
"encoding/base64" "encoding/base64"
"strings" "strings"
"github.com/clems4ever/authelia/configuration" "github.com/clems4ever/authelia/internal/configuration"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
) )
// TOTPSecretsV3 one entry of TOTP secrets in v3 // TOTPSecretsV3 one entry of TOTP secrets in v3

View File

@ -8,8 +8,8 @@ import (
"path" "path"
"time" "time"
"github.com/clems4ever/authelia/models" "github.com/clems4ever/authelia/internal/models"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -5,8 +5,8 @@ import (
"log" "log"
"time" "time"
"github.com/clems4ever/authelia/models" "github.com/clems4ever/authelia/internal/models"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"

View File

@ -5,8 +5,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/clems4ever/authelia/suites" "github.com/clems4ever/authelia/internal/suites"
"github.com/clems4ever/authelia/utils" "github.com/clems4ever/authelia/internal/utils"
"github.com/otiai10/copy" "github.com/otiai10/copy"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -18,7 +18,7 @@ var tmpDirectory = "/tmp/authelia/suites/"
var runningSuiteFile = ".suite" var runningSuiteFile = ".suite"
func init() { func init() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.InfoLevel)
} }
func main() { func main() {
@ -61,7 +61,7 @@ func setupSuite(cmd *cobra.Command, args []string) {
log.Fatal(err) log.Fatal(err)
} }
suiteResourcePath := cwd + "/suites/" + suiteName suiteResourcePath := cwd + "/internal/suites/" + suiteName
exist, err := utils.FileExists(suiteResourcePath) exist, err := utils.FileExists(suiteResourcePath)

View File

@ -6,16 +6,16 @@ import (
"log" "log"
"os" "os"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/configuration" "github.com/clems4ever/authelia/internal/configuration"
"github.com/clems4ever/authelia/logging" "github.com/clems4ever/authelia/internal/logging"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/notification" "github.com/clems4ever/authelia/internal/notification"
"github.com/clems4ever/authelia/regulation" "github.com/clems4ever/authelia/internal/regulation"
"github.com/clems4ever/authelia/server" "github.com/clems4ever/authelia/internal/server"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -15,4 +15,5 @@ services:
- SUITE_PATH=${SUITE_PATH} - SUITE_PATH=${SUITE_PATH}
- ENVIRONMENT=dev - ENVIRONMENT=dev
networks: networks:
- authelianet authelianet:
ipv4_address: 192.168.240.50

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"gopkg.in/ldap.v3" "gopkg.in/ldap.v3"
) )

View File

@ -6,7 +6,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
const userPrefix = "user:" const userPrefix = "user:"

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -5,8 +5,8 @@ import (
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/configuration/validator" "github.com/clems4ever/authelia/internal/configuration/validator"
) )
func check(e error) { func check(e error) {

View File

@ -7,7 +7,7 @@ import (
) )
func TestShouldParseConfigFile(t *testing.T) { func TestShouldParseConfigFile(t *testing.T) {
config, errors := Read("../test/resources/config.yml") config, errors := Read("../../test/resources/config.yml")
assert.Len(t, errors, 0) assert.Len(t, errors, 0)

View File

@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
type TestNestedStruct struct { type TestNestedStruct struct {

View File

@ -4,7 +4,7 @@ import (
"errors" "errors"
"strings" "strings"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
var ldapProtocolPrefix = "ldap://" var ldapProtocolPrefix = "ldap://"

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"testing" "testing"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
var defaultPort = 8080 var defaultPort = 8080

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"testing" "testing"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"errors" "errors"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
// ValidateSession validates and update session configuration. // ValidateSession validates and update session configuration.

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"testing" "testing"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -3,7 +3,7 @@ package validator
import ( import (
"errors" "errors"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
// ValidateSQLStorage validates storage configuration. // ValidateSQLStorage validates storage configuration.

View File

@ -1,7 +1,7 @@
package validator package validator
import ( import (
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
const defaultTOTPIssuer = "Authelia" const defaultTOTPIssuer = "Authelia"

View File

@ -1,8 +1,8 @@
package handlers package handlers
import ( import (
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// SecondFactorAvailableMethodsGet retrieve available 2FA methods. // SecondFactorAvailableMethodsGet retrieve available 2FA methods.

View File

@ -3,9 +3,9 @@ package handlers
import ( import (
"testing" "testing"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@ -3,8 +3,8 @@ package handlers
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// SecondFactorPreferencesGet get the user preferences regarding 2FA. // SecondFactorPreferencesGet get the user preferences regarding 2FA.

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -5,11 +5,11 @@ import (
"net/url" "net/url"
"time" "time"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/regulation" "github.com/clems4ever/authelia/internal/regulation"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
) )
// FirstFactorPost is the handler performing the first factory. // FirstFactorPost is the handler performing the first factory.

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -3,7 +3,7 @@ package handlers
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// LogoutPost is the handler logging out the user attached to the given cookie. // LogoutPost is the handler logging out the user attached to the given cookie.

View File

@ -4,7 +4,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -3,8 +3,8 @@ package handlers
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/pquerna/otp/totp" "github.com/pquerna/otp/totp"
) )

View File

@ -3,7 +3,7 @@ package handlers
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/tstranex/u2f" "github.com/tstranex/u2f"
) )

View File

@ -4,7 +4,7 @@ import (
"crypto/elliptic" "crypto/elliptic"
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/tstranex/u2f" "github.com/tstranex/u2f"
) )

View File

@ -4,8 +4,8 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
) )
func identityRetrieverFromStorage(ctx *middlewares.AutheliaCtx) (*session.Identity, error) { func identityRetrieverFromStorage(ctx *middlewares.AutheliaCtx) (*session.Identity, error) {

View File

@ -3,7 +3,7 @@ package handlers
import ( import (
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// ResetPasswordPost handler for resetting passwords // ResetPasswordPost handler for resetting passwords

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"net/url" "net/url"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/duo" "github.com/clems4ever/authelia/internal/duo"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// SecondFactorDuoPost handler for sending a push notification via duo api. // SecondFactorDuoPost handler for sending a push notification via duo api.

View File

@ -5,8 +5,8 @@ import (
"net/url" "net/url"
"testing" "testing"
"github.com/clems4ever/authelia/duo" "github.com/clems4ever/authelia/internal/duo"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"net/url" "net/url"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/pquerna/otp/totp" "github.com/pquerna/otp/totp"
) )

View File

@ -4,9 +4,9 @@ import (
"crypto/elliptic" "crypto/elliptic"
"fmt" "fmt"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/tstranex/u2f" "github.com/tstranex/u2f"
) )

View File

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"net/url" "net/url"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/tstranex/u2f" "github.com/tstranex/u2f"
) )

View File

@ -1,7 +1,7 @@
package handlers package handlers
import ( import (
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
) )
// StateGet is the handler serving the user state. // StateGet is the handler serving the user state.

View File

@ -4,9 +4,9 @@ import (
"encoding/json" "encoding/json"
"testing" "testing"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@ -8,9 +8,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -6,10 +6,10 @@ import (
"net/url" "net/url"
"testing" "testing"
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -1,7 +1,7 @@
package handlers package handlers
import ( import (
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/tstranex/u2f" "github.com/tstranex/u2f"
) )

View File

@ -7,10 +7,10 @@ import (
"strings" "strings"
"github.com/asaskevich/govalidator" "github.com/asaskevich/govalidator"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/logging" "github.com/clems4ever/authelia/internal/logging"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -3,11 +3,11 @@ package middlewares_test
import ( import (
"testing" "testing"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"

View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/clems4ever/authelia/templates" "github.com/clems4ever/authelia/internal/templates"
jwt "github.com/dgrijalva/jwt-go" jwt "github.com/dgrijalva/jwt-go"
) )

View File

@ -5,9 +5,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/mocks" "github.com/clems4ever/authelia/internal/mocks"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
jwt "github.com/dgrijalva/jwt-go" jwt "github.com/dgrijalva/jwt-go"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@ -1,7 +1,7 @@
package middlewares package middlewares
import ( import (
"github.com/clems4ever/authelia/logging" "github.com/clems4ever/authelia/internal/logging"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -1,7 +1,7 @@
package middlewares package middlewares
import ( import (
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
) )
// RequireFirstFactor check if user has enough permissions to execute the next handler. // RequireFirstFactor check if user has enough permissions to execute the next handler.

View File

@ -1,13 +1,13 @@
package middlewares package middlewares
import ( import (
"github.com/clems4ever/authelia/authentication" "github.com/clems4ever/authelia/internal/authentication"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/notification" "github.com/clems4ever/authelia/internal/notification"
"github.com/clems4ever/authelia/regulation" "github.com/clems4ever/authelia/internal/regulation"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
jwt "github.com/dgrijalva/jwt-go" jwt "github.com/dgrijalva/jwt-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"

View File

@ -5,14 +5,14 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/clems4ever/authelia/regulation" "github.com/clems4ever/authelia/internal/regulation"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/clems4ever/authelia/authorization" "github.com/clems4ever/authelia/internal/authorization"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/middlewares" "github.com/clems4ever/authelia/internal/middlewares"
"github.com/clems4ever/authelia/session" "github.com/clems4ever/authelia/internal/session"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/test" "github.com/sirupsen/logrus/hooks/test"

View File

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/clems4ever/authelia/duo (interfaces: API) // Source: github.com/clems4ever/authelia/internal/duo (interfaces: API)
// Package mocks is a generated GoMock package. // Package mocks is a generated GoMock package.
package mocks package mocks
@ -8,7 +8,7 @@ import (
url "net/url" url "net/url"
reflect "reflect" reflect "reflect"
duo "github.com/clems4ever/authelia/duo" duo "github.com/clems4ever/authelia/internal/duo"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
) )

View File

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/clems4ever/authelia/notification (interfaces: Notifier) // Source: github.com/clems4ever/authelia/internal/notification (interfaces: Notifier)
// Package mock_notification is a generated GoMock package. // Package mock_notification is a generated GoMock package.
package mocks package mocks

View File

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/clems4ever/authelia/authentication (interfaces: UserProvider) // Source: github.com/clems4ever/authelia/internal/authentication (interfaces: UserProvider)
// Package mocks is a generated GoMock package. // Package mocks is a generated GoMock package.
package mocks package mocks
@ -7,7 +7,7 @@ package mocks
import ( import (
reflect "reflect" reflect "reflect"
authentication "github.com/clems4ever/authelia/authentication" authentication "github.com/clems4ever/authelia/internal/authentication"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
) )

View File

@ -5,7 +5,7 @@ import (
"io/ioutil" "io/ioutil"
"time" "time"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
// FileNotifier a notifier to send emails to SMTP servers. // FileNotifier a notifier to send emails to SMTP servers.

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"net/smtp" "net/smtp"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
) )
// SMTPNotifier a notifier to send emails to SMTP servers. // SMTPNotifier a notifier to send emails to SMTP servers.

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/models" "github.com/clems4ever/authelia/internal/models"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
) )
// NewRegulator create a regulator instance. // NewRegulator create a regulator instance.

View File

@ -4,10 +4,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/clems4ever/authelia/configuration/schema" "github.com/clems4ever/authelia/internal/configuration/schema"
"github.com/clems4ever/authelia/models" "github.com/clems4ever/authelia/internal/models"
"github.com/clems4ever/authelia/regulation" "github.com/clems4ever/authelia/internal/regulation"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -3,7 +3,7 @@ package regulation
import ( import (
"time" "time"
"github.com/clems4ever/authelia/storage" "github.com/clems4ever/authelia/internal/storage"
) )
// Regulator an authentication regulator preventing attackers to brute force the service. // Regulator an authentication regulator preventing attackers to brute force the service.

Some files were not shown because too many files have changed in this diff Show More