Skip to content

access scope tweaks#64

Merged
abrown-RV merged 1 commit into
developfrom
access-scope-tweaks
Jul 13, 2026
Merged

access scope tweaks#64
abrown-RV merged 1 commit into
developfrom
access-scope-tweaks

Conversation

@abrown-RV

@abrown-RV abrown-RV commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

A few tweaks for how access scopes are validated.

  • new $defs/access_scopes_enum to share the 4 st2138 access scopes
  • $def/access_scope changed to anyOf access_scopes_enum or string (needs to be anyOf and not oneOf because strings in the enum also match string, breaking the ONE part of oneOf
  • default_scope also uses the enum now.
  • added uniqueItems to $defs/access_scopes (the top level list) since there is a comment saying they should be unique, may as well enforce.
  • made slot, access_scope and default_scope all 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:
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_enum to share the standard ST 2138 access scope values.
  • Updates $defs/access_scope to allow either a standard enum value or an arbitrary string via anyOf, and updates default_scope to use the shared enum.
  • Enforces uniqueItems: true on the device-level access_scopes array and makes slot, access_scopes, and default_scope required.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread interface/schemata/device.yaml

@mejohnnaylor mejohnnaylor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. go ahead!

@abrown-RV
abrown-RV merged commit d0d87e1 into develop Jul 13, 2026
5 checks passed
@abrown-RV
abrown-RV deleted the access-scope-tweaks branch July 13, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants