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: Autocomplete validation #2811

Merged
merged 24 commits into from
Nov 2, 2023
Merged

Fix: Autocomplete validation #2811

merged 24 commits into from
Nov 2, 2023

Conversation

thewahome
Copy link
Collaborator

@thewahome thewahome commented Oct 2, 2023

Overview

Fixes #2688
Fixes #2461

Demo

These functionalities are disabled as long as the validation flags the URL as invalid

  • running a query
  • fetching permissions for a query
  • showing snippets

image

Notes

Walking through the resources ensures that we have a working model for the validator to go through. This guarantees that we are working off a known set of resources .
All queries that do not match a known path created by combining segments in the resource tree are marked as invalid which we can validate with certainity

The ABNF rules in the ODATA ABNF repository are documentation intended for human readers. They are not intended for generating a ready-to-use URL parser..

Testing Instructions

  • Spin up GE
  • Write something crazy on the URL
  • Watch for Permissions / snippets / run query

@thewahome thewahome requested a review from a team as a code owner October 2, 2023 12:54
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@calebkiage
Copy link

calebkiage commented Oct 19, 2023

I don't think it's wise to disable features if validation fails. There will be false positives that might make the application unusable. It is also worth noting that even the metadata isn't accurate at this point.

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

1 similar comment
@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@darrelmiller
Copy link
Contributor

@calebkiage I don't think this is going to be a concern. The vast majority of imprecision in our metadata is due to us missing restrictions not because of incorrect restrictions.

@calebkiage
Copy link

@darrelmiller, my suggestion was to disable the submit button only if:

  • The request is not HTTPS
  • The request is not to a known graph host

Other validations (e.g. unknown path segment) would show a warning and disable permissions and snippets requests but still allow sending the request. The server would return a 404 anyway.

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

ElinorW
ElinorW previously approved these changes Nov 1, 2023
Copy link
Contributor

github-actions bot commented Nov 1, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

Copy link
Contributor

github-actions bot commented Nov 1, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

ElinorW
ElinorW previously approved these changes Nov 2, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-2811.centralus.azurestaticapps.net

@thewahome thewahome merged commit 656e10a into dev Nov 2, 2023
Copy link

sonarqubecloud bot commented Nov 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@thewahome thewahome mentioned this pull request Nov 3, 2023
@thewahome thewahome deleted the fix/autocomplete-validation branch November 6, 2023 14:24
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.

validate graph queries before making calls to devx API Valid URLs marked as potential errors
4 participants