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

fix(rest): url decoding. #2385

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

rudra-superrr
Copy link
Contributor

@rudra-superrr rudra-superrr commented Mar 28, 2024

Issue: closes #2330

Description: decoding the query parameters for rest endpoints.

How to test:

  • send the query parameters in encoded format for rest endpoints.

Test endpoints like:

  • search components/projects/releases by name
  • search components/projects/releases by externalIds
  • search projects by tag

Screenshots:
image

image

@rudra-superrr rudra-superrr changed the title fix(component): searching url encoded component by name. fix(rest): searching url encoded component by name. Mar 28, 2024
@rudra-superrr rudra-superrr added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Mar 28, 2024
@afsahsyeda
Copy link
Contributor

@akshitjoshii please perform the test.

@rudra-superrr rudra-superrr added the WIP work in progress label Apr 1, 2024
@rudra-superrr rudra-superrr changed the title fix(rest): searching url encoded component by name. fix(rest): url encoding. Apr 2, 2024
@rudra-superrr rudra-superrr changed the title fix(rest): url encoding. fix(rest): url decoding. Apr 2, 2024
@rudra-superrr rudra-superrr removed the WIP work in progress label Apr 3, 2024
@akshitjoshii
Copy link
Contributor

Testing successful for the following endpoints :

  • search components/projects/releases by name
  • search components/projects/releases by externalIds
  • search projects by tag
    comp_name

@akshitjoshii
Copy link
Contributor

An endpoint where url encoding can be added is search packages by name.
image

@rudra-superrr
Copy link
Contributor Author

An endpoint where url encoding can be added is search packages by name. image

Made the changes. Added url decoding for this endpoint too.

@Sekagra
Copy link

Sekagra commented Apr 8, 2024

Note from a SW360 API user:
Please consider using a built-in functionality from Spring like UriComponentBuilder.fromUriString instead of the manual parsing implemented in your RestControllerHelper.parseQueryString() method.

Signed-off-by: Rudra Chopra <prabhuchopra@gmail.com>
@rudra-superrr
Copy link
Contributor Author

Note from a SW360 API user: Please consider using a built-in functionality from Spring like UriComponentBuilder.fromUriString instead of the manual parsing implemented in your RestControllerHelper.parseQueryString() method.

Thanks for the suggestion.

Copy link
Contributor

@heliocastro heliocastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please accept the suggestion on the thread and use a well formed Url parsing library instead of own solutions

@rudra-superrr
Copy link
Contributor Author

Please accept the suggestion on the thread and use a well formed Url parsing library instead of own solutions

Hi @heliocastro , already implemented the suggestion in the code.

Copy link
Contributor

@heliocastro heliocastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Good to Go

@heliocastro
Copy link
Contributor

Please accept the suggestion on the thread and use a well formed Url parsing library instead of own solutions

Hi @heliocastro , already implemented the suggestion in the code.

Maybe we should have this as a suggestion in the developer documentations, like a FAQ on what to use in such cases.
@Sekagra Can you create a discussion over Improve Developer Guidelines for SW360 ?

@akshitjoshii
Copy link
Contributor

akshitjoshii commented Apr 11, 2024

testing was successful.
new_test

@rudra-superrr rudra-superrr removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Apr 12, 2024
@ag4ums ag4ums added REST New-UI Level for the API and UI level changes for the new-ui and removed needs code review New-UI Level for the API and UI level changes for the new-ui labels Apr 22, 2024
@ag4ums ag4ums merged commit 3063535 into eclipse-sw360:main Apr 22, 2024
2 checks passed
@GMishx GMishx deleted the fix/urlEncoding branch September 24, 2024 08:51
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.

Url Encoded Component names are not searchable
6 participants