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

Deal with jsonschema's automatic remote reference resolving deprecation #5855

Open
aciba90 opened this issue Nov 7, 2024 · 1 comment
Open
Labels
bug Something isn't working correctly

Comments

@aciba90
Copy link
Contributor

aciba90 commented Nov 7, 2024

Bug report

jsonschema will drop support for automatically retrieving remote references in the future.

tests/unittests/config/test_schema.py::TestVersionedSchemas::test_versioned_cloud_config_schema_is_valid_json[schema4-None]
/home/aciba/canonical/server/cloud-init/5175-depre-warnings/cloudinit/config/schema.py:462: DeprecationWarning: Automatically retrieving remote references can be a security vulnerability and is discouraged by the JSON Schema specifications. Relying on this behavior is deprecated and will shortly become an error. If you are sure you want to remotely retrieve your reference and that it is safe to do so, you can find instructions for doing so via referencing.Registry in the referencing documentation (https://referencing.readthedocs.org).
    all_errs = list(

Possible solutions

  1. Directly manipulate python3-referencing to resolve references before passing the schema to jsonchema.
  2. Remove remote references. As the only remote reference is contained in this project, we could directly put schema-cloud-config-v1.json into versions.schema.cloud-config.json removing the indirection and the problem.

Steps to reproduce the problem

Run pytest tests/unittest on Python 3.12+.

Environment details

  • Cloud-init version: main
  • Operating System Distribution: N/A
  • Cloud provider, platform or installer type: N/A

cloud-init logs

N/A

@aciba90 aciba90 added bug Something isn't working correctly new An issue that still needs triage labels Nov 7, 2024
@blackboxsw
Copy link
Collaborator

blackboxsw commented Nov 11, 2024 via email

@aciba90 aciba90 removed the new An issue that still needs triage label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants