Move source code into internal directory to follow standard project layout.
https://github.com/golang-standards/project-layoutpull/448/head
parent
a06b69dd45
commit
3b2d733367
|
@ -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"},
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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:"
|
|
@ -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"
|
||||||
)
|
)
|
|
@ -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) {
|
|
@ -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)
|
||||||
|
|
|
@ -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 {
|
|
@ -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://"
|
|
@ -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"
|
||||||
)
|
)
|
|
@ -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
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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"
|
|
@ -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.
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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"
|
|
@ -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.
|
|
@ -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"
|
|
@ -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.
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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) {
|
|
@ -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
|
|
@ -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.
|
|
@ -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"
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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"
|
||||||
)
|
)
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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"
|
|
@ -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
Loading…
Reference in New Issue