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

Audit fails with $ref that points to another file and contains ~1 #54

Closed
stevenj opened this issue Apr 14, 2020 · 7 comments
Closed

Audit fails with $ref that points to another file and contains ~1 #54

stevenj opened this issue Apr 14, 2020 · 7 comments

Comments

@stevenj
Copy link

stevenj commented Apr 14, 2020

I am getting the error

Unexpected error when trying to audit API: Error: Unable to locate node: #/paths/~1auth~1newcustomer/post/url

Trying to audit my file.

The path element in question is:

paths:
  /v1/auth/newcustomer: # Causes a new customer email to be sent
    $ref: "v1/auth/newcustomer.yml#/paths/~1auth~1newcustomer"

Which is a valid reference.

@ak1394
Copy link
Collaborator

ak1394 commented Apr 20, 2020

Could you provide sample of your OpenAPI file?

@stevenj
Copy link
Author

stevenj commented Apr 20, 2020

Where would you like me to send it? I can not post it online.

@ak1394
Copy link
Collaborator

ak1394 commented Apr 21, 2020

Could you post it to [email protected] ? I tried to reproduce the issue using the paths with ~1s but it worked for me. Perhaps the problem is more specific to your OAS, so it would be very helpful to have it.

@stevenj
Copy link
Author

stevenj commented Apr 21, 2020

Sent as requested

@ak1394
Copy link
Collaborator

ak1394 commented Apr 21, 2020

Thanks for sharing the sample! I see the issue occurring now. I'll let you know once I have ETA for a fix.

@ak1394
Copy link
Collaborator

ak1394 commented Apr 23, 2020

I have fixed issue in the VS Code extension, which was causing "Unable to locate node" errors.

However, unfortunately for your OAS file the audit functionality is still unusable.

The issue is that in a few places you're referring to some individual properties of your 'Custom' schema, for example:
#/components/schemas/inc-components.oas3.yml-Custom/properties/mac while the audit code on our side expects more typical use of schemas located in /components/schemas where the entire schema is referred.

This is something for us to fix, but for now audit functionality effectively can't be used with your API.

@stevenj
Copy link
Author

stevenj commented Apr 24, 2020

Yes, i have since refactored my openapi files to remove those. It was unnecessary. Thank you, i am now able to perform security audit.

@stevenj stevenj closed this as completed Apr 24, 2020
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

No branches or pull requests

2 participants