Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Message resolver not resolving messages properly #35

Open
lealceldeiro opened this issue Apr 5, 2020 · 1 comment
Open

Message resolver not resolving messages properly #35

lealceldeiro opened this issue Apr 5, 2020 · 1 comment
Assignees
Labels
bug server Issues related to the backend.

Comments

@lealceldeiro
Copy link
Owner

Describe the bug
The messages associated to their keys are not being resolved properly.

To Reproduce

  1. Make a POST request to the login endpoint with an incorrect credentialas
  2. In the response body see some similar to:
{
    "path": "<login path>",
    "message": "security.bad.credentials",
    "error": "security.unauthorized",
    ....
}

Expected behaviour
To see something like:

{
    "path": "<login path>",
    "message": "Bad credentials",
    "error": "Unauthorized",
    ....
}

Notice here the values for message and error are Bad credentials and Unauthorized, not their i18n keys security.bad.credentials and security.unauthorized

Additional context
Possible classes related in this issue:

  • com.gms.util.i18n.MessageResolver
  • com.gms.config.locale.LocaleConfig
@lealceldeiro lealceldeiro added bug server Issues related to the backend. labels Apr 5, 2020
@lealceldeiro lealceldeiro self-assigned this Apr 5, 2020
@lealceldeiro
Copy link
Owner Author

This will be solved after merging branch fine-tune-server

@lealceldeiro lealceldeiro mentioned this issue Apr 18, 2020
14 tasks
lealceldeiro added a commit that referenced this issue Apr 19, 2020
- Fix config property name

- Trim long comments

- Improve config files format

- Remove incorrect dependency added in JWTAuthenticationFailureHandler to spring-boot-configuration-processor

- Upgrade to SpringBoot 2.2.6.RELEASE and flyway to 6.3.2

- Fix dependency spring-boot-configuration-processor

- Improve some groovy code

- Remove deprecated dependencies

- Add `spring.mvc.hiddenmethod.filter.enabled=false` to application.properties

- Remove un-needed annotations.

- Spellcheck on apidocs.

- Do not run test with spring runner and without spring context when there is no need for them.

- Fix typos and format.

- Fix request language detection and handling: fixes #35 

- Bump class versions.

- Move JWToken service to a more descriptive folder.

- Move JWToken service to a more descriptive folder and create interface to expose services for JWTService.

- Move security config class to dedicated packages and update them to package private and final when possible.

- Set default locale.

- Fallback to CookieLocaleResolver if custom logic doesn't find any match.

- Documents language changing options.

- Disable JSP pages on server.

- Return a response body on unauthorized requests

- Update javadocs.

- Disable basic authentication.

- Tweak some javadocs, variable names and optimize imports.

- Provide `PasswordEncoder` bean instead of `BcryptPassowrdEncoder` directly.

- Decrease column length for storing password.

- Improve SQL readability in flyway migration.

- Improve code format.

- Create constructor in GmsHttpStatusAndBodyEntryPoint using lombok.

- Create GmsAccessDeniedHandler and apply it in SecurityConfig.

- Add Security annotation to ConfigurationController (example to follow for future security mechanism enhancement for business logic).

- Improve code style in gradle file.

- Remove some deprecated usages in gradle file.

- Add explicit empty return on groovy script.

- Remove `serrver.port` from application.properties and update app version prop.

- Update lombok version.

- Update flyway version.

- Update jwt version.

- Update org.reflections version.

- Update com.github.kt3k.coveralls and net.saliman.cobertura versions.

- Update application versions.

- Update spring.dependency-management version.

- Update org.asciidoctor.convert version.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug server Issues related to the backend.
Projects
None yet
Development

No branches or pull requests

1 participant