access scope tweaks#64
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens and centralizes access-scope validation in the Catena device model JSON Schema by introducing a shared ST 2138 scope enum, enforcing uniqueness for the device’s access scope list, and making core access-scope-related fields mandatory at the top level.
Changes:
- Introduces
$defs/access_scopes_enumto share the standard ST 2138 access scope values. - Updates
$defs/access_scopeto allow either a standard enum value or an arbitrary string viaanyOf, and updatesdefault_scopeto use the shared enum. - Enforces
uniqueItems: trueon the device-levelaccess_scopesarray and makesslot,access_scopes, anddefault_scoperequired.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NR-RV
approved these changes
Jul 10, 2026
mejohnnaylor
approved these changes
Jul 11, 2026
mejohnnaylor
left a comment
Collaborator
There was a problem hiding this comment.
looks good. go ahead!
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.
A few tweaks for how access scopes are validated.
$defs/access_scopes_enumto share the 4 st2138 access scopes$def/access_scopechanged toanyOfaccess_scopes_enumorstring(needs to beanyOfand notoneOfbecause strings in the enum also match string, breaking the ONE part ofoneOfdefault_scopealso uses the enum now.uniqueItemsto$defs/access_scopes(the top level list) since there is a comment saying they should be unique, may as well enforce.slot,access_scopeanddefault_scopeall required in the device so these changes cannot be avoided by omitting.Confirmed even with the anyOf the enum still is prompted in an ide:
