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

annotations: allow URL pointer to JSON schema #4478

Closed
anderseknert opened this issue Mar 24, 2022 · 5 comments
Closed

annotations: allow URL pointer to JSON schema #4478

anderseknert opened this issue Mar 24, 2022 · 5 comments

Comments

@anderseknert
Copy link
Member

Annotations may currently point to a JSON schema on disk, and requires this location to be provided by the tool, e.g. opa eval. It would be very handy if we as an alternative to this allowed a schema to be retrieved from an URL pointed out in the annotation.

# METADATA
# schemas:
#   - input: https://json.schemastore.org/github-action.json
package github.actions

Some thoughts:

  • Should this be enabled by default or require a flag? I'm leaning towards the former, with capabilites extended to disable it.
  • Caching? The opa eval development cycle can be quite intensive, and you wouldn't want to have the same schema fetched again and again. Additionally, while I doubt this will DDOS any service provider, it would be courteous to not hammer them with requests.
@anderseknert
Copy link
Member Author

@aavarghese @vazirim thoughts on this? 😃

@stale
Copy link

stale bot commented Apr 27, 2022

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Apr 27, 2022
@aavarghese
Copy link
Contributor

@anderseknert missed responding to this earlier but this does seem very useful and practical - not all schemas especially Kubernetes related need to be loaded on disk. So +1 for this feature!

@stale stale bot removed the inactive label Apr 27, 2022
@stale
Copy link

stale bot commented May 27, 2022

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@anderseknert
Copy link
Member Author

So, this is actually possible already, using the undocumented inline format.

# METADATA
# schemas:
# - input: {"$ref": "http://localhost:8000/schema.json"}

As this is about to be both documented, and properly supported ( see #5689 ) I think we're good to close this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants