mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
Move source code into internal directory to follow standard project layout.
https://github.com/golang-standards/project-layout
This commit is contained in:
parent
a06b69dd45
commit
3b2d733367
|
@ -8,7 +8,7 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
@ -19,6 +19,8 @@ type HostEntry struct {
|
|||
}
|
||||
|
||||
var hostEntries = []HostEntry{
|
||||
// For authelia backend
|
||||
HostEntry{Domain: "authelia.example.com", IP: "192.168.240.50"},
|
||||
// For common tests
|
||||
HostEntry{Domain: "login.example.com", IP: "192.168.240.100"},
|
||||
HostEntry{Domain: "admin.example.com", IP: "192.168.240.100"},
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -11,8 +11,8 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/suites"
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/suites"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -137,6 +137,8 @@ func runSuiteSetupTeardown(command string, suite string) error {
|
|||
s := suites.GlobalRegistry.Get(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()
|
||||
return utils.RunCommandWithTimeout(cmd, s.SetUpTimeout)
|
||||
}
|
||||
|
@ -154,7 +156,10 @@ func setupSuite(suiteName string) error {
|
|||
}()
|
||||
|
||||
if errSetup := runSuiteSetupTeardown("setup", suiteName); errSetup != nil || interrupted {
|
||||
teardownSuite(suiteName)
|
||||
err := teardownSuite(suiteName)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
return errSetup
|
||||
}
|
||||
|
||||
|
@ -226,12 +231,14 @@ func runSuiteTests(suiteName string, withEnv bool) error {
|
|||
if suite.TestTimeout > 0 {
|
||||
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.Debugf("Running tests with command: %s", testCmdLine)
|
||||
|
||||
cmd := utils.CommandWithStdout("bash", "-c", testCmdLine)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Env = os.Environ()
|
||||
if headless {
|
||||
cmd.Env = append(cmd.Env, "HEADLESS=y")
|
||||
|
@ -240,7 +247,11 @@ func runSuiteTests(suiteName string, withEnv bool) error {
|
|||
testErr := cmd.Run()
|
||||
|
||||
if withEnv {
|
||||
teardownSuite(suiteName)
|
||||
err := teardownSuite(suiteName)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
return testErr
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
)
|
||||
|
||||
// Docker a docker object
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"encoding/base64"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/configuration"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
)
|
||||
|
||||
// TOTPSecretsV3 one entry of TOTP secrets in v3
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/models"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/models"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/models"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/models"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/spf13/cobra"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/clems4ever/authelia/suites"
|
||||
"github.com/clems4ever/authelia/utils"
|
||||
"github.com/clems4ever/authelia/internal/suites"
|
||||
"github.com/clems4ever/authelia/internal/utils"
|
||||
"github.com/otiai10/copy"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -18,7 +18,7 @@ var tmpDirectory = "/tmp/authelia/suites/"
|
|||
var runningSuiteFile = ".suite"
|
||||
|
||||
func init() {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -61,7 +61,7 @@ func setupSuite(cmd *cobra.Command, args []string) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
suiteResourcePath := cwd + "/suites/" + suiteName
|
||||
suiteResourcePath := cwd + "/internal/suites/" + suiteName
|
||||
|
||||
exist, err := utils.FileExists(suiteResourcePath)
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/configuration"
|
||||
"github.com/clems4ever/authelia/logging"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/notification"
|
||||
"github.com/clems4ever/authelia/regulation"
|
||||
"github.com/clems4ever/authelia/server"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/configuration"
|
||||
"github.com/clems4ever/authelia/internal/logging"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/notification"
|
||||
"github.com/clems4ever/authelia/internal/regulation"
|
||||
"github.com/clems4ever/authelia/internal/server"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
|
@ -15,4 +15,5 @@ services:
|
|||
- SUITE_PATH=${SUITE_PATH}
|
||||
- ENVIRONMENT=dev
|
||||
networks:
|
||||
- authelianet
|
||||
authelianet:
|
||||
ipv4_address: 192.168.240.50
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"gopkg.in/ldap.v3"
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
const userPrefix = "user:"
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
|
@ -5,8 +5,8 @@ import (
|
|||
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/configuration/validator"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/validator"
|
||||
)
|
||||
|
||||
func check(e error) {
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func TestShouldParseConfigFile(t *testing.T) {
|
||||
config, errors := Read("../test/resources/config.yml")
|
||||
config, errors := Read("../../test/resources/config.yml")
|
||||
|
||||
assert.Len(t, errors, 0)
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
type TestNestedStruct struct {
|
|
@ -4,7 +4,7 @@ import (
|
|||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
var ldapProtocolPrefix = "ldap://"
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
var defaultPort = 8080
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
// ValidateSession validates and update session configuration.
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
|
@ -3,7 +3,7 @@ package validator
|
|||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
// ValidateSQLStorage validates storage configuration.
|
|
@ -1,7 +1,7 @@
|
|||
package validator
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
const defaultTOTPIssuer = "Authelia"
|
|
@ -1,8 +1,8 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
)
|
||||
|
||||
// SecondFactorAvailableMethodsGet retrieve available 2FA methods.
|
|
@ -3,9 +3,9 @@ package handlers
|
|||
import (
|
||||
"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"
|
||||
)
|
||||
|
|
@ -3,8 +3,8 @@ package handlers
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
)
|
||||
|
||||
// SecondFactorPreferencesGet get the user preferences regarding 2FA.
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/sirupsen/logrus"
|
|
@ -5,11 +5,11 @@ import (
|
|||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/regulation"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/regulation"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
)
|
||||
|
||||
// FirstFactorPost is the handler performing the first factory.
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"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/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/assert"
|
|
@ -3,7 +3,7 @@ package handlers
|
|||
import (
|
||||
"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.
|
|
@ -4,7 +4,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
|
@ -3,8 +3,8 @@ package handlers
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
"github.com/pquerna/otp/totp"
|
||||
)
|
||||
|
|
@ -3,7 +3,7 @@ package handlers
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"crypto/elliptic"
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
)
|
||||
|
||||
func identityRetrieverFromStorage(ctx *middlewares.AutheliaCtx) (*session.Identity, error) {
|
|
@ -3,7 +3,7 @@ package handlers
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
)
|
||||
|
||||
// ResetPasswordPost handler for resetting passwords
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/duo"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/duo"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
)
|
||||
|
||||
// SecondFactorDuoPost handler for sending a push notification via duo api.
|
|
@ -5,8 +5,8 @@ import (
|
|||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/duo"
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/internal/duo"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/pquerna/otp/totp"
|
||||
)
|
||||
|
|
@ -4,9 +4,9 @@ import (
|
|||
"crypto/elliptic"
|
||||
"fmt"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
)
|
||||
|
||||
// StateGet is the handler serving the user state.
|
|
@ -4,9 +4,9 @@ import (
|
|||
"encoding/json"
|
||||
"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/suite"
|
||||
)
|
|
@ -8,9 +8,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
|
@ -6,10 +6,10 @@ import (
|
|||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
|
@ -7,10 +7,10 @@ import (
|
|||
"strings"
|
||||
|
||||
"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/logging"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/logging"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
|
@ -3,11 +3,11 @@ package middlewares_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/valyala/fasthttp"
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/templates"
|
||||
"github.com/clems4ever/authelia/internal/templates"
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
)
|
||||
|
|
@ -5,9 +5,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/mocks"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/mocks"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
|
@ -1,7 +1,7 @@
|
|||
package middlewares
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/logging"
|
||||
"github.com/clems4ever/authelia/internal/logging"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package middlewares
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
)
|
||||
|
||||
// RequireFirstFactor check if user has enough permissions to execute the next handler.
|
|
@ -1,13 +1,13 @@
|
|||
package middlewares
|
||||
|
||||
import (
|
||||
"github.com/clems4ever/authelia/authentication"
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/notification"
|
||||
"github.com/clems4ever/authelia/regulation"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/authentication"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/notification"
|
||||
"github.com/clems4ever/authelia/internal/regulation"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/valyala/fasthttp"
|
|
@ -5,14 +5,14 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/clems4ever/authelia/regulation"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/regulation"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/clems4ever/authelia/authorization"
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/middlewares"
|
||||
"github.com/clems4ever/authelia/session"
|
||||
"github.com/clems4ever/authelia/internal/authorization"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/middlewares"
|
||||
"github.com/clems4ever/authelia/internal/session"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/sirupsen/logrus/hooks/test"
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
@ -8,7 +8,7 @@ import (
|
|||
url "net/url"
|
||||
reflect "reflect"
|
||||
|
||||
duo "github.com/clems4ever/authelia/duo"
|
||||
duo "github.com/clems4ever/authelia/internal/duo"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// 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 mocks
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
@ -7,7 +7,7 @@ package mocks
|
|||
import (
|
||||
reflect "reflect"
|
||||
|
||||
authentication "github.com/clems4ever/authelia/authentication"
|
||||
authentication "github.com/clems4ever/authelia/internal/authentication"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
// FileNotifier a notifier to send emails to SMTP servers.
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"net/smtp"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
)
|
||||
|
||||
// SMTPNotifier a notifier to send emails to SMTP servers.
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/models"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/models"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
)
|
||||
|
||||
// NewRegulator create a regulator instance.
|
|
@ -4,10 +4,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/configuration/schema"
|
||||
"github.com/clems4ever/authelia/models"
|
||||
"github.com/clems4ever/authelia/regulation"
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/configuration/schema"
|
||||
"github.com/clems4ever/authelia/internal/models"
|
||||
"github.com/clems4ever/authelia/internal/regulation"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
|
@ -3,7 +3,7 @@ package regulation
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/clems4ever/authelia/storage"
|
||||
"github.com/clems4ever/authelia/internal/storage"
|
||||
)
|
||||
|
||||
// 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
Loading…
Reference in New Issue
Block a user