Skip to content

Conversation

@ivanauth
Copy link

@ivanauth ivanauth commented Dec 19, 2025

Summary

  • Enable underscore prefix (_) for definition, relation, and permission identifiers
  • Updates regex patterns across all API protos to match authzed/spicedb#2733

Description

This PR updates the validation regex patterns to allow identifiers to begin with an underscore. This establishes a convention for marking identifiers as "private" or "internal".

Use cases:

  • Synthetic permissions: Permissions that exist only to compose other permissions
  • Internal relations: Relations not meant to be directly referenced by application code
  • Implementation details: Parts of your schema that may change without affecting the public API

Example Usage

definition document {
    relation viewer: user
    relation _internal_viewer: user
    
    // Private synthetic permission
    permission _can_view = viewer + _internal_viewer
    
    // Public permission
    permission view = _can_view
}

Changes

  • Updated regex patterns in core.proto to allow underscore-prefixed identifiers
  • Updated regex patterns in permission_service.proto
  • Updated regex patterns in experimental_service.proto
  • Updated regex patterns in watch_service.proto

Related

…n identifiers

Updates regex patterns across all API protos to allow identifiers to
begin with an underscore (`_`). This enables a convention for marking
identifiers as "private" or "internal".

Use cases:
- **Synthetic permissions**: Permissions that exist only to compose other permissions
- **Internal relations**: Relations not meant to be directly referenced by application code
- **Implementation details**: Parts of your schema that may change without affecting the public API

Example:
```zed
definition document {
    relation viewer: user
    relation _internal_viewer: user

    // Private synthetic permission
    permission _can_view = viewer + _internal_viewer

    // Public permission
    permission view = _can_view
}
```

Companion PR to authzed/spicedb#2733

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Establish a convention for public/private

1 participant