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(OntologiesRouteV2): Reject internal ontology names in external schema (DSP-1394) #1827

Merged
merged 4 commits into from Mar 11, 2021

Conversation

benjamingeer
Copy link

resolves DSP-1394

@benjamingeer benjamingeer added bug something isn't working API/V2 labels Mar 3, 2021
@benjamingeer benjamingeer self-assigned this Mar 3, 2021
*/
def checkExternalOntologyName(iri: SmartIri): Unit = {
if (iri.isKnoraApiV2DefinitionIri && OntologyConstants.InternalOntologyLabels.contains(iri.getOntologyName)) {
throw BadRequestException(s"Invalid IRI: <$iri>")
Copy link
Contributor

Choose a reason for hiding this comment

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

@benjamingeer don't you think it might be better to throw a more clear exception message indicating that internal ontologies cannot be served?

Copy link
Author

Choose a reason for hiding this comment

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

Done: 05a7ba1

Copy link
Contributor

@SepidehAlassi SepidehAlassi left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@benjamingeer benjamingeer merged commit e392bf1 into main Mar 11, 2021
@benjamingeer benjamingeer deleted the fix/DSP-1394-ontologies branch March 11, 2021 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API/V2 bug something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants