Conversation
Contributor
Author
|
This requires a change to the json-schema to match oasis-open/cti-stix2-json-schemas#169 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #243 +/- ##
==========================================
+ Coverage 94.36% 94.82% +0.45%
==========================================
Files 66 69 +3
Lines 6211 6622 +411
==========================================
+ Hits 5861 6279 +418
+ Misses 350 343 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Issue #180 is rather lacking in detail, but it turns out that STIX 2.1 CS02 requires ISO639-2 language tags for the software object's languages property, while STIX 2.1 CS03 requires RFC 5646 language tags. See https://docs.oasis-open.org/cti/stix/v2.1/cs03/stix-v2.1-cs03.html#_jru33yeokrmh
The stix-validator currently requires ISO639-2 language tags in adherence to CS02, but should really check for RFC 5646. Since some people have probably already been working with the ISO language tags, I didn't want to make those suddenly fail, so they issue a warning rather than an error. In the future, this should switch to an error.
I have been playing around with Claude Code, so I tried it on this issue. Here is Claude's PR description to go along with the fix:
Summary of Changes Made for Issue #180
Issue Fixed: Software language validation in STIX 2.1 now uses RFC 5646 language codes instead of ISO 639-2
codes, as required by the STIX 2.1 CS03 specification.
Key Changes:
- Changed primary validation from SOFTWARE_LANG_CODES (ISO 639-2) to LANG_CODES (RFC 5646)
- Added backward compatibility for ISO 639-2 codes with deprecation warnings
- Updated error messages to reference RFC 5646 standard
- ISO 639-2 codes (like 'eng', 'fra') are still accepted but generate warning messages
- RFC 5646 codes (like 'en', 'en-US', 'fr-FR') are preferred and don't generate warnings
- Invalid codes that don't match either standard still generate validation errors
- Modified existing test to use RFC 5646 code ('en' instead of 'eng')
- Added new test for backward compatibility warnings
- Test validates that ISO 639-2 codes generate appropriate warning messages
- Updated description to reflect RFC 5646 standard with backward compatibility note
Technical Implementation:
Examples:
This implementation ensures compliance with STIX 2.1 CS03 requirements while maintaining backward compatibility
for existing implementations using ISO 639-2 codes.