Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vue oauth2 keycloak module #10928

Merged
merged 28 commits into from
Sep 24, 2024

Conversation

renanfranca
Copy link
Contributor

@renanfranca renanfranca commented Sep 20, 2024

Fix #1133

image

TO-DO:

  • Add to tests-ci/generate.sh this new module at Vue app

    • Add unit tests
  • Add keycloak-js dependency to common package.json

    • Added "keycloak-js": "25.0.5" to the dependencies in the common package.json file
  • Add tests for the VueOAuth2KeycloakModulesFactory

    • Created VueOAuth2KeycloakModulesFactoryTest.java
    • Implemented tests to verify the correct building of the Vue OAuth2 Keycloak module
    • Checked for proper file creation and content in the generated module
  • Add template files to be used by vue-oauth2-keycloak module

    • Created AuthProvider.ts.mustache
    • Created AuthRepository.ts.mustache
    • Created AuthenticatedUser.ts.mustache
    • Created KeycloakAuthRepository.ts.mustache
    • Created KeycloakHttp.ts.mustache
    • These files provide the core functionality for OAuth2 authentication with Keycloak in a Vue application
  • Remove unused import added to main.ts

    • Removed the unused 'axios' import from the main.ts file in VueOAuth2KeycloakModulesFactory.java
  • Add package-info.java

    • Added package-info.java to the vue.security.oauth2_keycloak package
    • Applied @tech.jhipster.lite.BusinessContext annotation to the package
  • Add vue-oauth2-keycloak module configuration

    • Created VueOAuth2KeycloakApplicationService.java
    • Implemented VueOAuth2KeycloakModuleConfiguration.java
    • Added VUE_OAUTH2_KEYCLOAK to JHLiteModuleSlug enum
  • Add cucumber test to vue-oauth2-keycloak module configuration

    • Created vue-oauth2-keycloak.feature file
    • Implemented scenario to test the application of Vue OAuth2 Keycloak module
  • Fix cucumber test

    • Updated vue-oauth2-keycloak.feature
    • Added 'typescript' module to the list of applied modules in the test scenario
  • Improve VueOAuth2KeycloakModulesFactory code by using constants

    • Refactored VueOAuth2KeycloakModulesFactory.java
    • Introduced constants for repeated string literals
    • Improved code readability and maintainability
  • Use keycloak-js dependency from COMMON package instead of the ANGULAR package

    • Updated AngularOauth2ModuleFactory.java
    • Changed the source of keycloak-js dependency from ANGULAR to COMMON
    • Removed keycloak-js entry from angular/package.json
  • Add vue-authentication-components.md documentation to vue-oauth2-keycloak module

    • Created vue-authentication-components.md
    • Provided detailed documentation on the Vue authentication components
    • Included file structure, detailed file explanations, and usage instructions
  • Fix sonar issues at KeycloakHttp.ts.mustache

    • Updated KeycloakHttp.ts.mustache
    • Replaced || with ?? for null coalescing
    • Improved code quality and addressed potential issues flagged by SonarQube

qmonmert
qmonmert previously approved these changes Sep 21, 2024
@renanfranca
Copy link
Contributor Author

As I mentioned here:

I added the unit tests to ensure this module can be added to the CI pipeline while maintaining the current 100% coverage metric. Once the discussion reaches a consensus, I’ll proceed with refactoring this module accordingly.

I am doing this because I want to conclude this issue before moving on to another one ;)

cc: @DamnClin , @murdos , @pascalgrimaud and @qmonmert

@renanfranca renanfranca merged commit 0775206 into jhipster:main Sep 24, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue: add OAuth2 keycloak authentication
3 participants