Add support for new registry/org and registry/user endpoints#117
Open
jgamblin wants to merge 2 commits intoRedHatProductSecurity:masterfrom
Open
Add support for new registry/org and registry/user endpoints#117jgamblin wants to merge 2 commits intoRedHatProductSecurity:masterfrom
jgamblin wants to merge 2 commits intoRedHatProductSecurity:masterfrom
Conversation
- Download and integrate CVE Schema 5.2.0 bundled schema file - Extract container-specific schemas for ADP, CNA published, and CNA rejected - Update README compatibility statement to note 5.2.0 support - All existing tests pass with new schema
- Add use_legacy_endpoints parameter to CveApi class - Implement helper methods (_org_path, _user_path) to build correct endpoint paths - Update quota(), show_user(), reset_api_key(), create_user(), update_user(), list_users(), and show_org() methods to use new registry endpoints by default - Maintain full backward compatibility with legacy org/user endpoints via --legacy flag - Add --legacy flag to CLI for easy switching to legacy endpoints - Add 12 comprehensive tests covering both registry and legacy endpoint modes - All 49 tests pass successfully
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements support for the new CVE Services User Registry endpoints (
/registry/org/and/registry/user/) while maintaining full backward compatibility with the legacy endpoints (/org/and/user/).Changes
API Implementation
use_legacy_endpointsparameter toCveApi.__init__()to control endpoint selection_org_path()- Builds organization endpoint paths (registry or legacy)_user_path()- Builds user endpoint paths (registry or legacy)quota()show_user()reset_api_key()create_user()update_user()list_users()show_org()CLI Support
--legacyflag to CLI for easy switching to legacy endpointsConfigclass to handle the legacy flag and pass it toCveApiBackward Compatibility
--legacyflagTesting
TestRegistryEndpointsclass with 12 comprehensive testsUsage
Using new registry endpoints (default):
Using legacy endpoints:
Programmatic usage:
Resolves
Closes #112 - Add new registry/user and registry/org CVE Services endpoints