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

Feature/esckan-35 - KnowledgeStatement endpoint fixes #265

Merged
merged 6 commits into from
Apr 18, 2024

Conversation

D-GopalKrishna
Copy link
Contributor

@D-GopalKrishna D-GopalKrishna commented Apr 17, 2024

jira Link - update on -> https://metacell.atlassian.net/browse/ESCKAN-35

  • add reference_uri to KnowledgeStatement endpoint response
  • Corrected the serializer to_representation for KS-serializer - super(ConnectivityStatementSerializer, self).to_representation(instance)
  • Added CORS to /api/composer/knowledge-statement/ using django-cors-header's signals.

Copy link
Member

@ddelpiano ddelpiano left a comment

Choose a reason for hiding this comment

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

forward connections it's one of the information we need, please re-include it. Thanks :)

@afonsobspinto
Copy link
Member

afonsobspinto commented Apr 18, 2024

question: Should we allow this endpoint to be accessible from any origin (enable CORS)?

Specifically, will Explorer be able to make requests directly to this endpoint or will it need a proxy?

@D-GopalKrishna D-GopalKrishna marked this pull request as draft April 18, 2024 04:56
@D-GopalKrishna
Copy link
Contributor Author

D-GopalKrishna commented Apr 18, 2024

question: Should we allow this endpoint to be accessible from any origin (enable CORS)?

Specifically, will Explorer be able to make requests directly to this endpoint or will it need a proxy?

Indeed @afonsobspinto! We do need to allow CORS. thanks!

@zsinnema
Copy link
Contributor

@afonsobspinto imo we don't need cors

@D-GopalKrishna D-GopalKrishna changed the title Feature/esckan-35 - add reference_uri to KnowledgeStatement endpoint response Feature/esckan-35 - KnowledgeStatement endpoint fixes Apr 18, 2024
@D-GopalKrishna
Copy link
Contributor Author

Edited the title and description of the PR to include the full scope of the fix for KS endpoint.

@D-GopalKrishna
Copy link
Contributor Author

About CORS from the docs. - https://github.com/adamchainz/django-cors-headers?tab=readme-ov-file#signals

image


In our case, we don't use CORS_ALLOWED_ORIGINS. We simply use from corsheaders.signals import check_request_enabled to enable the path for /api/composer/knowledge-statement/.

cc @zsinnema @afonsobspinto

@D-GopalKrishna D-GopalKrishna marked this pull request as ready for review April 18, 2024 09:51
@zsinnema zsinnema merged commit e383ebe into develop Apr 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants