Registry Mirror
Skip to content

Conversation

@dshoen619

@dshoen619 dshoen619 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Authentication: the page now says which API keys can read an environment's PDP statistics: the key of that environment, or a key of its project or organization. A key of another environment in the same organization gets a 403 or a 404 response, and on a 404 the page says to check the API key as well as the path.
  • Listing PDPs: the page now says the list is ordered most recently seen first, and how page and per_page page through it: without per_page, a page holds up to 1000 PDPs and page moves 1000 PDPs at a time, and a per_page above 100 gets a 422 response. The endpoints table now says "List the PDPs in an environment" instead of "List all PDPs".
  • Messages (folded in from PER-19314: PDP statistics: what the messages endpoint returns on cloud #696): on Permit's cloud the messages endpoint returns an empty data list for every environment, so "an empty data list means every online PDP received the recent updates" was a false all-clear there. The section now says what the endpoint returns on Permit's cloud and in a full on-premise deployment (data updates only, kept 24 hours), scopes the "lost messages" check to on-premise, says assumed_lost is decided within a few minutes (not "after several retries"), and drops the pointer to the webhooks page from that section. Fixes PER-19314.

Changes

docs/api/pdp-statistics.mdx: the endpoints table row for the PDP listing, the sentences in "Authenticate to the PDP statistics API", the sentence after the curl example in "List the PDPs in an environment", and a paging paragraph after that section's example response. From #696: the front matter and intro, the messages row of the endpoints table, the opening of "Check the delivery status of update messages", the assumed_lost row, and the end of "List only lost messages to find sync issues".

Test plan

  • Wording checked against the API's behaviour: the environment routes require read access to the environment, and the listing orders by last_seen_at descending and takes page and per_page.
  • Messages wording checked against the relay: Permit's cloud runs the relay without message tracking, so the endpoint has nothing to return there; a full on-premise deployment tracks data updates (not policy updates) for 24 hours, and declares one lost a few minutes after sending it, without retries.
  • PER-19314: PDP statistics: what the messages endpoint returns on cloud #696's own deploy preview built, and both of its new links resolve.
  • Docs site build not run locally.

Description updated during review to match cf27ede (a key of another environment can get a 404 as well as a 403, and the paging paragraph with the 422).

🤖 Generated with Claude Code

State which API keys can read an environment's PDP statistics, and describe the
environment PDP listing's ordering and its page and per_page parameters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 10:31
@linear-code

linear-code Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

PER-18198

PER-19314

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for permitio-docs ready!

Name Link
🔨 Latest commit 9d29641
🔍 Latest deploy log https://app.netlify.com/projects/permitio-docs/deploys/6b045319ba60d580cba062e5
😎 Deploy Preview https://deploy-preview-693--permitio-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…ng "all PDPs"

A key of another environment in the same organization gets a 403. The endpoints
table now says the environment's PDP listing lists the PDPs, which it returns one
page at a time, rather than all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dshoen619

Copy link
Copy Markdown
Contributor Author

Review: findings and fixes

A trimmed comprehensive review (quality, architecture, security, performance, tests, docs, ops) of cbff45d found the new wording accurate, with 2 Nits. It also found one statement elsewhere on the page that this PR does not change.

# Severity Finding Resolution
1 Nit "A key of another environment gets a 403 response" holds for an environment of the same organization. A key resolves the project and environment inside its own organization. Fixed in 1c92a34. It now reads "A key of another environment in the same organization gets a 403 response."
2 Nit The endpoints table still said "List all PDPs in an environment", but the listing pages. Fixed in 1c92a34. It now reads "List the PDPs in an environment".
3 Medium The message-delivery section says an empty data list means every online PDP received the recent updates. On Permit's cloud, the messages endpoint does not record messages, so it always returns an empty list. Not changed: needs a product decision.

Checked and found correct

  • These API keys can read an environment:

    • the environment's own key, which is the key the PDP uses
    • a key of the environment's project
    • a key of the environment's organization

    A key of another environment in the same organization gets 403.

  • The environment's PDP listing:

    • It orders by the most recently seen first, with ties broken by ID.
    • When per_page is omitted, one page holds up to 1000 PDPs.
    • page starts at 1.
    • per_page goes up to 100.
  • The page, the description and the commits carry no ticket references and no internal reasons.

Tests after the fixes

The change is two lines of text. The deploy preview builds on each push.

@dshoen619
dshoen619 requested review from zeevmoney and a balanced review from Copilot and removed request for Copilot November 17, 2026 12:57
@zeevmoney zeevmoney changed the title PDP statistics API: which keys can read an environment, and paging PER-18198: PDP statistics API: which keys can read an environment, and paging Nov 17, 2026

@zeevmoney zeevmoney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved — no CRITICAL or HIGH issues found.

Non-blocking:

  • MEDIUM docs/api/pdp-statistics.mdx:23 — a key of another environment can get a 404, not only a 403
  • LOW docs/api/pdp-statistics.mdx:38 — say what a per_page above 100 does, and how page moves without per_page

Details are in the inline comments on each line.

Comment thread docs/api/pdp-statistics.mdx Resolved
Comment thread docs/api/pdp-statistics.mdx Resolved
…age above 100 is a 422

A key of another environment in the same organization gets a 403 or a 404, so the
page says to check the API key on a 404 too. The PDP listing's paging moves to its
own paragraph after the example response: without per_page, page moves 1000 PDPs
at a time, and a per_page above 100 gets a 422.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 11:25

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings November 19, 2026 12:56

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…ns on Permit's cloud

On Permit's cloud the messages endpoint returns an empty `data` list for every
environment, so "an empty list means every online PDP received the updates" was a
false all-clear there. The section now says what the endpoint returns on Permit's
cloud and in a full on-premise deployment, keeps the "lost" reading to on-premise,
drops the webhooks pointer, and states the 24-hour window and the few-minute
loss decision instead of "after several retries".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dshoen619

Copy link
Copy Markdown
Contributor Author

Review of 5aaa5710 (PER-19314), 2026-11-22

No findings. I checked each changed sentence against the code:

  • Permit's cloud: the relay consumer runs with RELAY_PERSISTENCE_DISABLE: "True" in both SaaS environments. It forwards each update before storing anything, so the messages route lists no rows and returns an empty data list. pdp-statistics.api.permit.io is prod's statistics API host.
  • PDPs online: only the consumer sets the switch, so pings still keep pdp_states current. active is set when the last ping is under 60 s old.
  • On-prem: tracking is on, with 24 h retention by created_at. Only data updates are stored. With retries off (the default and on-prem's setting), a message is declared lost about 125 s after it is sent, 425 s at most. That matches "within a few minutes".

Outside this commit, two unchanged lines, not changed here:

  • "Related pages" still links the PDP sync error webhooks. The PER-19314 note says they are never sent; that is a product call.
  • The example messages response shows sent_count: 2, retry_count: 1, which a deployment with retries off doesn't produce.

🤖 Generated with Claude Code

@dshoen619
dshoen619 merged commit 3c0f17f into master Nov 23, 2026
4 checks passed
@dshoen619
dshoen619 deleted the david/per-18198-pdp-statistics-docs branch November 23, 2026 14:54
zeevmoney added a commit that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEQWbhtPyG778XaEvEuKrh

* commit 'cdfc77a6889fea30960000355ce07a0d4eda2b1e':
  docs(nexus-pdp): the 0.8.0 memory minimum, stalled-database reporting, and event-store retention (#699)
  docs: Elements reads the user key from the environment's user key claim
  docs(nexus-pdp): the NATS credentials directory, PDP_RUNTIME_DIR, and its memory emptyDir (#689)
  docs: add SFS UTM tags on app.agent.security links in architecture and rollout (#694)
  PER-18198: PDP statistics API: which keys can read an environment, and paging (#693)
  docs(nexus-pdp): offline mode: stale serving, offline start, in-place reconnect, and the online heal (#697)
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.

3 participants