Skip to content

/info and MCP get_data_model describe a ledger whose policy defaults deny the caller #1981

Open

Description

@bplatz

On a ledger whose policy defaults deny a request (f:policyDefaults with f:defaultAllow false), an anonymous /query returns no rows, but two metadata surfaces still describe the data:

  • GET /v1/fluree/info/<ledger> returns property IRIs, class and flake counts, the named-graph inventory (including #config and #txn-meta), the commit id and the nameservice record.
  • MCP get_data_model returns the same statistics as markdown: classes, instances, properties and the flake count.

Both check that the caller may address the ledger (data auth and token scope). Neither applies the ledger's policy.

Repro

  1. Create gov and insert ex:alice ex:name "Alice".
  2. Upsert the config:
    @prefix f: <https://ns.flur.ee/db#> .
    GRAPH <urn:fluree:gov:main#config> {
      <urn:cfg:main> a f:LedgerConfig ; f:policyDefaults <urn:cfg:policy> .
      <urn:cfg:policy> f:defaultAllow false .
    }
    
  3. Anonymous SELECT ?s WHERE { ?s <http://example.org/name> ?o } returns 0 rows. get_data_model for gov reports Triples (flakes): 2, and GET /info/gov lists http://example.org/name.

#1963 pins the current MCP behavior in tokenless_mcp_applies_the_ledgers_policy_defaults, so that a change here is a deliberate one.

Decision needed

Should schema and statistics be governed by policy? If so, there are two options:

  • hide them when the defaults deny the caller, or
  • compute them over the policy-filtered view. The stats index can't do that cheaply.

Whichever is chosen, /info and get_data_model should give the same answer.

Activity

  1. added
    P2
    triage:needs-decision
    area:server
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:servertriage:needs-decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions