From 3b2d733367c88621e4178301f2bcb4bc03613eee Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sun, 17 Nov 2019 11:47:07 +0100 Subject: [PATCH] Move source code into internal directory to follow standard project layout. https://github.com/golang-standards/project-layout --- cmd/authelia-scripts/cmd_bootstrap.go | 4 +- cmd/authelia-scripts/cmd_build.go | 2 +- cmd/authelia-scripts/cmd_ci.go | 2 +- cmd/authelia-scripts/cmd_docker.go | 2 +- cmd/authelia-scripts/cmd_hash_password.go | 2 +- cmd/authelia-scripts/cmd_serve.go | 2 +- cmd/authelia-scripts/cmd_suites.go | 21 +++- cmd/authelia-scripts/cmd_unittest.go | 2 +- cmd/authelia-scripts/docker.go | 2 +- cmd/authelia-scripts/main.go | 2 +- cmd/authelia-scripts/migration.go | 4 +- cmd/authelia-scripts/migration_local.go | 4 +- cmd/authelia-scripts/migration_mongo.go | 4 +- cmd/authelia-suites/main.go | 8 +- cmd/authelia/main.go | 20 ++-- .../authelia/docker-compose.backend.yml | 3 +- .../authentication}/const.go | 0 .../authentication}/file_user_provider.go | 0 .../file_user_provider_test.go | 0 .../authentication}/ldap_user_provider.go | 2 +- .../authentication}/password_hash.go | 0 .../authentication}/password_hash_test.go | 0 .../authentication}/types.go | 0 .../authentication}/user_provider.go | 0 .../authorization}/authorizer.go | 2 +- .../authorization}/authorizer_test.go | 2 +- .../authorization}/const.go | 0 .../configuration}/reader.go | 4 +- .../configuration}/reader_test.go | 2 +- .../configuration}/schema/access_control.go | 0 .../configuration}/schema/authentication.go | 0 .../configuration}/schema/configuration.go | 0 .../configuration}/schema/duo.go | 0 .../configuration}/schema/notifier.go | 0 .../configuration}/schema/regulation.go | 0 .../configuration}/schema/session.go | 0 .../configuration}/schema/storage.go | 0 .../configuration}/schema/totp.go | 0 .../configuration}/schema/validator.go | 0 .../configuration}/schema/validator_test.go | 2 +- .../validator/authentication.go | 2 +- .../validator/authentication_test.go | 2 +- .../configuration}/validator/configuration.go | 2 +- .../validator/configuration_test.go | 2 +- .../configuration}/validator/session.go | 2 +- .../configuration}/validator/session_test.go | 2 +- .../configuration}/validator/storage.go | 2 +- .../configuration}/validator/totp.go | 2 +- {duo => internal/duo}/duo.go | 0 {duo => internal/duo}/types.go | 0 {handlers => internal/handlers}/const.go | 0 {handlers => internal/handlers}/errors.go | 0 .../handler_2fa_available_methods.go | 4 +- .../handler_2fa_available_methods_test.go | 4 +- .../handlers}/handler_2fa_preferences.go | 4 +- .../handlers}/handler_2fa_preferences_test.go | 2 +- .../handlers}/handler_firstfactor.go | 10 +- .../handlers}/handler_firstfactor_test.go | 4 +- .../handlers}/handler_logout.go | 2 +- .../handlers}/handler_logout_test.go | 2 +- .../handlers}/handler_register_totp.go | 4 +- .../handlers}/handler_register_u2f_step1.go | 2 +- .../handlers}/handler_register_u2f_step2.go | 2 +- .../handlers}/handler_reset_password_step1.go | 4 +- .../handlers}/handler_reset_password_step2.go | 2 +- .../handlers}/handler_sign_duo.go | 6 +- .../handlers}/handler_sign_duo_test.go | 4 +- .../handlers}/handler_sign_totp.go | 4 +- .../handlers}/handler_sign_u2f_step1.go | 6 +- .../handlers}/handler_sign_u2f_step2.go | 4 +- .../handlers}/handler_state.go | 2 +- .../handlers}/handler_state_test.go | 4 +- .../handlers}/handler_verify.go | 6 +- .../handlers}/handler_verify_test.go | 8 +- .../handlers}/safe_redirection.go | 0 .../handlers}/safe_redirection_test.go | 0 {handlers => internal/handlers}/types.go | 2 +- {logging => internal/logging}/logger.go | 0 .../middlewares}/authelia_context.go | 6 +- .../middlewares}/authelia_context_test.go | 8 +- .../middlewares}/const.go | 0 .../middlewares}/errors.go | 0 .../middlewares}/identity_verification.go | 2 +- .../identity_verification_test.go | 6 +- .../middlewares}/log_request.go | 2 +- .../middlewares}/log_request_test.go | 0 .../middlewares}/require_first_factor.go | 2 +- .../middlewares}/types.go | 14 +-- .../mocks}/mock_authelia_ctx.go | 12 +-- {mocks => internal/mocks}/mock_duo_api.go | 4 +- {mocks => internal/mocks}/mock_notifier.go | 2 +- .../mocks}/mock_user_provider.go | 4 +- {models => internal/models}/types.go | 0 .../notification}/file_notifier.go | 2 +- .../notification}/notifier.go | 0 .../notification}/smtp_notifier.go | 2 +- {regulation => internal/regulation}/const.go | 0 .../regulation}/regulator.go | 6 +- .../regulation}/regulator_test.go | 8 +- {regulation => internal/regulation}/types.go | 2 +- {server => internal/server}/server.go | 10 +- {session => internal/session}/const.go | 0 .../session}/mocks/mock_storer.go | 0 {session => internal/session}/provider.go | 2 +- .../session}/provider_config.go | 2 +- .../session}/provider_config_test.go | 2 +- .../session}/provider_test.go | 4 +- {session => internal/session}/types.go | 2 +- {session => internal/session}/user_session.go | 2 +- {storage => internal/storage}/constants.go | 0 {storage => internal/storage}/errors.go | 0 .../storage}/mysql_provider.go | 4 +- .../storage}/postgres_provider.go | 4 +- {storage => internal/storage}/provider.go | 2 +- .../storage}/provider_mock.go | 4 +- {storage => internal/storage}/sql_provider.go | 2 +- .../storage}/sqlite_provider.go | 2 +- .../suites}/BypassAll/configuration.yml | 0 .../suites/BypassAll}/users.yml | 0 .../suites}/DuoPush/configuration.yml | 0 .../suites/DuoPush}/users.yml | 0 .../HighAvailability/configuration.yml | 0 .../suites}/LDAP/configuration.yml | 0 .../suites}/Mariadb/configuration.yml | 0 .../suites/Mariadb}/users.yml | 0 .../suites}/NetworkACL/configuration.yml | 0 .../suites/NetworkACL}/users.yml | 0 .../suites}/Postgres/configuration.yml | 0 .../suites/Postgres}/users.yml | 0 .../suites}/ShortTimeouts/configuration.yml | 0 .../suites/ShortTimeouts}/users.yml | 0 .../suites}/Standalone/configuration.yml | 0 .../suites}/Standalone/users.yml | 0 .../suites}/Traefik/configuration.yml | 0 .../suites/Traefik}/users.yml | 0 {suites => internal/suites}/action_http.go | 0 {suites => internal/suites}/action_login.go | 0 {suites => internal/suites}/action_logout.go | 0 {suites => internal/suites}/action_mail.go | 0 .../suites}/action_register.go | 0 {suites => internal/suites}/action_totp.go | 0 {suites => internal/suites}/action_visit.go | 0 {suites => internal/suites}/constants.go | 0 {suites => internal/suites}/docker.go | 2 +- {suites => internal/suites}/environment.go | 2 +- {suites => internal/suites}/kubernetes.go | 2 +- {suites => internal/suites}/registry.go | 0 .../suites}/scenario_one_factor_test.go | 0 .../suites}/scenario_two_factor_test.go | 0 .../suites}/suite_bypass_all.go | 0 .../suites}/suite_bypass_all_test.go | 0 {suites => internal/suites}/suite_duo_push.go | 0 .../suites}/suite_duo_push_test.go | 0 .../suites}/suite_high_availability.go | 0 .../suites}/suite_high_availability_test.go | 0 .../suites}/suite_kubernetes.go | 2 +- .../suites}/suite_kubernetes_test.go | 0 {suites => internal/suites}/suite_ldap.go | 0 .../suites}/suite_ldap_test.go | 0 {suites => internal/suites}/suite_mariadb.go | 0 .../suites}/suite_mariadb_test.go | 0 .../suites}/suite_network_acl.go | 0 .../suites}/suite_network_acl_test.go | 0 {suites => internal/suites}/suite_postgres.go | 0 .../suites}/suite_postgres_test.go | 0 .../suites}/suite_short_timeouts.go | 0 .../suites}/suite_short_timeouts_test.go | 0 .../suites}/suite_standalone.go | 0 .../suites}/suite_standalone_test.go | 0 {suites => internal/suites}/suite_traefik.go | 0 .../suites}/suite_traefik_test.go | 0 {suites => internal/suites}/suites.go | 31 +----- .../suites}/verify_body_contains.go | 0 .../suites}/verify_is_first_factor_page.go | 0 .../suites}/verify_is_second_factor_page.go | 0 .../suites}/verify_notification.go | 0 .../suites}/verify_secret_authorized.go | 0 {suites => internal/suites}/verify_url_is.go | 0 {suites => internal/suites}/webdriver.go | 0 {templates => internal/templates}/email.go | 0 {utils => internal/utils}/check.go | 0 {utils => internal/utils}/exec.go | 0 {utils => internal/utils}/files.go | 0 suites/Basic/configuration.yml | 97 ------------------- suites/Traefik/users.yml | 29 ------ test/suites/BypassAll/test.ts | 2 +- test/suites/DuoPush/test.ts | 2 +- test/suites/NetworkACL/test.ts | 2 +- .../Standalone/scenarii/VerifyEndpoint.ts | 8 +- test/suites/Standalone/test.ts | 2 +- 190 files changed, 188 insertions(+), 323 deletions(-) rename {authentication => internal/authentication}/const.go (100%) rename {authentication => internal/authentication}/file_user_provider.go (100%) rename {authentication => internal/authentication}/file_user_provider_test.go (100%) rename {authentication => internal/authentication}/ldap_user_provider.go (98%) rename {authentication => internal/authentication}/password_hash.go (100%) rename {authentication => internal/authentication}/password_hash_test.go (100%) rename {authentication => internal/authentication}/types.go (100%) rename {authentication => internal/authentication}/user_provider.go (100%) rename {authorization => internal/authorization}/authorizer.go (98%) rename {authorization => internal/authorization}/authorizer_test.go (99%) rename {authorization => internal/authorization}/const.go (100%) rename {configuration => internal/configuration}/reader.go (81%) rename {configuration => internal/configuration}/reader_test.go (90%) rename {configuration => internal/configuration}/schema/access_control.go (100%) rename {configuration => internal/configuration}/schema/authentication.go (100%) rename {configuration => internal/configuration}/schema/configuration.go (100%) rename {configuration => internal/configuration}/schema/duo.go (100%) rename {configuration => internal/configuration}/schema/notifier.go (100%) rename {configuration => internal/configuration}/schema/regulation.go (100%) rename {configuration => internal/configuration}/schema/session.go (100%) rename {configuration => internal/configuration}/schema/storage.go (100%) rename {configuration => internal/configuration}/schema/totp.go (100%) rename {configuration => internal/configuration}/schema/validator.go (100%) rename {configuration => internal/configuration}/schema/validator_test.go (96%) rename {configuration => internal/configuration}/validator/authentication.go (97%) rename {configuration => internal/configuration}/validator/authentication_test.go (98%) rename {configuration => internal/configuration}/validator/configuration.go (92%) rename {configuration => internal/configuration}/validator/configuration_test.go (95%) rename {configuration => internal/configuration}/validator/session.go (90%) rename {configuration => internal/configuration}/validator/session_test.go (94%) rename {configuration => internal/configuration}/validator/storage.go (96%) rename {configuration => internal/configuration}/validator/totp.go (82%) rename {duo => internal/duo}/duo.go (100%) rename {duo => internal/duo}/types.go (100%) rename {handlers => internal/handlers}/const.go (100%) rename {handlers => internal/handlers}/errors.go (100%) rename {handlers => internal/handlers}/handler_2fa_available_methods.go (81%) rename {handlers => internal/handlers}/handler_2fa_available_methods_test.go (89%) rename {handlers => internal/handlers}/handler_2fa_preferences.go (93%) rename {handlers => internal/handlers}/handler_2fa_preferences_test.go (98%) rename {handlers => internal/handlers}/handler_firstfactor.go (93%) rename {handlers => internal/handlers}/handler_firstfactor_test.go (97%) rename {handlers => internal/handlers}/handler_logout.go (88%) rename {handlers => internal/handlers}/handler_logout_test.go (94%) rename {handlers => internal/handlers}/handler_register_totp.go (95%) rename {handlers => internal/handlers}/handler_register_u2f_step1.go (97%) rename {handlers => internal/handlers}/handler_register_u2f_step2.go (96%) rename {handlers => internal/handlers}/handler_reset_password_step1.go (94%) rename {handlers => internal/handlers}/handler_reset_password_step2.go (96%) rename {handlers => internal/handlers}/handler_sign_duo.go (91%) rename {handlers => internal/handlers}/handler_sign_duo_test.go (96%) rename {handlers => internal/handlers}/handler_sign_totp.go (92%) rename {handlers => internal/handlers}/handler_sign_u2f_step1.go (92%) rename {handlers => internal/handlers}/handler_sign_u2f_step2.go (94%) rename {handlers => internal/handlers}/handler_state.go (87%) rename {handlers => internal/handlers}/handler_state_test.go (94%) rename {handlers => internal/handlers}/handler_verify.go (98%) rename {handlers => internal/handlers}/handler_verify_test.go (98%) rename {handlers => internal/handlers}/safe_redirection.go (100%) rename {handlers => internal/handlers}/safe_redirection_test.go (100%) rename {handlers => internal/handlers}/types.go (97%) rename {logging => internal/logging}/logger.go (100%) rename {middlewares => internal/middlewares}/authelia_context.go (96%) rename {middlewares => internal/middlewares}/authelia_context_test.go (78%) rename {middlewares => internal/middlewares}/const.go (100%) rename {middlewares => internal/middlewares}/errors.go (100%) rename {middlewares => internal/middlewares}/identity_verification.go (98%) rename {middlewares => internal/middlewares}/identity_verification_test.go (98%) rename {middlewares => internal/middlewares}/log_request.go (88%) rename {middlewares => internal/middlewares}/log_request_test.go (100%) rename {middlewares => internal/middlewares}/require_first_factor.go (85%) rename {middlewares => internal/middlewares}/types.go (88%) rename {mocks => internal/mocks}/mock_authelia_ctx.go (90%) rename {mocks => internal/mocks}/mock_duo_api.go (90%) rename {mocks => internal/mocks}/mock_notifier.go (93%) rename {mocks => internal/mocks}/mock_user_provider.go (94%) rename {models => internal/models}/types.go (100%) rename {notification => internal/notification}/file_notifier.go (92%) rename {notification => internal/notification}/notifier.go (100%) rename {notification => internal/notification}/smtp_notifier.go (97%) rename {regulation => internal/regulation}/const.go (100%) rename {regulation => internal/regulation}/regulator.go (94%) rename {regulation => internal/regulation}/regulator_test.go (96%) rename {regulation => internal/regulation}/types.go (91%) rename {server => internal/server}/server.go (93%) rename {session => internal/session}/const.go (100%) rename {session => internal/session}/mocks/mock_storer.go (100%) rename {session => internal/session}/provider.go (97%) rename {session => internal/session}/provider_config.go (96%) rename {session => internal/session}/provider_config_test.go (96%) rename {session => internal/session}/provider_test.go (89%) rename {session => internal/session}/types.go (96%) rename {session => internal/session}/user_session.go (79%) rename {storage => internal/storage}/constants.go (100%) rename {storage => internal/storage}/errors.go (100%) rename {storage => internal/storage}/mysql_provider.go (95%) rename {storage => internal/storage}/postgres_provider.go (96%) rename {storage => internal/storage}/provider.go (94%) rename {storage => internal/storage}/provider_mock.go (98%) rename {storage => internal/storage}/sql_provider.go (99%) rename {storage => internal/storage}/sqlite_provider.go (97%) rename {suites => internal/suites}/BypassAll/configuration.yml (100%) rename {suites/Basic => internal/suites/BypassAll}/users.yml (100%) rename {suites => internal/suites}/DuoPush/configuration.yml (100%) rename {suites/BypassAll => internal/suites/DuoPush}/users.yml (100%) rename {suites => internal/suites}/HighAvailability/configuration.yml (100%) rename {suites => internal/suites}/LDAP/configuration.yml (100%) rename {suites => internal/suites}/Mariadb/configuration.yml (100%) rename {suites/DuoPush => internal/suites/Mariadb}/users.yml (100%) rename {suites => internal/suites}/NetworkACL/configuration.yml (100%) rename {suites/Mariadb => internal/suites/NetworkACL}/users.yml (100%) rename {suites => internal/suites}/Postgres/configuration.yml (100%) rename {suites/NetworkACL => internal/suites/Postgres}/users.yml (100%) rename {suites => internal/suites}/ShortTimeouts/configuration.yml (100%) rename {suites/Postgres => internal/suites/ShortTimeouts}/users.yml (100%) rename {suites => internal/suites}/Standalone/configuration.yml (100%) rename {suites => internal/suites}/Standalone/users.yml (100%) rename {suites => internal/suites}/Traefik/configuration.yml (100%) rename {suites/ShortTimeouts => internal/suites/Traefik}/users.yml (100%) rename {suites => internal/suites}/action_http.go (100%) rename {suites => internal/suites}/action_login.go (100%) rename {suites => internal/suites}/action_logout.go (100%) rename {suites => internal/suites}/action_mail.go (100%) rename {suites => internal/suites}/action_register.go (100%) rename {suites => internal/suites}/action_totp.go (100%) rename {suites => internal/suites}/action_visit.go (100%) rename {suites => internal/suites}/constants.go (100%) rename {suites => internal/suites}/docker.go (97%) rename {suites => internal/suites}/environment.go (96%) rename {suites => internal/suites}/kubernetes.go (98%) rename {suites => internal/suites}/registry.go (100%) rename {suites => internal/suites}/scenario_one_factor_test.go (100%) rename {suites => internal/suites}/scenario_two_factor_test.go (100%) rename {suites => internal/suites}/suite_bypass_all.go (100%) rename {suites => internal/suites}/suite_bypass_all_test.go (100%) rename {suites => internal/suites}/suite_duo_push.go (100%) rename {suites => internal/suites}/suite_duo_push_test.go (100%) rename {suites => internal/suites}/suite_high_availability.go (100%) rename {suites => internal/suites}/suite_high_availability_test.go (100%) rename {suites => internal/suites}/suite_kubernetes.go (98%) rename {suites => internal/suites}/suite_kubernetes_test.go (100%) rename {suites => internal/suites}/suite_ldap.go (100%) rename {suites => internal/suites}/suite_ldap_test.go (100%) rename {suites => internal/suites}/suite_mariadb.go (100%) rename {suites => internal/suites}/suite_mariadb_test.go (100%) rename {suites => internal/suites}/suite_network_acl.go (100%) rename {suites => internal/suites}/suite_network_acl_test.go (100%) rename {suites => internal/suites}/suite_postgres.go (100%) rename {suites => internal/suites}/suite_postgres_test.go (100%) rename {suites => internal/suites}/suite_short_timeouts.go (100%) rename {suites => internal/suites}/suite_short_timeouts_test.go (100%) rename {suites => internal/suites}/suite_standalone.go (100%) rename {suites => internal/suites}/suite_standalone_test.go (100%) rename {suites => internal/suites}/suite_traefik.go (100%) rename {suites => internal/suites}/suite_traefik_test.go (100%) rename {suites => internal/suites}/suites.go (59%) rename {suites => internal/suites}/verify_body_contains.go (100%) rename {suites => internal/suites}/verify_is_first_factor_page.go (100%) rename {suites => internal/suites}/verify_is_second_factor_page.go (100%) rename {suites => internal/suites}/verify_notification.go (100%) rename {suites => internal/suites}/verify_secret_authorized.go (100%) rename {suites => internal/suites}/verify_url_is.go (100%) rename {suites => internal/suites}/webdriver.go (100%) rename {templates => internal/templates}/email.go (100%) rename {utils => internal/utils}/check.go (100%) rename {utils => internal/utils}/exec.go (100%) rename {utils => internal/utils}/files.go (100%) delete mode 100644 suites/Basic/configuration.yml delete mode 100644 suites/Traefik/users.yml diff --git a/cmd/authelia-scripts/cmd_bootstrap.go b/cmd/authelia-scripts/cmd_bootstrap.go index 40e74f20..f1639967 100644 --- a/cmd/authelia-scripts/cmd_bootstrap.go +++ b/cmd/authelia-scripts/cmd_bootstrap.go @@ -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"}, diff --git a/cmd/authelia-scripts/cmd_build.go b/cmd/authelia-scripts/cmd_build.go index 326d3897..9585d7b7 100644 --- a/cmd/authelia-scripts/cmd_build.go +++ b/cmd/authelia-scripts/cmd_build.go @@ -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" ) diff --git a/cmd/authelia-scripts/cmd_ci.go b/cmd/authelia-scripts/cmd_ci.go index e2d726db..cfa3d6b4 100644 --- a/cmd/authelia-scripts/cmd_ci.go +++ b/cmd/authelia-scripts/cmd_ci.go @@ -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" ) diff --git a/cmd/authelia-scripts/cmd_docker.go b/cmd/authelia-scripts/cmd_docker.go index 43050929..8e392963 100644 --- a/cmd/authelia-scripts/cmd_docker.go +++ b/cmd/authelia-scripts/cmd_docker.go @@ -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" ) diff --git a/cmd/authelia-scripts/cmd_hash_password.go b/cmd/authelia-scripts/cmd_hash_password.go index 33dee09c..c6bb5b03 100644 --- a/cmd/authelia-scripts/cmd_hash_password.go +++ b/cmd/authelia-scripts/cmd_hash_password.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/clems4ever/authelia/authentication" + "github.com/clems4ever/authelia/internal/authentication" "github.com/spf13/cobra" ) diff --git a/cmd/authelia-scripts/cmd_serve.go b/cmd/authelia-scripts/cmd_serve.go index f949611d..ed7917a4 100644 --- a/cmd/authelia-scripts/cmd_serve.go +++ b/cmd/authelia-scripts/cmd_serve.go @@ -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" ) diff --git a/cmd/authelia-scripts/cmd_suites.go b/cmd/authelia-scripts/cmd_suites.go index 05a18d5c..93c4cd55 100644 --- a/cmd/authelia-scripts/cmd_suites.go +++ b/cmd/authelia-scripts/cmd_suites.go @@ -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 diff --git a/cmd/authelia-scripts/cmd_unittest.go b/cmd/authelia-scripts/cmd_unittest.go index fd27551c..da42ea9d 100644 --- a/cmd/authelia-scripts/cmd_unittest.go +++ b/cmd/authelia-scripts/cmd_unittest.go @@ -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" ) diff --git a/cmd/authelia-scripts/docker.go b/cmd/authelia-scripts/docker.go index d9c0e8cc..a75f3dee 100644 --- a/cmd/authelia-scripts/docker.go +++ b/cmd/authelia-scripts/docker.go @@ -1,7 +1,7 @@ package main import ( - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" ) // Docker a docker object diff --git a/cmd/authelia-scripts/main.go b/cmd/authelia-scripts/main.go index 938a0941..4544253e 100755 --- a/cmd/authelia-scripts/main.go +++ b/cmd/authelia-scripts/main.go @@ -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" ) diff --git a/cmd/authelia-scripts/migration.go b/cmd/authelia-scripts/migration.go index 273241af..4ac63eed 100644 --- a/cmd/authelia-scripts/migration.go +++ b/cmd/authelia-scripts/migration.go @@ -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 diff --git a/cmd/authelia-scripts/migration_local.go b/cmd/authelia-scripts/migration_local.go index 8192cf3a..eb7e3c06 100644 --- a/cmd/authelia-scripts/migration_local.go +++ b/cmd/authelia-scripts/migration_local.go @@ -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" ) diff --git a/cmd/authelia-scripts/migration_mongo.go b/cmd/authelia-scripts/migration_mongo.go index daadc59f..49db36cd 100644 --- a/cmd/authelia-scripts/migration_mongo.go +++ b/cmd/authelia-scripts/migration_mongo.go @@ -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" diff --git a/cmd/authelia-suites/main.go b/cmd/authelia-suites/main.go index cd5140e6..d951daf0 100644 --- a/cmd/authelia-suites/main.go +++ b/cmd/authelia-suites/main.go @@ -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) diff --git a/cmd/authelia/main.go b/cmd/authelia/main.go index 8041f1aa..1d48f470 100644 --- a/cmd/authelia/main.go +++ b/cmd/authelia/main.go @@ -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" ) diff --git a/example/compose/authelia/docker-compose.backend.yml b/example/compose/authelia/docker-compose.backend.yml index 78c60340..cddc87e4 100644 --- a/example/compose/authelia/docker-compose.backend.yml +++ b/example/compose/authelia/docker-compose.backend.yml @@ -15,4 +15,5 @@ services: - SUITE_PATH=${SUITE_PATH} - ENVIRONMENT=dev networks: - - authelianet + authelianet: + ipv4_address: 192.168.240.50 diff --git a/authentication/const.go b/internal/authentication/const.go similarity index 100% rename from authentication/const.go rename to internal/authentication/const.go diff --git a/authentication/file_user_provider.go b/internal/authentication/file_user_provider.go similarity index 100% rename from authentication/file_user_provider.go rename to internal/authentication/file_user_provider.go diff --git a/authentication/file_user_provider_test.go b/internal/authentication/file_user_provider_test.go similarity index 100% rename from authentication/file_user_provider_test.go rename to internal/authentication/file_user_provider_test.go diff --git a/authentication/ldap_user_provider.go b/internal/authentication/ldap_user_provider.go similarity index 98% rename from authentication/ldap_user_provider.go rename to internal/authentication/ldap_user_provider.go index b139a803..d02d525c 100644 --- a/authentication/ldap_user_provider.go +++ b/internal/authentication/ldap_user_provider.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" "gopkg.in/ldap.v3" ) diff --git a/authentication/password_hash.go b/internal/authentication/password_hash.go similarity index 100% rename from authentication/password_hash.go rename to internal/authentication/password_hash.go diff --git a/authentication/password_hash_test.go b/internal/authentication/password_hash_test.go similarity index 100% rename from authentication/password_hash_test.go rename to internal/authentication/password_hash_test.go diff --git a/authentication/types.go b/internal/authentication/types.go similarity index 100% rename from authentication/types.go rename to internal/authentication/types.go diff --git a/authentication/user_provider.go b/internal/authentication/user_provider.go similarity index 100% rename from authentication/user_provider.go rename to internal/authentication/user_provider.go diff --git a/authorization/authorizer.go b/internal/authorization/authorizer.go similarity index 98% rename from authorization/authorizer.go rename to internal/authorization/authorizer.go index d6c01d50..7cdfeb63 100644 --- a/authorization/authorizer.go +++ b/internal/authorization/authorizer.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" ) const userPrefix = "user:" diff --git a/authorization/authorizer_test.go b/internal/authorization/authorizer_test.go similarity index 99% rename from authorization/authorizer_test.go rename to internal/authorization/authorizer_test.go index 82611a0a..fec72e08 100644 --- a/authorization/authorizer_test.go +++ b/internal/authorization/authorizer_test.go @@ -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" ) diff --git a/authorization/const.go b/internal/authorization/const.go similarity index 100% rename from authorization/const.go rename to internal/authorization/const.go diff --git a/configuration/reader.go b/internal/configuration/reader.go similarity index 81% rename from configuration/reader.go rename to internal/configuration/reader.go index 97277622..8a3f17eb 100644 --- a/configuration/reader.go +++ b/internal/configuration/reader.go @@ -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) { diff --git a/configuration/reader_test.go b/internal/configuration/reader_test.go similarity index 90% rename from configuration/reader_test.go rename to internal/configuration/reader_test.go index 1509082c..0f7afe59 100644 --- a/configuration/reader_test.go +++ b/internal/configuration/reader_test.go @@ -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) diff --git a/configuration/schema/access_control.go b/internal/configuration/schema/access_control.go similarity index 100% rename from configuration/schema/access_control.go rename to internal/configuration/schema/access_control.go diff --git a/configuration/schema/authentication.go b/internal/configuration/schema/authentication.go similarity index 100% rename from configuration/schema/authentication.go rename to internal/configuration/schema/authentication.go diff --git a/configuration/schema/configuration.go b/internal/configuration/schema/configuration.go similarity index 100% rename from configuration/schema/configuration.go rename to internal/configuration/schema/configuration.go diff --git a/configuration/schema/duo.go b/internal/configuration/schema/duo.go similarity index 100% rename from configuration/schema/duo.go rename to internal/configuration/schema/duo.go diff --git a/configuration/schema/notifier.go b/internal/configuration/schema/notifier.go similarity index 100% rename from configuration/schema/notifier.go rename to internal/configuration/schema/notifier.go diff --git a/configuration/schema/regulation.go b/internal/configuration/schema/regulation.go similarity index 100% rename from configuration/schema/regulation.go rename to internal/configuration/schema/regulation.go diff --git a/configuration/schema/session.go b/internal/configuration/schema/session.go similarity index 100% rename from configuration/schema/session.go rename to internal/configuration/schema/session.go diff --git a/configuration/schema/storage.go b/internal/configuration/schema/storage.go similarity index 100% rename from configuration/schema/storage.go rename to internal/configuration/schema/storage.go diff --git a/configuration/schema/totp.go b/internal/configuration/schema/totp.go similarity index 100% rename from configuration/schema/totp.go rename to internal/configuration/schema/totp.go diff --git a/configuration/schema/validator.go b/internal/configuration/schema/validator.go similarity index 100% rename from configuration/schema/validator.go rename to internal/configuration/schema/validator.go diff --git a/configuration/schema/validator_test.go b/internal/configuration/schema/validator_test.go similarity index 96% rename from configuration/schema/validator_test.go rename to internal/configuration/schema/validator_test.go index 20dc0830..5490a9ea 100644 --- a/configuration/schema/validator_test.go +++ b/internal/configuration/schema/validator_test.go @@ -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 { diff --git a/configuration/validator/authentication.go b/internal/configuration/validator/authentication.go similarity index 97% rename from configuration/validator/authentication.go rename to internal/configuration/validator/authentication.go index 94c255a2..688d7df0 100644 --- a/configuration/validator/authentication.go +++ b/internal/configuration/validator/authentication.go @@ -4,7 +4,7 @@ import ( "errors" "strings" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" ) var ldapProtocolPrefix = "ldap://" diff --git a/configuration/validator/authentication_test.go b/internal/configuration/validator/authentication_test.go similarity index 98% rename from configuration/validator/authentication_test.go rename to internal/configuration/validator/authentication_test.go index b0a78ff5..381d2a1c 100644 --- a/configuration/validator/authentication_test.go +++ b/internal/configuration/validator/authentication_test.go @@ -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" ) diff --git a/configuration/validator/configuration.go b/internal/configuration/validator/configuration.go similarity index 92% rename from configuration/validator/configuration.go rename to internal/configuration/validator/configuration.go index c15480c8..23428f2d 100644 --- a/configuration/validator/configuration.go +++ b/internal/configuration/validator/configuration.go @@ -3,7 +3,7 @@ package validator import ( "fmt" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" ) var defaultPort = 8080 diff --git a/configuration/validator/configuration_test.go b/internal/configuration/validator/configuration_test.go similarity index 95% rename from configuration/validator/configuration_test.go rename to internal/configuration/validator/configuration_test.go index b529029b..162bb89d 100644 --- a/configuration/validator/configuration_test.go +++ b/internal/configuration/validator/configuration_test.go @@ -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" ) diff --git a/configuration/validator/session.go b/internal/configuration/validator/session.go similarity index 90% rename from configuration/validator/session.go rename to internal/configuration/validator/session.go index 1ca870c1..c03c31e0 100644 --- a/configuration/validator/session.go +++ b/internal/configuration/validator/session.go @@ -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. diff --git a/configuration/validator/session_test.go b/internal/configuration/validator/session_test.go similarity index 94% rename from configuration/validator/session_test.go rename to internal/configuration/validator/session_test.go index a9c62b0d..e84e0847 100644 --- a/configuration/validator/session_test.go +++ b/internal/configuration/validator/session_test.go @@ -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" ) diff --git a/configuration/validator/storage.go b/internal/configuration/validator/storage.go similarity index 96% rename from configuration/validator/storage.go rename to internal/configuration/validator/storage.go index 0cce5fa7..13373783 100644 --- a/configuration/validator/storage.go +++ b/internal/configuration/validator/storage.go @@ -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. diff --git a/configuration/validator/totp.go b/internal/configuration/validator/totp.go similarity index 82% rename from configuration/validator/totp.go rename to internal/configuration/validator/totp.go index e2cda5b0..692ba5a8 100644 --- a/configuration/validator/totp.go +++ b/internal/configuration/validator/totp.go @@ -1,7 +1,7 @@ package validator import ( - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" ) const defaultTOTPIssuer = "Authelia" diff --git a/duo/duo.go b/internal/duo/duo.go similarity index 100% rename from duo/duo.go rename to internal/duo/duo.go diff --git a/duo/types.go b/internal/duo/types.go similarity index 100% rename from duo/types.go rename to internal/duo/types.go diff --git a/handlers/const.go b/internal/handlers/const.go similarity index 100% rename from handlers/const.go rename to internal/handlers/const.go diff --git a/handlers/errors.go b/internal/handlers/errors.go similarity index 100% rename from handlers/errors.go rename to internal/handlers/errors.go diff --git a/handlers/handler_2fa_available_methods.go b/internal/handlers/handler_2fa_available_methods.go similarity index 81% rename from handlers/handler_2fa_available_methods.go rename to internal/handlers/handler_2fa_available_methods.go index c3ba46a7..0bd67779 100644 --- a/handlers/handler_2fa_available_methods.go +++ b/internal/handlers/handler_2fa_available_methods.go @@ -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. diff --git a/handlers/handler_2fa_available_methods_test.go b/internal/handlers/handler_2fa_available_methods_test.go similarity index 89% rename from handlers/handler_2fa_available_methods_test.go rename to internal/handlers/handler_2fa_available_methods_test.go index fa7de9fb..1a3c58ba 100644 --- a/handlers/handler_2fa_available_methods_test.go +++ b/internal/handlers/handler_2fa_available_methods_test.go @@ -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" ) diff --git a/handlers/handler_2fa_preferences.go b/internal/handlers/handler_2fa_preferences.go similarity index 93% rename from handlers/handler_2fa_preferences.go rename to internal/handlers/handler_2fa_preferences.go index c40549a0..56379381 100644 --- a/handlers/handler_2fa_preferences.go +++ b/internal/handlers/handler_2fa_preferences.go @@ -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. diff --git a/handlers/handler_2fa_preferences_test.go b/internal/handlers/handler_2fa_preferences_test.go similarity index 98% rename from handlers/handler_2fa_preferences_test.go rename to internal/handlers/handler_2fa_preferences_test.go index 2d7ae71d..6a62ab7d 100644 --- a/handlers/handler_2fa_preferences_test.go +++ b/internal/handlers/handler_2fa_preferences_test.go @@ -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" diff --git a/handlers/handler_firstfactor.go b/internal/handlers/handler_firstfactor.go similarity index 93% rename from handlers/handler_firstfactor.go rename to internal/handlers/handler_firstfactor.go index 3d4eef68..96f6a4a3 100644 --- a/handlers/handler_firstfactor.go +++ b/internal/handlers/handler_firstfactor.go @@ -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. diff --git a/handlers/handler_firstfactor_test.go b/internal/handlers/handler_firstfactor_test.go similarity index 97% rename from handlers/handler_firstfactor_test.go rename to internal/handlers/handler_firstfactor_test.go index da74aa89..11e42b55 100644 --- a/handlers/handler_firstfactor_test.go +++ b/internal/handlers/handler_firstfactor_test.go @@ -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" diff --git a/handlers/handler_logout.go b/internal/handlers/handler_logout.go similarity index 88% rename from handlers/handler_logout.go rename to internal/handlers/handler_logout.go index 76d2b2b6..36e4d33c 100644 --- a/handlers/handler_logout.go +++ b/internal/handlers/handler_logout.go @@ -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. diff --git a/handlers/handler_logout_test.go b/internal/handlers/handler_logout_test.go similarity index 94% rename from handlers/handler_logout_test.go rename to internal/handlers/handler_logout_test.go index d6656a0d..e9aa9f8c 100644 --- a/handlers/handler_logout_test.go +++ b/internal/handlers/handler_logout_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/clems4ever/authelia/mocks" + "github.com/clems4ever/authelia/internal/mocks" "github.com/stretchr/testify/assert" diff --git a/handlers/handler_register_totp.go b/internal/handlers/handler_register_totp.go similarity index 95% rename from handlers/handler_register_totp.go rename to internal/handlers/handler_register_totp.go index 3ae8fdb6..947c0ae8 100644 --- a/handlers/handler_register_totp.go +++ b/internal/handlers/handler_register_totp.go @@ -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" ) diff --git a/handlers/handler_register_u2f_step1.go b/internal/handlers/handler_register_u2f_step1.go similarity index 97% rename from handlers/handler_register_u2f_step1.go rename to internal/handlers/handler_register_u2f_step1.go index 5cb3fe8c..0f937b78 100644 --- a/handlers/handler_register_u2f_step1.go +++ b/internal/handlers/handler_register_u2f_step1.go @@ -3,7 +3,7 @@ package handlers import ( "fmt" - "github.com/clems4ever/authelia/middlewares" + "github.com/clems4ever/authelia/internal/middlewares" "github.com/tstranex/u2f" ) diff --git a/handlers/handler_register_u2f_step2.go b/internal/handlers/handler_register_u2f_step2.go similarity index 96% rename from handlers/handler_register_u2f_step2.go rename to internal/handlers/handler_register_u2f_step2.go index c666cec9..12b5fc50 100644 --- a/handlers/handler_register_u2f_step2.go +++ b/internal/handlers/handler_register_u2f_step2.go @@ -4,7 +4,7 @@ import ( "crypto/elliptic" "fmt" - "github.com/clems4ever/authelia/middlewares" + "github.com/clems4ever/authelia/internal/middlewares" "github.com/tstranex/u2f" ) diff --git a/handlers/handler_reset_password_step1.go b/internal/handlers/handler_reset_password_step1.go similarity index 94% rename from handlers/handler_reset_password_step1.go rename to internal/handlers/handler_reset_password_step1.go index a5c63213..abb88e68 100644 --- a/handlers/handler_reset_password_step1.go +++ b/internal/handlers/handler_reset_password_step1.go @@ -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) { diff --git a/handlers/handler_reset_password_step2.go b/internal/handlers/handler_reset_password_step2.go similarity index 96% rename from handlers/handler_reset_password_step2.go rename to internal/handlers/handler_reset_password_step2.go index 02b638a4..c43c9969 100644 --- a/handlers/handler_reset_password_step2.go +++ b/internal/handlers/handler_reset_password_step2.go @@ -3,7 +3,7 @@ package handlers import ( "fmt" - "github.com/clems4ever/authelia/middlewares" + "github.com/clems4ever/authelia/internal/middlewares" ) // ResetPasswordPost handler for resetting passwords diff --git a/handlers/handler_sign_duo.go b/internal/handlers/handler_sign_duo.go similarity index 91% rename from handlers/handler_sign_duo.go rename to internal/handlers/handler_sign_duo.go index b3d51c7f..eee49df4 100644 --- a/handlers/handler_sign_duo.go +++ b/internal/handlers/handler_sign_duo.go @@ -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. diff --git a/handlers/handler_sign_duo_test.go b/internal/handlers/handler_sign_duo_test.go similarity index 96% rename from handlers/handler_sign_duo_test.go rename to internal/handlers/handler_sign_duo_test.go index 3781684a..8877e98d 100644 --- a/handlers/handler_sign_duo_test.go +++ b/internal/handlers/handler_sign_duo_test.go @@ -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" diff --git a/handlers/handler_sign_totp.go b/internal/handlers/handler_sign_totp.go similarity index 92% rename from handlers/handler_sign_totp.go rename to internal/handlers/handler_sign_totp.go index 905ed695..aeccee3d 100644 --- a/handlers/handler_sign_totp.go +++ b/internal/handlers/handler_sign_totp.go @@ -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" ) diff --git a/handlers/handler_sign_u2f_step1.go b/internal/handlers/handler_sign_u2f_step1.go similarity index 92% rename from handlers/handler_sign_u2f_step1.go rename to internal/handlers/handler_sign_u2f_step1.go index 4d9a47ea..41208040 100644 --- a/handlers/handler_sign_u2f_step1.go +++ b/internal/handlers/handler_sign_u2f_step1.go @@ -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" ) diff --git a/handlers/handler_sign_u2f_step2.go b/internal/handlers/handler_sign_u2f_step2.go similarity index 94% rename from handlers/handler_sign_u2f_step2.go rename to internal/handlers/handler_sign_u2f_step2.go index e0cee607..d189ad8e 100644 --- a/handlers/handler_sign_u2f_step2.go +++ b/internal/handlers/handler_sign_u2f_step2.go @@ -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" ) diff --git a/handlers/handler_state.go b/internal/handlers/handler_state.go similarity index 87% rename from handlers/handler_state.go rename to internal/handlers/handler_state.go index 75eee884..b013c560 100644 --- a/handlers/handler_state.go +++ b/internal/handlers/handler_state.go @@ -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. diff --git a/handlers/handler_state_test.go b/internal/handlers/handler_state_test.go similarity index 94% rename from handlers/handler_state_test.go rename to internal/handlers/handler_state_test.go index b47c4901..12eff91f 100644 --- a/handlers/handler_state_test.go +++ b/internal/handlers/handler_state_test.go @@ -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" ) diff --git a/handlers/handler_verify.go b/internal/handlers/handler_verify.go similarity index 98% rename from handlers/handler_verify.go rename to internal/handlers/handler_verify.go index 521dbd41..e9de683c 100644 --- a/handlers/handler_verify.go +++ b/internal/handlers/handler_verify.go @@ -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" ) diff --git a/handlers/handler_verify_test.go b/internal/handlers/handler_verify_test.go similarity index 98% rename from handlers/handler_verify_test.go rename to internal/handlers/handler_verify_test.go index 65bffa3a..f478cf91 100644 --- a/handlers/handler_verify_test.go +++ b/internal/handlers/handler_verify_test.go @@ -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" ) diff --git a/handlers/safe_redirection.go b/internal/handlers/safe_redirection.go similarity index 100% rename from handlers/safe_redirection.go rename to internal/handlers/safe_redirection.go diff --git a/handlers/safe_redirection_test.go b/internal/handlers/safe_redirection_test.go similarity index 100% rename from handlers/safe_redirection_test.go rename to internal/handlers/safe_redirection_test.go diff --git a/handlers/types.go b/internal/handlers/types.go similarity index 97% rename from handlers/types.go rename to internal/handlers/types.go index 44c11526..51beec7e 100644 --- a/handlers/types.go +++ b/internal/handlers/types.go @@ -1,7 +1,7 @@ package handlers import ( - "github.com/clems4ever/authelia/authentication" + "github.com/clems4ever/authelia/internal/authentication" "github.com/tstranex/u2f" ) diff --git a/logging/logger.go b/internal/logging/logger.go similarity index 100% rename from logging/logger.go rename to internal/logging/logger.go diff --git a/middlewares/authelia_context.go b/internal/middlewares/authelia_context.go similarity index 96% rename from middlewares/authelia_context.go rename to internal/middlewares/authelia_context.go index 4bd3b736..8ade46fe 100644 --- a/middlewares/authelia_context.go +++ b/internal/middlewares/authelia_context.go @@ -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" ) diff --git a/middlewares/authelia_context_test.go b/internal/middlewares/authelia_context_test.go similarity index 78% rename from middlewares/authelia_context_test.go rename to internal/middlewares/authelia_context_test.go index e244a6cc..35fe46fc 100644 --- a/middlewares/authelia_context_test.go +++ b/internal/middlewares/authelia_context_test.go @@ -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" diff --git a/middlewares/const.go b/internal/middlewares/const.go similarity index 100% rename from middlewares/const.go rename to internal/middlewares/const.go diff --git a/middlewares/errors.go b/internal/middlewares/errors.go similarity index 100% rename from middlewares/errors.go rename to internal/middlewares/errors.go diff --git a/middlewares/identity_verification.go b/internal/middlewares/identity_verification.go similarity index 98% rename from middlewares/identity_verification.go rename to internal/middlewares/identity_verification.go index df659a19..c476694e 100644 --- a/middlewares/identity_verification.go +++ b/internal/middlewares/identity_verification.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/clems4ever/authelia/templates" + "github.com/clems4ever/authelia/internal/templates" jwt "github.com/dgrijalva/jwt-go" ) diff --git a/middlewares/identity_verification_test.go b/internal/middlewares/identity_verification_test.go similarity index 98% rename from middlewares/identity_verification_test.go rename to internal/middlewares/identity_verification_test.go index a21531b5..7822ff3b 100644 --- a/middlewares/identity_verification_test.go +++ b/internal/middlewares/identity_verification_test.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" diff --git a/middlewares/log_request.go b/internal/middlewares/log_request.go similarity index 88% rename from middlewares/log_request.go rename to internal/middlewares/log_request.go index 3a222098..659d5883 100644 --- a/middlewares/log_request.go +++ b/internal/middlewares/log_request.go @@ -1,7 +1,7 @@ package middlewares import ( - "github.com/clems4ever/authelia/logging" + "github.com/clems4ever/authelia/internal/logging" "github.com/valyala/fasthttp" ) diff --git a/middlewares/log_request_test.go b/internal/middlewares/log_request_test.go similarity index 100% rename from middlewares/log_request_test.go rename to internal/middlewares/log_request_test.go diff --git a/middlewares/require_first_factor.go b/internal/middlewares/require_first_factor.go similarity index 85% rename from middlewares/require_first_factor.go rename to internal/middlewares/require_first_factor.go index 73fbd64b..dd804792 100644 --- a/middlewares/require_first_factor.go +++ b/internal/middlewares/require_first_factor.go @@ -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. diff --git a/middlewares/types.go b/internal/middlewares/types.go similarity index 88% rename from middlewares/types.go rename to internal/middlewares/types.go index 35db422f..9f01f672 100644 --- a/middlewares/types.go +++ b/internal/middlewares/types.go @@ -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" diff --git a/mocks/mock_authelia_ctx.go b/internal/mocks/mock_authelia_ctx.go similarity index 90% rename from mocks/mock_authelia_ctx.go rename to internal/mocks/mock_authelia_ctx.go index cdf1868b..e8f75a26 100644 --- a/mocks/mock_authelia_ctx.go +++ b/internal/mocks/mock_authelia_ctx.go @@ -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" diff --git a/mocks/mock_duo_api.go b/internal/mocks/mock_duo_api.go similarity index 90% rename from mocks/mock_duo_api.go rename to internal/mocks/mock_duo_api.go index bcbae159..de4b7ff2 100644 --- a/mocks/mock_duo_api.go +++ b/internal/mocks/mock_duo_api.go @@ -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" ) diff --git a/mocks/mock_notifier.go b/internal/mocks/mock_notifier.go similarity index 93% rename from mocks/mock_notifier.go rename to internal/mocks/mock_notifier.go index 70ee6dfa..f05503bb 100644 --- a/mocks/mock_notifier.go +++ b/internal/mocks/mock_notifier.go @@ -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 diff --git a/mocks/mock_user_provider.go b/internal/mocks/mock_user_provider.go similarity index 94% rename from mocks/mock_user_provider.go rename to internal/mocks/mock_user_provider.go index 7da1a0b7..7e594eb1 100644 --- a/mocks/mock_user_provider.go +++ b/internal/mocks/mock_user_provider.go @@ -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" ) diff --git a/models/types.go b/internal/models/types.go similarity index 100% rename from models/types.go rename to internal/models/types.go diff --git a/notification/file_notifier.go b/internal/notification/file_notifier.go similarity index 92% rename from notification/file_notifier.go rename to internal/notification/file_notifier.go index c38b03a6..81fb3df4 100644 --- a/notification/file_notifier.go +++ b/internal/notification/file_notifier.go @@ -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. diff --git a/notification/notifier.go b/internal/notification/notifier.go similarity index 100% rename from notification/notifier.go rename to internal/notification/notifier.go diff --git a/notification/smtp_notifier.go b/internal/notification/smtp_notifier.go similarity index 97% rename from notification/smtp_notifier.go rename to internal/notification/smtp_notifier.go index cf61596d..24df7ee3 100644 --- a/notification/smtp_notifier.go +++ b/internal/notification/smtp_notifier.go @@ -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. diff --git a/regulation/const.go b/internal/regulation/const.go similarity index 100% rename from regulation/const.go rename to internal/regulation/const.go diff --git a/regulation/regulator.go b/internal/regulation/regulator.go similarity index 94% rename from regulation/regulator.go rename to internal/regulation/regulator.go index a756052c..15450a15 100644 --- a/regulation/regulator.go +++ b/internal/regulation/regulator.go @@ -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. diff --git a/regulation/regulator_test.go b/internal/regulation/regulator_test.go similarity index 96% rename from regulation/regulator_test.go rename to internal/regulation/regulator_test.go index ed361b0b..ae3f3701 100644 --- a/regulation/regulator_test.go +++ b/internal/regulation/regulator_test.go @@ -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" diff --git a/regulation/types.go b/internal/regulation/types.go similarity index 91% rename from regulation/types.go rename to internal/regulation/types.go index eb5aec8c..96c0443b 100644 --- a/regulation/types.go +++ b/internal/regulation/types.go @@ -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. diff --git a/server/server.go b/internal/server/server.go similarity index 93% rename from server/server.go rename to internal/server/server.go index 0b84620f..fd89adcb 100644 --- a/server/server.go +++ b/internal/server/server.go @@ -4,11 +4,11 @@ import ( "fmt" "os" - "github.com/clems4ever/authelia/configuration/schema" - "github.com/clems4ever/authelia/duo" - "github.com/clems4ever/authelia/handlers" - "github.com/clems4ever/authelia/logging" - "github.com/clems4ever/authelia/middlewares" + "github.com/clems4ever/authelia/internal/configuration/schema" + "github.com/clems4ever/authelia/internal/duo" + "github.com/clems4ever/authelia/internal/handlers" + "github.com/clems4ever/authelia/internal/logging" + "github.com/clems4ever/authelia/internal/middlewares" duoapi "github.com/duosecurity/duo_api_golang" "github.com/fasthttp/router" "github.com/valyala/fasthttp" diff --git a/session/const.go b/internal/session/const.go similarity index 100% rename from session/const.go rename to internal/session/const.go diff --git a/session/mocks/mock_storer.go b/internal/session/mocks/mock_storer.go similarity index 100% rename from session/mocks/mock_storer.go rename to internal/session/mocks/mock_storer.go diff --git a/session/provider.go b/internal/session/provider.go similarity index 97% rename from session/provider.go rename to internal/session/provider.go index 87ca835a..8d8616b2 100644 --- a/session/provider.go +++ b/internal/session/provider.go @@ -4,7 +4,7 @@ import ( "encoding/json" "time" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" fasthttpsession "github.com/fasthttp/session" "github.com/valyala/fasthttp" ) diff --git a/session/provider_config.go b/internal/session/provider_config.go similarity index 96% rename from session/provider_config.go rename to internal/session/provider_config.go index 75358a32..7b355729 100644 --- a/session/provider_config.go +++ b/internal/session/provider_config.go @@ -5,7 +5,7 @@ import ( "github.com/valyala/fasthttp" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" "github.com/fasthttp/session" "github.com/fasthttp/session/memory" "github.com/fasthttp/session/redis" diff --git a/session/provider_config_test.go b/internal/session/provider_config_test.go similarity index 96% rename from session/provider_config_test.go rename to internal/session/provider_config_test.go index 21a70645..4e562832 100644 --- a/session/provider_config_test.go +++ b/internal/session/provider_config_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" "github.com/fasthttp/session/memory" "github.com/fasthttp/session/redis" "github.com/stretchr/testify/assert" diff --git a/session/provider_test.go b/internal/session/provider_test.go similarity index 89% rename from session/provider_test.go rename to internal/session/provider_test.go index 30864f93..f43e433c 100644 --- a/session/provider_test.go +++ b/internal/session/provider_test.go @@ -3,13 +3,13 @@ package session import ( "testing" - "github.com/clems4ever/authelia/authentication" + "github.com/clems4ever/authelia/internal/authentication" "github.com/stretchr/testify/assert" "github.com/valyala/fasthttp" - "github.com/clems4ever/authelia/configuration/schema" + "github.com/clems4ever/authelia/internal/configuration/schema" ) func TestShouldInitializerSession(t *testing.T) { diff --git a/session/types.go b/internal/session/types.go similarity index 96% rename from session/types.go rename to internal/session/types.go index a1a1f3ef..1e15b116 100644 --- a/session/types.go +++ b/internal/session/types.go @@ -1,7 +1,7 @@ package session import ( - "github.com/clems4ever/authelia/authentication" + "github.com/clems4ever/authelia/internal/authentication" "github.com/fasthttp/session" "github.com/tstranex/u2f" ) diff --git a/session/user_session.go b/internal/session/user_session.go similarity index 79% rename from session/user_session.go rename to internal/session/user_session.go index 4a537c14..1d0dce8b 100644 --- a/session/user_session.go +++ b/internal/session/user_session.go @@ -1,6 +1,6 @@ package session -import "github.com/clems4ever/authelia/authentication" +import "github.com/clems4ever/authelia/internal/authentication" // NewDefaultUserSession create a default user session. func NewDefaultUserSession() UserSession { diff --git a/storage/constants.go b/internal/storage/constants.go similarity index 100% rename from storage/constants.go rename to internal/storage/constants.go diff --git a/storage/errors.go b/internal/storage/errors.go similarity index 100% rename from storage/errors.go rename to internal/storage/errors.go diff --git a/storage/mysql_provider.go b/internal/storage/mysql_provider.go similarity index 95% rename from storage/mysql_provider.go rename to internal/storage/mysql_provider.go index bff40d48..c4cd45f9 100644 --- a/storage/mysql_provider.go +++ b/internal/storage/mysql_provider.go @@ -4,8 +4,8 @@ import ( "database/sql" "fmt" - "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/go-sql-driver/mysql" // Load the MySQL Driver used in the connection string. ) diff --git a/storage/postgres_provider.go b/internal/storage/postgres_provider.go similarity index 96% rename from storage/postgres_provider.go rename to internal/storage/postgres_provider.go index e69bb135..ada6cbbb 100644 --- a/storage/postgres_provider.go +++ b/internal/storage/postgres_provider.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "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/lib/pq" // Load the PostgreSQL Driver used in the connection string. ) diff --git a/storage/provider.go b/internal/storage/provider.go similarity index 94% rename from storage/provider.go rename to internal/storage/provider.go index 9a79d589..f2e468bc 100644 --- a/storage/provider.go +++ b/internal/storage/provider.go @@ -3,7 +3,7 @@ package storage import ( "time" - "github.com/clems4ever/authelia/models" + "github.com/clems4ever/authelia/internal/models" ) // Provider is an interface providing storage capabilities for diff --git a/storage/provider_mock.go b/internal/storage/provider_mock.go similarity index 98% rename from storage/provider_mock.go rename to internal/storage/provider_mock.go index 984f5eaf..1df8557d 100644 --- a/storage/provider_mock.go +++ b/internal/storage/provider_mock.go @@ -1,11 +1,11 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/clems4ever/authelia/storage (interfaces: Provider) +// Source: github.com/clems4ever/authelia/internal/storage (interfaces: Provider) // Package storage is a generated GoMock package. package storage import ( - models "github.com/clems4ever/authelia/models" + models "github.com/clems4ever/authelia/internal/models" gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" diff --git a/storage/sql_provider.go b/internal/storage/sql_provider.go similarity index 99% rename from storage/sql_provider.go rename to internal/storage/sql_provider.go index ebb238c4..a7bd3122 100644 --- a/storage/sql_provider.go +++ b/internal/storage/sql_provider.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/clems4ever/authelia/models" + "github.com/clems4ever/authelia/internal/models" ) // SQLProvider is a storage provider persisting data in a SQL database. diff --git a/storage/sqlite_provider.go b/internal/storage/sqlite_provider.go similarity index 97% rename from storage/sqlite_provider.go rename to internal/storage/sqlite_provider.go index 4ef56471..72718be2 100644 --- a/storage/sqlite_provider.go +++ b/internal/storage/sqlite_provider.go @@ -4,7 +4,7 @@ import ( "database/sql" "fmt" - "github.com/clems4ever/authelia/logging" + "github.com/clems4ever/authelia/internal/logging" _ "github.com/mattn/go-sqlite3" // Load the SQLite Driver used in the connection string. ) diff --git a/suites/BypassAll/configuration.yml b/internal/suites/BypassAll/configuration.yml similarity index 100% rename from suites/BypassAll/configuration.yml rename to internal/suites/BypassAll/configuration.yml diff --git a/suites/Basic/users.yml b/internal/suites/BypassAll/users.yml similarity index 100% rename from suites/Basic/users.yml rename to internal/suites/BypassAll/users.yml diff --git a/suites/DuoPush/configuration.yml b/internal/suites/DuoPush/configuration.yml similarity index 100% rename from suites/DuoPush/configuration.yml rename to internal/suites/DuoPush/configuration.yml diff --git a/suites/BypassAll/users.yml b/internal/suites/DuoPush/users.yml similarity index 100% rename from suites/BypassAll/users.yml rename to internal/suites/DuoPush/users.yml diff --git a/suites/HighAvailability/configuration.yml b/internal/suites/HighAvailability/configuration.yml similarity index 100% rename from suites/HighAvailability/configuration.yml rename to internal/suites/HighAvailability/configuration.yml diff --git a/suites/LDAP/configuration.yml b/internal/suites/LDAP/configuration.yml similarity index 100% rename from suites/LDAP/configuration.yml rename to internal/suites/LDAP/configuration.yml diff --git a/suites/Mariadb/configuration.yml b/internal/suites/Mariadb/configuration.yml similarity index 100% rename from suites/Mariadb/configuration.yml rename to internal/suites/Mariadb/configuration.yml diff --git a/suites/DuoPush/users.yml b/internal/suites/Mariadb/users.yml similarity index 100% rename from suites/DuoPush/users.yml rename to internal/suites/Mariadb/users.yml diff --git a/suites/NetworkACL/configuration.yml b/internal/suites/NetworkACL/configuration.yml similarity index 100% rename from suites/NetworkACL/configuration.yml rename to internal/suites/NetworkACL/configuration.yml diff --git a/suites/Mariadb/users.yml b/internal/suites/NetworkACL/users.yml similarity index 100% rename from suites/Mariadb/users.yml rename to internal/suites/NetworkACL/users.yml diff --git a/suites/Postgres/configuration.yml b/internal/suites/Postgres/configuration.yml similarity index 100% rename from suites/Postgres/configuration.yml rename to internal/suites/Postgres/configuration.yml diff --git a/suites/NetworkACL/users.yml b/internal/suites/Postgres/users.yml similarity index 100% rename from suites/NetworkACL/users.yml rename to internal/suites/Postgres/users.yml diff --git a/suites/ShortTimeouts/configuration.yml b/internal/suites/ShortTimeouts/configuration.yml similarity index 100% rename from suites/ShortTimeouts/configuration.yml rename to internal/suites/ShortTimeouts/configuration.yml diff --git a/suites/Postgres/users.yml b/internal/suites/ShortTimeouts/users.yml similarity index 100% rename from suites/Postgres/users.yml rename to internal/suites/ShortTimeouts/users.yml diff --git a/suites/Standalone/configuration.yml b/internal/suites/Standalone/configuration.yml similarity index 100% rename from suites/Standalone/configuration.yml rename to internal/suites/Standalone/configuration.yml diff --git a/suites/Standalone/users.yml b/internal/suites/Standalone/users.yml similarity index 100% rename from suites/Standalone/users.yml rename to internal/suites/Standalone/users.yml diff --git a/suites/Traefik/configuration.yml b/internal/suites/Traefik/configuration.yml similarity index 100% rename from suites/Traefik/configuration.yml rename to internal/suites/Traefik/configuration.yml diff --git a/suites/ShortTimeouts/users.yml b/internal/suites/Traefik/users.yml similarity index 100% rename from suites/ShortTimeouts/users.yml rename to internal/suites/Traefik/users.yml diff --git a/suites/action_http.go b/internal/suites/action_http.go similarity index 100% rename from suites/action_http.go rename to internal/suites/action_http.go diff --git a/suites/action_login.go b/internal/suites/action_login.go similarity index 100% rename from suites/action_login.go rename to internal/suites/action_login.go diff --git a/suites/action_logout.go b/internal/suites/action_logout.go similarity index 100% rename from suites/action_logout.go rename to internal/suites/action_logout.go diff --git a/suites/action_mail.go b/internal/suites/action_mail.go similarity index 100% rename from suites/action_mail.go rename to internal/suites/action_mail.go diff --git a/suites/action_register.go b/internal/suites/action_register.go similarity index 100% rename from suites/action_register.go rename to internal/suites/action_register.go diff --git a/suites/action_totp.go b/internal/suites/action_totp.go similarity index 100% rename from suites/action_totp.go rename to internal/suites/action_totp.go diff --git a/suites/action_visit.go b/internal/suites/action_visit.go similarity index 100% rename from suites/action_visit.go rename to internal/suites/action_visit.go diff --git a/suites/constants.go b/internal/suites/constants.go similarity index 100% rename from suites/constants.go rename to internal/suites/constants.go diff --git a/suites/docker.go b/internal/suites/docker.go similarity index 97% rename from suites/docker.go rename to internal/suites/docker.go index a9d15e0e..9be0f189 100644 --- a/suites/docker.go +++ b/internal/suites/docker.go @@ -6,7 +6,7 @@ import ( "os/exec" "strings" - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" log "github.com/sirupsen/logrus" ) diff --git a/suites/environment.go b/internal/suites/environment.go similarity index 96% rename from suites/environment.go rename to internal/suites/environment.go index 6fb84e88..054cb772 100644 --- a/suites/environment.go +++ b/internal/suites/environment.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" log "github.com/sirupsen/logrus" ) diff --git a/suites/kubernetes.go b/internal/suites/kubernetes.go similarity index 98% rename from suites/kubernetes.go rename to internal/suites/kubernetes.go index 2cfa346c..c4d27e79 100644 --- a/suites/kubernetes.go +++ b/internal/suites/kubernetes.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" ) var kindImageName = "authelia-kind-proxy" diff --git a/suites/registry.go b/internal/suites/registry.go similarity index 100% rename from suites/registry.go rename to internal/suites/registry.go diff --git a/suites/scenario_one_factor_test.go b/internal/suites/scenario_one_factor_test.go similarity index 100% rename from suites/scenario_one_factor_test.go rename to internal/suites/scenario_one_factor_test.go diff --git a/suites/scenario_two_factor_test.go b/internal/suites/scenario_two_factor_test.go similarity index 100% rename from suites/scenario_two_factor_test.go rename to internal/suites/scenario_two_factor_test.go diff --git a/suites/suite_bypass_all.go b/internal/suites/suite_bypass_all.go similarity index 100% rename from suites/suite_bypass_all.go rename to internal/suites/suite_bypass_all.go diff --git a/suites/suite_bypass_all_test.go b/internal/suites/suite_bypass_all_test.go similarity index 100% rename from suites/suite_bypass_all_test.go rename to internal/suites/suite_bypass_all_test.go diff --git a/suites/suite_duo_push.go b/internal/suites/suite_duo_push.go similarity index 100% rename from suites/suite_duo_push.go rename to internal/suites/suite_duo_push.go diff --git a/suites/suite_duo_push_test.go b/internal/suites/suite_duo_push_test.go similarity index 100% rename from suites/suite_duo_push_test.go rename to internal/suites/suite_duo_push_test.go diff --git a/suites/suite_high_availability.go b/internal/suites/suite_high_availability.go similarity index 100% rename from suites/suite_high_availability.go rename to internal/suites/suite_high_availability.go diff --git a/suites/suite_high_availability_test.go b/internal/suites/suite_high_availability_test.go similarity index 100% rename from suites/suite_high_availability_test.go rename to internal/suites/suite_high_availability_test.go diff --git a/suites/suite_kubernetes.go b/internal/suites/suite_kubernetes.go similarity index 98% rename from suites/suite_kubernetes.go rename to internal/suites/suite_kubernetes.go index b0c97eb4..34dbd381 100644 --- a/suites/suite_kubernetes.go +++ b/internal/suites/suite_kubernetes.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" log "github.com/sirupsen/logrus" ) diff --git a/suites/suite_kubernetes_test.go b/internal/suites/suite_kubernetes_test.go similarity index 100% rename from suites/suite_kubernetes_test.go rename to internal/suites/suite_kubernetes_test.go diff --git a/suites/suite_ldap.go b/internal/suites/suite_ldap.go similarity index 100% rename from suites/suite_ldap.go rename to internal/suites/suite_ldap.go diff --git a/suites/suite_ldap_test.go b/internal/suites/suite_ldap_test.go similarity index 100% rename from suites/suite_ldap_test.go rename to internal/suites/suite_ldap_test.go diff --git a/suites/suite_mariadb.go b/internal/suites/suite_mariadb.go similarity index 100% rename from suites/suite_mariadb.go rename to internal/suites/suite_mariadb.go diff --git a/suites/suite_mariadb_test.go b/internal/suites/suite_mariadb_test.go similarity index 100% rename from suites/suite_mariadb_test.go rename to internal/suites/suite_mariadb_test.go diff --git a/suites/suite_network_acl.go b/internal/suites/suite_network_acl.go similarity index 100% rename from suites/suite_network_acl.go rename to internal/suites/suite_network_acl.go diff --git a/suites/suite_network_acl_test.go b/internal/suites/suite_network_acl_test.go similarity index 100% rename from suites/suite_network_acl_test.go rename to internal/suites/suite_network_acl_test.go diff --git a/suites/suite_postgres.go b/internal/suites/suite_postgres.go similarity index 100% rename from suites/suite_postgres.go rename to internal/suites/suite_postgres.go diff --git a/suites/suite_postgres_test.go b/internal/suites/suite_postgres_test.go similarity index 100% rename from suites/suite_postgres_test.go rename to internal/suites/suite_postgres_test.go diff --git a/suites/suite_short_timeouts.go b/internal/suites/suite_short_timeouts.go similarity index 100% rename from suites/suite_short_timeouts.go rename to internal/suites/suite_short_timeouts.go diff --git a/suites/suite_short_timeouts_test.go b/internal/suites/suite_short_timeouts_test.go similarity index 100% rename from suites/suite_short_timeouts_test.go rename to internal/suites/suite_short_timeouts_test.go diff --git a/suites/suite_standalone.go b/internal/suites/suite_standalone.go similarity index 100% rename from suites/suite_standalone.go rename to internal/suites/suite_standalone.go diff --git a/suites/suite_standalone_test.go b/internal/suites/suite_standalone_test.go similarity index 100% rename from suites/suite_standalone_test.go rename to internal/suites/suite_standalone_test.go diff --git a/suites/suite_traefik.go b/internal/suites/suite_traefik.go similarity index 100% rename from suites/suite_traefik.go rename to internal/suites/suite_traefik.go diff --git a/suites/suite_traefik_test.go b/internal/suites/suite_traefik_test.go similarity index 100% rename from suites/suite_traefik_test.go rename to internal/suites/suite_traefik_test.go diff --git a/suites/suites.go b/internal/suites/suites.go similarity index 59% rename from suites/suites.go rename to internal/suites/suites.go index d8042de8..373d4e83 100644 --- a/suites/suites.go +++ b/internal/suites/suites.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/clems4ever/authelia/utils" + "github.com/clems4ever/authelia/internal/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "github.com/tebeka/selenium" @@ -45,7 +45,7 @@ func rootPath() string { // If env variable is not provided, use relative path. if rootPath == "" { - rootPath = ".." + rootPath = "../.." } return rootPath } @@ -66,6 +66,8 @@ func RunTypescriptSuite(t *testing.T, suite string) { fmt.Sprintf("test/suites/%s/test.ts", suite) command := utils.CommandWithStdout("bash", "-c", cmdline) + command.Stdout = os.Stdout + command.Stderr = os.Stderr command.Dir = rootPath() command.Env = append( os.Environ(), @@ -74,28 +76,3 @@ func RunTypescriptSuite(t *testing.T, suite string) { assert.NoError(t, command.Run()) } - -// SetupTeardown binding setup and teardown functors -type SetupTeardown struct { - Setup func(suitePath string) error - Teardown func(suitePath string) error -} - -// CreateTypescriptSetupTeardown create a setup and teardown functor from the suite name -func CreateTypescriptSetupTeardown(suite string) SetupTeardown { - setup := func(suitePath string) error { - cmdline := "./node_modules/.bin/ts-node -P test/tsconfig.json -- ./scripts/setup-environment.ts " + suite - command := utils.CommandWithStdout("bash", "-c", cmdline) - command.Env = append(os.Environ(), "ENVIRONMENT=dev", fmt.Sprintf("SUITE_PATH=%s", suitePath)) - return command.Run() - } - - teardown := func(suitePath string) error { - cmdline := "./node_modules/.bin/ts-node -P test/tsconfig.json -- ./scripts/teardown-environment.ts " + suite - command := utils.CommandWithStdout("bash", "-c", cmdline) - command.Env = append(os.Environ(), "ENVIRONMENT=dev", fmt.Sprintf("SUITE_PATH=%s", suitePath)) - return command.Run() - } - - return SetupTeardown{Setup: setup, Teardown: teardown} -} diff --git a/suites/verify_body_contains.go b/internal/suites/verify_body_contains.go similarity index 100% rename from suites/verify_body_contains.go rename to internal/suites/verify_body_contains.go diff --git a/suites/verify_is_first_factor_page.go b/internal/suites/verify_is_first_factor_page.go similarity index 100% rename from suites/verify_is_first_factor_page.go rename to internal/suites/verify_is_first_factor_page.go diff --git a/suites/verify_is_second_factor_page.go b/internal/suites/verify_is_second_factor_page.go similarity index 100% rename from suites/verify_is_second_factor_page.go rename to internal/suites/verify_is_second_factor_page.go diff --git a/suites/verify_notification.go b/internal/suites/verify_notification.go similarity index 100% rename from suites/verify_notification.go rename to internal/suites/verify_notification.go diff --git a/suites/verify_secret_authorized.go b/internal/suites/verify_secret_authorized.go similarity index 100% rename from suites/verify_secret_authorized.go rename to internal/suites/verify_secret_authorized.go diff --git a/suites/verify_url_is.go b/internal/suites/verify_url_is.go similarity index 100% rename from suites/verify_url_is.go rename to internal/suites/verify_url_is.go diff --git a/suites/webdriver.go b/internal/suites/webdriver.go similarity index 100% rename from suites/webdriver.go rename to internal/suites/webdriver.go diff --git a/templates/email.go b/internal/templates/email.go similarity index 100% rename from templates/email.go rename to internal/templates/email.go diff --git a/utils/check.go b/internal/utils/check.go similarity index 100% rename from utils/check.go rename to internal/utils/check.go diff --git a/utils/exec.go b/internal/utils/exec.go similarity index 100% rename from utils/exec.go rename to internal/utils/exec.go diff --git a/utils/files.go b/internal/utils/files.go similarity index 100% rename from utils/files.go rename to internal/utils/files.go diff --git a/suites/Basic/configuration.yml b/suites/Basic/configuration.yml deleted file mode 100644 index 5394b8ce..00000000 --- a/suites/Basic/configuration.yml +++ /dev/null @@ -1,97 +0,0 @@ -############################################################### -# Authelia minimal configuration # -############################################################### - -port: 9091 - -logs_level: debug - -default_redirection_url: https://home.example.com:8080/ - -jwt_secret: very_important_secret - -authentication_backend: - file: - path: users.yml - -session: - secret: unsecure_session_secret - domain: example.com - expiration: 3600 # 1 hour - inactivity: 300 # 5 minutes - -# Configuration of the storage backend used to store data and secrets. i.e. totp data -storage: - local: - path: /tmp/authelia/db.sqlite3 - -# TOTP Issuer Name -# -# This will be the issuer name displayed in Google Authenticator -# See: https://github.com/google/google-authenticator/wiki/Key-Uri-Format for more info on issuer names -totp: - issuer: example.com - -# Access Control -# -# Access control is a set of rules you can use to restrict user access to certain -# resources. -access_control: - # Default policy can either be `bypass`, `one_factor`, `two_factor` or `deny`. - default_policy: deny - - rules: - - domain: singlefactor.example.com - policy: one_factor - - - domain: public.example.com - policy: bypass - - - domain: secure.example.com - policy: two_factor - - - domain: '*.example.com' - subject: "group:admins" - policy: two_factor - - - domain: dev.example.com - resources: - - '^/users/john/.*$' - subject: "user:john" - policy: two_factor - - - domain: dev.example.com - resources: - - '^/users/harry/.*$' - subject: "user:harry" - policy: two_factor - - - domain: '*.mail.example.com' - subject: "user:bob" - policy: two_factor - - - domain: dev.example.com - resources: - - '^/users/bob/.*$' - subject: "user:bob" - policy: two_factor - - -# Configuration of the authentication regulation mechanism. -regulation: - # Set it to 0 to disable max_retries. - max_retries: 3 - - # The user is banned if the authenticaction failed `max_retries` times in a `find_time` seconds window. - find_time: 300 - - # The length of time before a banned user can login again. - ban_time: 900 - -notifier: - # Use a SMTP server for sending notifications - smtp: - host: smtp - port: 1025 - sender: admin@example.com - diff --git a/suites/Traefik/users.yml b/suites/Traefik/users.yml deleted file mode 100644 index 6fe7a384..00000000 --- a/suites/Traefik/users.yml +++ /dev/null @@ -1,29 +0,0 @@ -############################################################### -# Users Database # -############################################################### - -# This file can be used if you do not have an LDAP set up. - -# List of users -users: - john: - password: "{CRYPT}$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/" - email: john.doe@authelia.com - groups: - - admins - - dev - - harry: - password: "{CRYPT}$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/" - email: harry.potter@authelia.com - groups: [] - - bob: - password: "{CRYPT}$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/" - email: bob.dylan@authelia.com - groups: - - dev - - james: - password: "{CRYPT}$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/" - email: james.dean@authelia.com \ No newline at end of file diff --git a/test/suites/BypassAll/test.ts b/test/suites/BypassAll/test.ts index 6f298412..0a8b6e44 100644 --- a/test/suites/BypassAll/test.ts +++ b/test/suites/BypassAll/test.ts @@ -12,7 +12,7 @@ AutheliaSuite(__dirname, function () { this.timeout(10000); beforeEach(async function () { - await exec(`cp ${__dirname}/../../../suites/BypassAll/users.yml /tmp/authelia/suites/BypassAll/users.yml`); + await exec(`cp ${__dirname}/../../../internal/suites/BypassAll/users.yml /tmp/authelia/suites/BypassAll/users.yml`); }); describe('Bypass policy', BypassPolicy); diff --git a/test/suites/DuoPush/test.ts b/test/suites/DuoPush/test.ts index c2c167b5..f7dad04b 100644 --- a/test/suites/DuoPush/test.ts +++ b/test/suites/DuoPush/test.ts @@ -10,7 +10,7 @@ AutheliaSuite(__dirname, function () { this.timeout(10000); beforeEach(async function () { - await exec(`cp ${__dirname}/../../../suites/DuoPush/users.yml /tmp/authelia/suites/DuoPush/users.yml`); + await exec(`cp ${__dirname}/../../../internal/suites/DuoPush/users.yml /tmp/authelia/suites/DuoPush/users.yml`); }); describe("Duo Push Notication", DuoPushNotification); diff --git a/test/suites/NetworkACL/test.ts b/test/suites/NetworkACL/test.ts index 1cba01c0..4547d518 100644 --- a/test/suites/NetworkACL/test.ts +++ b/test/suites/NetworkACL/test.ts @@ -6,7 +6,7 @@ AutheliaSuite(__dirname, function () { this.timeout(10000); beforeEach(async function () { - await exec(`cp ${__dirname}/../../../suites/NetworkACL/users.yml /tmp/authelia/suites/NetworkACL/users.yml`); + await exec(`cp ${__dirname}/../../../internal/suites/NetworkACL/users.yml /tmp/authelia/suites/NetworkACL/users.yml`); }); describe("Network ACLs", NetworkACLs); diff --git a/test/suites/Standalone/scenarii/VerifyEndpoint.ts b/test/suites/Standalone/scenarii/VerifyEndpoint.ts index 1da93b37..6a9ed1f9 100644 --- a/test/suites/Standalone/scenarii/VerifyEndpoint.ts +++ b/test/suites/Standalone/scenarii/VerifyEndpoint.ts @@ -2,15 +2,15 @@ import { GET_Expect401, GET_ExpectRedirect } from "../../../helpers/utils/Reques export default function() { describe('Query without authenticated cookie', function() { - it('should get a 401 on GET to http://192.168.240.1:9091/api/verify', async function() { - await GET_Expect401('http://192.168.240.1:9091/api/verify', { + it('should get a 401 on GET to http://authelia.example.com:9091/api/verify', async function() { + await GET_Expect401('http://authelia.example.com:9091/api/verify', { 'X-Forwarded-Proto': 'https', }); }); describe('Kubernetes nginx ingress controller', async function() { it('should redirect to https://login.example.com:8080', async function() { - await GET_ExpectRedirect('http://192.168.240.1:9091/api/verify?rd=https://login.example.com:8080/%23/', + await GET_ExpectRedirect('http://authelia.example.com:9091/api/verify?rd=https://login.example.com:8080/%23/', 'https://login.example.com:8080/#/?rd=https://secure.example.com:8080/', { 'X-Original-Url': 'https://secure.example.com:8080/', @@ -21,7 +21,7 @@ export default function() { describe('Traefik proxy', async function() { it('should redirect to https://login.example.com:8080', async function() { - await GET_ExpectRedirect('http://192.168.240.1:9091/api/verify?rd=https://login.example.com:8080/%23/', + await GET_ExpectRedirect('http://authelia.example.com:9091/api/verify?rd=https://login.example.com:8080/%23/', 'https://login.example.com:8080/#/?rd=https://secure.example.com:8080/', { 'X-Forwarded-Proto': 'https', diff --git a/test/suites/Standalone/test.ts b/test/suites/Standalone/test.ts index 5ff4f385..056a0786 100644 --- a/test/suites/Standalone/test.ts +++ b/test/suites/Standalone/test.ts @@ -14,7 +14,7 @@ AutheliaSuite("/tmp/authelia/suites/Standalone/", function() { this.timeout(10000); beforeEach(async function() { - await exec(`cp ${__dirname}/../../../suites/Standalone/users.yml /tmp/authelia/suites/Standalone/users.yml`); + await exec(`cp ${__dirname}/../../../internal/suites/Standalone/users.yml /tmp/authelia/suites/Standalone/users.yml`); }); describe('Bypass policy', BypassPolicy)