The Entity Model

Time: ~8 minutes. Tangible win: place every core Polaris entity in the right layer of the hierarchy, so later REST calls and RBAC grants read as structural instead of arbitrary.

Every REST call in this course targets one of six entities. Without a map of how they nest, the URL paths and grant chain in later lessons look like syntax to memorize instead of a structure to reason about.

Primary source Iceberg REST Catalog Open API spec — the protocol Polaris implements for catalog, namespace, and table entities.

Data-plane entities

Access-control entities

The access chain, previewed Fully worked in Lesson 6: Privilege → Catalog Role → Principal Role → Principal. Nothing is granted directly to a Principal or directly to a Principal Role — privileges always flow through a Catalog Role first.

Exercise: list the entities in your running server

TOKEN="principal:root;password:<your-root-secret>;realm:default-realm;role:ALL"

curl -s "http://localhost:8181/api/management/v1/catalogs" -H "Authorization: Bearer $TOKEN"
curl -s "http://localhost:8181/api/catalog/v1/<your-catalog>/namespaces" -H "Authorization: Bearer $TOKEN"
curl -s "http://localhost:8181/api/management/v1/principals" -H "Authorization: Bearer $TOKEN"

Verified output shape (this run's actual catalog/principal list):

{"catalogs":[{"type":"INTERNAL","name":"coursecatalog","properties":{"default-base-location":"file:///data"},...,"storageConfigInfo":{"storageType":"FILE","allowedLocations":["file:///data"]}}]}
{"namespaces":[["course_db"]],"next-page-token":null}
{"principals":[{"name":"root","clientId":"f103ea289b7df858",...},{"name":"course_engineer","clientId":"c44d2961a45293c7",...}]}

Retrieval check

Where can a privilege like TABLE_WRITE_DATA actually be attached?

Correct. Privileges only attach to Catalog Roles — Principal Roles are purely a grouping label one level up.

Not quite. The API won't let you attach a privilege there — only a Catalog Role holds privileges.

You create a Catalog Role named writer under catalog-a. Can you reuse it under catalog-b by referencing the same name?

Correct. A Catalog Role is meaningless outside the catalog it belongs to, even if another catalog's role happens to share the same name.

No. Catalog Roles don't transfer across catalogs — you'd need to create and grant a separate one under catalog-b.

Practice

  1. Run the exercise against your own server and note your actual catalog, namespace, and principal names.
  2. Draw (ASCII or prose) the entity tree: catalog → namespace(s) → table(s).
  3. Draw the separate principal → principal role → catalog role tree, and mark with an arrow exactly where the two trees connect.
Ask the agent: "If I nest a namespace three levels deep (a.b.c), does every level need its own explicit grant, or does a grant on a cover a.b.c?" Next lesson bootstraps a real server and finds the one credential every later call depends on.