Skip to content

docs: describe the format of object and user identifiers - #1423

Open
NopeCharon wants to merge 1 commit into
openfga:docs-nextfrom
NopeCharon:docs/object-user-identifier-format
Open

NopeCharon wants to merge 1 commit into
openfga:docs-nextfrom
NopeCharon:docs/object-user-identifier-format

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

Description

What problem is being solved?

The Concepts page shows example objects and users but never says which characters an identifier may contain or how long it can be. Users find out by trial and error that :, # and * are rejected, as reported in the issue.

How is it being solved?

The "Examples and details" accordions for object and user now list the format and the restrictions the API enforces today.

What changes are made to solve it?

  • docs-site/concepts.mdx:
    • Object: written as <type>:<id>. The id can't be empty, can't contain :, # or whitespace, and can't be * (reserved for type bound public access). The whole object is at most 256 characters long.
    • User: written as <type>:<id> or <type>:<id>#<relation>, with the same id rules. The differences are that <type>:* is allowed when the model permits public access, ids in a userset can't contain *, and the whole user is at most 512 bytes long.

The limits match the API validation (TupleKey.object pattern ^[^\s]{2,256}$, TupleKey.user max_bytes: 512) and pkg/tuple in openfga/openfga.

Validation:

  • I checked each rule with Write and Check requests against openfga/openfga:latest, using a model where document#viewer and group#member allow user, user:* and group#member:
    • Object ids a b, a<TAB>b, a:b, a#b, * and the empty id are rejected. a*b, a@b, a/b, a|b, a,b, a.b, a=b, with%20pct and é-ü are accepted.
    • User ids follow the same rules. user:* is accepted, and group:a*#member and group:*#member are rejected.
    • A 256-character object is accepted and a 257-character one is rejected. A 134-character object of 259 bytes is accepted, so this limit counts characters.
    • A 512-byte user is accepted and a 513-byte one is rejected (value length must be at most 512 bytes).
  • validate:mintlify-mdx, validate:mintlify-components and native-page-structure.test.mjs pass.

References

closes #883

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

The Concepts page showed example objects and users but never said which
characters an identifier may contain or how long it can be, so users
found out by trial and error that `:`, `#` and `*` are rejected.

Document the rules the API enforces today:

- Objects are `<type>:<id>`. The id can't be empty, can't contain `:`,
  `#` or whitespace, and can't be `*` (reserved for type bound public
  access). The whole object is at most 256 characters long.
- Users follow the same id rules, except that `<type>:*` is allowed
  when the model permits public access, ids in a userset can't contain
  `*`, and the whole user is at most 512 bytes long.

Each rule was confirmed against a running OpenFGA server with Write and
Check requests.
@NopeCharon
NopeCharon requested a review from a team as a code owner November 9, 2026 15:41
@mintlify

mintlify Bot commented Nov 9, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit dcc4679.

Approve preview

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: adbc08a2-0553-4847-a132-8d5151c6dfa0
Commits

Reviewing files that changed from the base of the PR and between e1d943e and dcc4679.

Files selected for processing: 1

  • docs-site/concepts.mdx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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.

Describe format of an object/user and object/user id

1 participant