Auth infrastructure layer#183
Merged
scraft-official merged 3 commits intorelease/2.25from Jan 1, 2026
Merged
Conversation
Added AuthEntity, repository, mapper, and converters to support persistence of Auth domain objects. Refactored domain and infrastructure layers to integrate new infrastructure entity, including method serialization and mapping. Updated related classes to use BaseInfrastructureEntity. Enhanced Auth domain model with account ownership checks and method accessors.
Added Lombok's @tostring annotation to various entity and meta classes for better logging and debugging. Refactored password validation logic in PasswordAuthMethod to use constants and regex patterns for improved maintainability and clarity.
Replaces String regex matches with precompiled Pattern objects for password validation, improving performance and readability. Also adds @nonnull annotations to relevant method parameters and removes unnecessary password trimming.
NikodemCyrzan
approved these changes
Dec 31, 2025
scraft-official
added a commit
that referenced
this pull request
Jan 4, 2026
* Implement infrastructure for Auth entity persistence Added AuthEntity, repository, mapper, and converters to support persistence of Auth domain objects. Refactored domain and infrastructure layers to integrate new infrastructure entity, including method serialization and mapping. Updated related classes to use BaseInfrastructureEntity. Enhanced Auth domain model with account ownership checks and method accessors. * Add @tostring to entities and improve password validation Added Lombok's @tostring annotation to various entity and meta classes for better logging and debugging. Refactored password validation logic in PasswordAuthMethod to use constants and regex patterns for improved maintainability and clarity. * Refactor password validation to use regex Patterns Replaces String regex matches with precompiled Pattern objects for password validation, improving performance and readability. Also adds @nonnull annotations to relevant method parameters and removes unnecessary password trimming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive infrastructure layer for persisting authentication (
Auth) entities, including JPA entity definitions, mapping logic, and repository implementations. It also improves password validation and serialization logic in the domain layer. The most important changes are as follows:Infrastructure Layer for Auth Entities:
AuthEntityJPA entity, its metadata class, and a repository interface (AuthEntityRepository) for database operations, enabling persistence and retrieval of authentication methods and metadata. [1] [2] [3]AuthEntityMapperusing MapStruct to convert between domain (Auth) and infrastructure (AuthEntity) representations, including custom mapping for authentication methods.AuthMethodSerializedModelConverter) for serializing and deserializing authentication method data to JSON in the database.Repository Implementation:
AuthRepositoryImplwith a full implementation that uses the new infrastructure repository and mapping layer for all CRUD operations, including account and type-based queries.Domain Layer Improvements:
Authclass to implement a newDomainEntityinterface, added ownership checks, and improved encapsulation and null-safety. [1] [2] [3]PasswordAuthMethodby using compiled regex patterns, extracting constants, and enforcing stricter checks for spaces and required character types. (F4dee2cfL4R4, [1] [2] [3]Serialization Enhancements:
AuthMethodSerializerto support string serialization with error handling.Minor Improvements:
@ToStringannotations and minor code cleanups for better debugging and consistency in entity classes. [1] [2] [3] [4]These changes lay the groundwork for robust authentication persistence and provide a foundation for future enhancements in the authentication domain.