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

API changes to allow for public user. #1890

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

nsafwan
Copy link

@nsafwan nsafwan commented Jul 29, 2024

Description

Allows users without an authentication token to access the raw data API. Migrating the dw_descripter to the Rest stack through the route /rest/v1/warehouse/search/dw_descripter. Added new test cases for the new dw_descripter endpoint and modifying the test for the raw data endpoint to now pass for requests with empty token in accordance to the modifications.

Two new exception classes were added for token authentication:

  • classes/Rest/Exceptions/BadTokenException.php
  • classes/Rest/Exceptions/EmptyTokenException.php

Motivation and Context

Since the raw data endpoint is used for the data catalog, this would allow for public/non logged in users to view the entries available to them without a token. Migrating the dw_descripter endpoint allows for this same behavior and places it in the same place as the rest of the API functionality. Adding the new exception classes separates UnauthorizedHttpException for more nuanced behavior depending on empty or invalid token.

Tests performed

Automated tests. Modified tests to test for the changed functionality and added new test for the migrated endpoint.

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@eiffel777 eiffel777 added enhancement Enhancement of the functionality of an existing feature Category:General General labels Jul 29, 2024
@eiffel777 eiffel777 added this to the 11.5.0 milestone Jul 29, 2024
Copy link
Contributor

@ryanrath ryanrath left a comment

Choose a reason for hiding this comment

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

Just a few

Copy link
Author

@nsafwan nsafwan left a comment

Choose a reason for hiding this comment

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

Missing 'r' and snake_case for want_public_user have been fixed. And yes, that check is failing because of pulled code from get_dw_descripter.php.

@nsafwan nsafwan requested a review from ryanrath July 29, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:General General enhancement Enhancement of the functionality of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants