summaryrefslogtreecommitdiff
path: root/internal/authentication/file_user_provider.go
AgeCommit message (Collapse)Author
2025-03-09feat(embed): make authelia embedable (#8841)James Elliott
This adds a highly experimental option for developers looking to embed Authelia within another go binary. Closes #5803 Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2025-03-06feat(web): change password (#7676)Brynn Crowley
Add the ability for users to change their password from their user settings, without requiring them to use the reset password workflow. User's are required to create a elevated session in order to change their password. Users may not change their password to their current password. The user's current password is required for the password change. Users must follow any established password policies. Administrators are able to turn this feature off. Closes #3548
2025-02-23feat(authentication): ldap connection pooling (#7217)James Elliott
This implements optional LDAP connection pooling to optimize the speed of LDAP transactions. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2025-02-22feat(authentication): additional and custom attributes (#8078)James Elliott
This facilitates adding additional attributes to the Authelia authentication backends as well as custom attributes based on the Common Expression Language. This will be utilized in the future to facilitate additional features. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-09-20refactor: linting (#7863)James Elliott
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-09-03docs: jsonschema (#5493)James Elliott
Adds a JSON Schema for the configuration, user database, and most exports. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-05-25test(authentication): add missing tests (#5482)James Elliott
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-05-24test(authentication): file provider (#5473)James Elliott
Add additional tests to the file provider. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2022-12-05build(deps): update module github.com/go-crypt/crypt to v0.2.2 (#4452)James Elliott
2022-10-18feat(authentication): file case-insensitive and email search (#4194)James Elliott
This allows both case-insensitive and email searching for the file auth provider. Closes #3383
2022-10-17feat(authentication): file provider hot reload (#4188)James Elliott
This adds hot reloading to the file auth provider.
2022-10-17feat(authentication): file password algorithms (#3848)James Elliott
This adds significant enhancements to the file auth provider including multiple additional algorithms.
2022-04-09feat(commands): user opaque identifiers commands (#3144)James Elliott
Add commands for handling user opaque identifiers.
2022-01-31refactor: apply godot recommendations (#2839)James Elliott
2021-12-02refactor: remove ioutil (#2635)James Elliott
Was deprecated in 1.16 and has more performant options available.
2021-11-23feat(storage): primary key for all tables and general qol refactoring (#2431)James Elliott
This is a massive overhaul to the SQL Storage for Authelia. It facilitates a whole heap of utility commands to help manage the database, primary keys, ensures all database requests use a context for cancellations, and paves the way for a few other PR's which improve the database. Fixes #1337
2021-09-17refactor: factorize startup checks (#2386)James Elliott
* refactor: factorize startup checks * refactor: address linting issues
2021-08-11fix: include major in go.mod module directive (#2278)James Elliott
* build: include major in go.mod module directive * fix: xflags * revert: cobra changes * fix: mock doc
2021-02-22feat: go:embed static assets (#1733)Amir Zarrinkafsh
* feat: go:embed static assets Go 1.16 introduced the ability to embed files within a generated binary directly with the go tool chain. This simplifies our dependencies and the significantly improves the development workflow for future developers. Key points to note: Due to the inability to embed files that do not reside within the local package we need to duplicate our `config.template.yml` within `internal/configuration`. To avoid issues with the development workflow empty mock files have been included within `internal/server/public_html`. These are substituted with the respective generated files during the CI/CD and build workflows. * fix(suites): increase ldap suite test timeout * fix(server): fix swagger asset CSP
2021-01-17[MISC] Add missing CLI suite test (#1607)Amir Zarrinkafsh
* [MISC] Add missing CLI suite test * Add missing test for `authelia version` command in CLI suite. * Standardise logger calls and swap CSP switch order
2020-12-03[FEATURE] LDAP StartTLS (#1500)James Elliott
* add start_tls config option * add StartTLS method to the LDAP conn factory and the mock * implemented use of the StartTLS method when the config is set to true * add mock unit tests * add docs * add TLS min version support * add tests to tls version method * fix lint issues * minor adjustments * remove SSL3.0 * add tls consts * deprecate old filter placeholders * remove redundant fake hashing in file auth provider (to delay username enumeration, was replaced by #993 * make suite ActiveDirectory use StartTLS * misc adjustments to docs * suggested changes from code review * deprecation notice conformity * add mock test for LDAPS plus StartTLS
2020-06-19[FEATURE] Add configurable display name to frontend (#1124)Amir Zarrinkafsh
* [FEATURE] Add configurable display name to frontend This feature allows users with a LDAP backend to specify an attribute (default is "displayname") to retrieve a users name for the portal greeting. Similarly for the file based backend a new required key "name" has been introduced. This can also be used down the line with OIDC as a separate scope. * Update references from Name to DisplayName * Update compose bundles to include displayname refs * Update LDAP automatic profile refresh * Ensure display name is updated * Fix bug which prevented trace logging for profile refresh to not trigger
2020-06-17[FEATURE] Docker simplification and configuration generation (#1113)Amir Zarrinkafsh
* [FEATURE] Docker simplification and configuration generation The Authelia binary now will attempt to generate configuration based on the latest template assuming that the config location specified on startup does not exist. If a file based backend is selected and the backend cannot be found similarly it will generate a `user_database.yml` based a template. This will allow more seamless bootstrapping of an environment no matter the deployment method. We have also squashed the Docker volume requirement down to just `/config` thus removing the requirement for `/var/lib/authelia` this is primarily in attempts to simplify the Docker deployment. Users with the old volume mappings have two options: 1. Change their mappings to conform to `/config` 2. Change the container entrypoint from `authelia --config /config/configuration.yml` to their old mapping * Adjust paths relative to `/etc/authelia` and simplify to single volume for compose * Add generation for file backend based user database * Refactor Docker volumes and paths to /config * Refactor Docker WORKDIR to /app * Fix integration tests * Update BREAKING.md for v4.20.0 * Run go mod tidy * Fix log_file_path in miscellaneous.md docs * Generate config and userdb with 0600 permissions * Fix log_file_path in config.template.yml
2020-05-08[MISC] Refactor Authentication (#987)James Elliott
* only do salt validation in validate salt * fix tests * remove panic(err.Error()) * use file mode const * do hash cleanup on file read instead of check password * design ConfigAlgoToCryptoAlgo and implement it * split HashPassword func into functional chunks that could theoretically be reused
2020-05-06[CI] Add gocritic linter (#977)Amir Zarrinkafsh
* [CI] Add gocritic linter * Implement gocritic recommendations The outstanding recommendations are due to be addressed in #959 and #971 respectively. * Fix implementation tests * Fix remaining linting issues. * Fix tests. Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-05[CI] Add wsl linter (#980)Amir Zarrinkafsh
* [CI] Add wsl linter * Implement wsl recommendations Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-05[CI] Enable gosec linter (#979)James Elliott
* fix tee append * convert DB table names from var to const * fixed file modes * ignored gosec where relevant and safe
2020-05-03[MISC] Introduce CryptAlgo type. (#960)Clément Michaud
* [MISC] Introduce CryptAlgo type. It helps distinguish between the configuration representation of an algorithm and the crypt representation (6 and argon2id vs sha512 vs argon2id). * Add a description to CryptAlgo. * use const Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2020-05-02[CI] Add goconst linter (#961)Amir Zarrinkafsh
* [CI] Add goconst linter * Implement goconst recommendations * Rename defaultPolicy to denyPolicy * Change order for test constants Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-02[HOTFIX] Prevent Username Enumeration (#950)James Elliott
* [HOTFIX] Prevent Username Enumeration * thanks to TheHllm for identifying the bug: https://github.com/TheHllm * temporarily prevents username enumeration with file auth * proper calculated and very slightly random fix to come * closely replicate behaviour * allow error to bubble up * Synchronize security documentation. Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
2020-04-11[BUGFIX] Password hashing schema map mismatch with docs (#852)James Elliott
* add a nolint for gosec 'possibly hardcoded password' that was incorrect * make all parameters consistent * update the docs for the correct key name 'password' instead of 'password_options' or 'password_hashing' * reword some of the docs * apply suggestions from code review Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-05[MISC] Update durations to notation format and housekeeping (#824)James Elliott
* added regulation validator * made regulations find_time and ban_time values duration notation strings * added DefaultRegulationConfiguration for the validator * made session expiration and inactivity values duration notation strings * TOTP period does not need to be converted because adjustment should be discouraged * moved TOTP defaults to DefaultTOTPConfiguration and removed the consts * arranged the root config validator in configuration file order * adjusted tests for the changes * moved duration notation docs to root of configuration * added references to duration notation where applicable * project wide gofmt and goimports: * run gofmt * run goimports -local github.com/authelia/authelia -w on all files * Make jwt_secret error uniform and add tests * now at 100% coverage for internal/configuration/validator/configuration.go
2020-03-15[BUGFIX] [BREAKING] Set username retrieved from authentication backend in ↵Clément Michaud
session. (#687) * [BUGFIX] Set username retrieved from authentication backend in session. In some setups, binding is case insensitive but Authelia is case sensitive and therefore need the actual username as stored in the authentication backend in order for Authelia to work correctly. Fixes #561. * Use uid attribute as unique user identifier in suites. * Fix the integration tests. * Update config.template.yml * Compute user filter based on username attribute and users_filter. The filter provided in users_filter is now combined with a filter based on the username attribute to perform the LDAP search query finding a user object from the username. * Fix LDAP based integration tests. * Update `users_filter` reference examples
2020-03-06[FEATURE] Support Argon2id password hasing and improved entropy (#679)James Elliott
* [FEATURE] Support Argon2id Passwords - Updated go module github.com/simia-tech/crypt - Added Argon2id support for file based authentication backend - Made it the default method - Made it so backwards compatibility with SHA512 exists - Force seeding of the random string generator used for salts to ensure they are all different - Added command params to the authelia hash-password command - Automatically remove {CRYPT} from hashes as they are updated - Automatically change hashes when they are updated to the configured algorithm - Made the hashing algorithm parameters completely configurable - Added reasonably comprehensive test suites - Updated docs - Updated config template * Adjust error output * Fix unit test * Add unit tests and argon2 version check * Fix new unit tests * Update docs, added tests * Implement configurable values and more comprehensive testing * Added cmd params to hash_password, updated docs, misc fixes * More detailed error for cmd, fixed a typo * Fixed cmd flag error, minor refactoring * Requested Changes and Minor refactoring * Increase entropy * Update docs for entropy changes * Refactor to reduce nesting and easier code maintenance * Cleanup Errors (uniformity for the function call) * Check salt length, fix docs * Add Base64 string validation for argon2id * Cleanup and Finalization - Moved RandomString function from ./internal/authentication/password_hash.go to ./internal/utils/strings.go - Added SplitStringToArrayOfStrings func that splits strings into an array with a fixed max string len - Fixed an error in validator that would allow a zero salt length - Added a test to verify the upstream crypt module supports our defined random salt chars - Updated docs - Removed unused "HashingAlgorithm" string type * Update crypt go mod, support argon2id key length and major refactor * Config Template Update, Final Tests * Use schema defaults for hash-password cmd * Iterations check * Docs requested changes * Test Coverage, suggested edits * Wording edit * Doc changes * Default sanity changes * Default sanity changes - docs * CI Sanity changes * Memory in MB
2019-12-28Add early checks for user hashes.Clement Michaud
2019-12-28Improve logs of password hashing to help troubleshoot issues.Clement Michaud
2019-11-17Move source code into internal directory to follow standard project layout.Clement Michaud
https://github.com/golang-standards/project-layout