This is an automated email from the ASF dual-hosted git repository.
Aman-Mittal pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/fineract-consumer-facing.git
from 01e6676 Merge pull request #14 from
apache/dependabot/github_actions/actions/checkout-6.0.3
add d1562d3 FINERACT-2641: Implement Authentication Feature
add db25256 - added tests for auth/login feature - added more tests for
infrastructure, user features
add acb5be3 - removed duplicated devicefingerprint column from users
table - adjusted registration and users features and cucumber tests to match
new 089ee71 Merge pull request #16 from edk12564/main
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/build-tests-backend.yml | 3 +
.github/workflows/build-tests-frontend.yml | 4 +
consumer/.gitignore | 3 +
consumer/build.gradle | 2 +-
consumer/compose.yaml | 3 +
.../generate-dev-jwt-key.sh} | 59 ++-
.../api/AuthenticationCommandController.java | 134 +++++++
.../command/data/AuthenticationConstants.java} | 11 +-
.../data/EstablishedSessionCommandData.java} | 18 +-
.../command/data/LoginChallengeCommandData.java} | 15 +-
.../command/data/LoginCommand.java} | 11 +-
.../command/data/LoginCommandRequest.java} | 14 +-
.../command/data/LogoutCommand.java} | 8 +-
.../command/data/RefreshSessionCommand.java} | 9 +-
.../command/data/SessionCommandData.java} | 18 +-
.../command/data/VerifyTwoFactorCommand.java} | 8 +-
.../data/VerifyTwoFactorCommandRequest.java} | 10 +-
.../command/domain/RefreshToken.java | 84 +++++
.../exception/InvalidCredentialsException.java} | 10 +-
.../exception/RefreshTokenInvalidException.java} | 10 +-
.../exception/TwoFactorInvalidException.java} | 16 +-
.../repository/RefreshTokenCommandRepository.java} | 11 +-
.../service/AuthenticationCommandService.java | 38 ++
.../service/AuthenticationCommandServiceImpl.java | 228 ++++++++++++
.../consumer/infrastructure/command/Command.java | 3 +-
.../configs/AuthenticationConfig.java} | 12 +-
.../AuthenticationProperties.java} | 15 +-
.../consumer/infrastructure/configs/JwtConfig.java | 132 +++++++
.../JwtProperties.java} | 13 +-
.../configs/PasswordEncoderConfig.java} | 17 +-
.../infrastructure/configs/SecurityConfig.java | 15 +-
.../ConsumerApiError.java => jwt/IssuedJwt.java} | 12 +-
.../jwt/JwtClaims.java} | 11 +-
.../consumer/infrastructure/jwt/JwtIssuer.java | 58 +++
.../consumer/infrastructure/query/Query.java | 3 +-
.../web/ConsumerHeaders.java} | 12 +-
...{OtpDeliveryMethod.java => OtpDestination.java} | 4 +-
.../consumer/otp/command/data/OtpMetadata.java | 2 +-
.../consumer/otp/command/data/PendingOtp.java | 4 +-
...on.java => OtpDestinationInvalidException.java} | 4 +-
.../otp/command/service/OtpCommandService.java | 4 +-
.../otp/command/service/OtpCommandServiceImpl.java | 18 +-
.../command/api/RegistrationCommandController.java | 6 +-
.../command/data/SubmitRegistrationCommand.java | 2 +-
.../data/SubmitRegistrationCommandRequest.java | 7 +
.../service/RegistrationCommandServiceImpl.java | 14 +-
.../user/command/data/CreateUserCommand.java | 4 +-
.../consumer/user/command/domain/User.java | 18 +-
.../consumer/user/command/domain/UserStatus.java | 1 -
.../user/command/service/UserCommandService.java | 2 -
.../command/service/UserCommandServiceImpl.java | 12 +-
...ueryData.java => UserCredentialsQueryData.java} | 6 +-
.../user/query/repository/UserQueryRepository.java | 15 +
.../user/query/service/UserQueryService.java | 6 +
.../user/query/service/UserQueryServiceImpl.java | 15 +
consumer/src/main/resources/application.properties | 12 +
.../changelog/changes/001-create-users-table.yaml | 12 +-
...s-table.yaml => 002-create-refresh-tokens.yaml} | 52 ++-
.../db/changelog/db.changelog-master.yaml | 2 +
.../command/domain/RefreshTokenTest.java | 78 ++++
.../AuthenticationCommandServiceImplTest.java | 409 +++++++++++++++++++++
.../cucumber/clients/AuthenticationClient.java | 98 +++++
.../MailpitClient.java} | 27 +-
.../cucumber/helpers/RegistrationHelper.java | 77 ++++
.../cucumber/hooks/ConsumerDatabaseReset.java | 46 +++
.../consumer/cucumber/steps/LoginSteps.java | 297 +++++++++++++++
.../consumer/cucumber/steps/RegistrationSteps.java | 45 ++-
.../consumer/infrastructure/jwt/JwtIssuerTest.java | 137 +++++++
.../consumer/user/command/domain/UserTest.java | 73 ++++
.../service/UserCommandServiceImplTest.java | 156 ++++++++
.../query/service/UserQueryServiceImplTest.java | 113 ++++++
consumer/src/test/resources/features/login.feature | 65 ++++
.../test/resources/features/registration.feature | 14 +-
73 files changed, 2616 insertions(+), 271 deletions(-)
copy consumer/{.gitignore => scripts/generate-dev-jwt-key.sh} (56%)
mode change 100644 => 100755
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/authentication/command/api/AuthenticationCommandController.java
copy
consumer/src/main/java/org/apache/fineract/consumer/{otp/command/data/OtpConstants.java
=> authentication/command/data/AuthenticationConstants.java} (69%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/SubmitRegistrationCommandData.java
=> authentication/command/data/EstablishedSessionCommandData.java} (71%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/SendOtpCommandData.java
=> authentication/command/data/LoginChallengeCommandData.java} (77%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{user/command/data/CreateUserCommand.java
=> authentication/command/data/LoginCommand.java} (83%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/VerifyOtpCommandRequest.java
=> authentication/command/data/LoginCommandRequest.java} (80%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/VerifyOtpCommand.java
=> authentication/command/data/LogoutCommand.java} (83%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/VerifyOtpCommand.java
=> authentication/command/data/RefreshSessionCommand.java} (83%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/SubmitRegistrationCommandData.java
=> authentication/command/data/SessionCommandData.java} (72%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/VerifyOtpCommand.java
=> authentication/command/data/VerifyTwoFactorCommand.java} (84%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/data/VerifyOtpCommandRequest.java
=> authentication/command/data/VerifyTwoFactorCommandRequest.java} (82%)
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/authentication/command/domain/RefreshToken.java
copy
consumer/src/main/java/org/apache/fineract/consumer/{otp/command/exception/OtpTokenInvalidException.java
=> authentication/command/exception/InvalidCredentialsException.java} (73%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{user/command/exception/InvalidBindingStateException.java
=> authentication/command/exception/RefreshTokenInvalidException.java} (73%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{registration/command/exception/IdentityNotVerifiedException.java
=> authentication/command/exception/TwoFactorInvalidException.java} (64%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{user/command/repository/UserCommandRepository.java
=> authentication/command/repository/RefreshTokenCommandRepository.java} (70%)
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/authentication/command/service/AuthenticationCommandService.java
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/authentication/command/service/AuthenticationCommandServiceImpl.java
copy
consumer/src/main/java/org/apache/fineract/consumer/{user/query/service/UserQueryService.java
=> infrastructure/configs/AuthenticationConfig.java} (71%)
copy
consumer/src/main/java/org/apache/fineract/consumer/infrastructure/{fineractclient/configs/FineractClientProperties.java
=> configs/AuthenticationProperties.java} (73%)
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/infrastructure/configs/JwtConfig.java
copy
consumer/src/main/java/org/apache/fineract/consumer/infrastructure/{fineractclient/configs/FineractClientProperties.java
=> configs/JwtProperties.java} (76%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{otp/command/data/OtpConstants.java
=> infrastructure/configs/PasswordEncoderConfig.java} (61%)
copy
consumer/src/main/java/org/apache/fineract/consumer/infrastructure/{exception/ConsumerApiError.java
=> jwt/IssuedJwt.java} (80%)
copy
consumer/src/main/java/org/apache/fineract/consumer/{otp/command/data/OtpConstants.java
=> infrastructure/jwt/JwtClaims.java} (73%)
create mode 100644
consumer/src/main/java/org/apache/fineract/consumer/infrastructure/jwt/JwtIssuer.java
copy
consumer/src/main/java/org/apache/fineract/consumer/{user/command/domain/UserStatus.java
=> infrastructure/web/ConsumerHeaders.java} (79%)
rename
consumer/src/main/java/org/apache/fineract/consumer/otp/command/data/{OtpDeliveryMethod.java
=> OtpDestination.java} (93%)
rename
consumer/src/main/java/org/apache/fineract/consumer/otp/command/exception/{OtpDeliveryMethodInvalidException.java
=> OtpDestinationInvalidException.java} (89%)
copy
consumer/src/main/java/org/apache/fineract/consumer/user/query/data/{UserQueryData.java
=> UserCredentialsQueryData.java} (90%)
copy
consumer/src/main/resources/db/changelog/changes/{001-create-users-table.yaml
=> 002-create-refresh-tokens.yaml} (72%)
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/authentication/command/domain/RefreshTokenTest.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/authentication/command/service/AuthenticationCommandServiceImplTest.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/cucumber/clients/AuthenticationClient.java
rename
consumer/src/test/java/org/apache/fineract/consumer/cucumber/{helpers/MailpitProbe.java
=> clients/MailpitClient.java} (81%)
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/cucumber/helpers/RegistrationHelper.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/cucumber/hooks/ConsumerDatabaseReset.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/cucumber/steps/LoginSteps.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/infrastructure/jwt/JwtIssuerTest.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/user/command/domain/UserTest.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/user/command/service/UserCommandServiceImplTest.java
create mode 100644
consumer/src/test/java/org/apache/fineract/consumer/user/query/service/UserQueryServiceImplTest.java
create mode 100644 consumer/src/test/resources/features/login.feature