skip to content

Why do a stream job's `/push` calls to a Feast feature server with OIDC auth start failing once one `Permission` granting `READ_ONLINE` on feature services is applied?

level: seniorimportance: nice to knowfreq 3%

answer

  1. zero permissions versus one
  2. every requested action must match
  3. push asks for write actions
  4. auth type gates enforcement
  5. the docs note and the enforcer disagree

basics

~20 s

In Feast 0.66, once any Permission exists, a request no permission matches by resource and actions is refused with FeastPermissionError. /push needs write actions on feature views, so grant those to the stream job's role.

solid answer

~50 s

Feast enforces permissions only on its servers, and only when `feature_store.yaml` sets an `auth` type other than the default `no_auth`. With auth on and no permissions registered, every authenticated user gets full access and a warning is logged. Once one exists, each request is checked: a permission matches when the resource is one of its `types`, passes its `name_patterns` and `required_tags`, and its `actions` include every requested action; its policy, such as `RoleBasedPolicy`, then grants or denies. When nothing matches, Feast 0.66's enforcer raises `FeastPermissionError` with 'No permissions defined to manage ...'. `/push` checks each feature view fed by the push source for `WRITE_ONLINE`, `WRITE_OFFLINE`, or both for `"online_and_offline"`, and the new permission covers neither those types nor actions. Add a `Permission` on those feature views with the write actions and the stream job's role.

code

python · 19 lines
python
from feast import FeatureService, FeatureView
from feast.permissions.action import WRITE, AuthzedAction
from feast.permissions.permission import Permission
from feast.permissions.policy import RoleBasedPolicy

game_backend_reads = Permission(
    name="game-backend-reads",
    types=[FeatureService],
    policy=RoleBasedPolicy(roles=["game-backend"]),
    actions=[AuthzedAction.READ_ONLINE],
)

session_stream_writes = Permission(
    name="session-stream-writes",
    types=[FeatureView],
    name_patterns="player_session.*",
    policy=RoleBasedPolicy(roles=["session-stream"]),
    actions=WRITE,  # WRITE_ONLINE and WRITE_OFFLINE
)

go deeper

for a junior

Recall that a Feast Permission names resource types, actions and a policy, and that it is applied to the registry with feast apply.

for a middle

Explain the eight AuthzedAction values, the READ and WRITE lists, and that enforcement needs an auth type other than no_auth.

for a senior

Diagnose a deny after the first permission lands, map each endpoint to the actions it checks, and trust the enforcer over the concepts note.

for a principal

Plan permission rollout as deny-by-default: inventory every caller and endpoint first, then apply the full set in one change.

## Where Feast enforces permissions Feast's permission model protects requests that pass through its **servers**: the online feature server (REST, started by `feast serve`), the offline feature server (Arrow Flight) and the registry server (gRPC). Its docs state there is no enforcement when the Feast SDK talks to the stores directly with a local provider. Enforcement also needs an **`auth`** section in `feature_store.yaml`. The allowed types are `no_auth`, `kubernetes` and `oidc`; when the section is absent, Feast sets `no_auth`, installs no security manager, and permits everything, even if `Permission` objects are registered. A permission file applied to a server with no `auth` block is stored and ignored. Deployments made by the Feast Operator differ: in 0.66 the operator configures `kubernetes` auth when its `FeatureStore` resource has no `authz` section, so there the default is enforcing. Organisation-wide access policy across warehouses and catalogs belongs to the data governance material; this is Feast's own gate on its objects. ## The `Permission` object A `Permission` is a Python object in the feature repository, applied with `feast apply` and stored in the registry. Its fields: | Field | Default | Meaning | |---|---|---| | `name` | required | label used in logs and in `feast permissions` output | | `types` | all resource types | Feast classes it covers, subclasses included | | `name_patterns` | `[]`, no filter | regexes on the resource name | | `required_tags` | `None`, no filter | tags the resource must carry | | `actions` | `ALL_ACTIONS` | `AuthzedAction` values it authorises | | `policy` | `AllowAll` | who passes, such as `RoleBasedPolicy(roles=[...])` | `AuthzedAction` has eight members: `CREATE`, `DESCRIBE`, `UPDATE`, `DELETE`, `READ_ONLINE`, `READ_OFFLINE`, `WRITE_ONLINE` and `WRITE_OFFLINE`. The module also defines lists for convenience: `READ`, `WRITE`, `CRUD` and `ALL_ACTIONS`. A `RoleBasedPolicy` passes a user holding at least one of its roles; with OIDC the server reads the roles from the validated token, and with `kubernetes` it looks up the calling service account's roles in the cluster's RBAC bindings. ## How a request is decided The enforcer in Feast 0.66 works per resource: 1. **No permissions at all**: an authenticated user is granted full access and a warning says so; a request with no user context is denied. 2. **Find matches**: a permission matches when the resource is an instance of one of its `types`, its name passes `name_patterns`, its tags satisfy `required_tags`, and **every** requested action is in its `actions`. 3. **Evaluate**: matching permissions' policies decide grant or deny. 4. **No match**: the request fails with `FeastPermissionError` and a message beginning "No permissions defined to manage". Step 4 is the trap. The concepts page carries a note that resources matching no permission are not secured, so any user may act on them; the 0.66 enforcer does the opposite for direct checks such as `/push` and `/get-online-features`. Trust the code: after the first permission, anything uncovered is denied. ## Why `/push` broke Before the change there were no permissions, so the stream job's authenticated calls passed under step 1. The new permission covers `types=[FeatureService]` with `READ_ONLINE`, which suits the game backend calling `/get-online-features` with a feature service, since that path checks only the service. `/push` checks something else. For every feature view whose stream source is the named push source it asserts: - `WRITE_ONLINE` for `"to": "online"` (the default); - `WRITE_OFFLINE` for `"offline"`; - both, the `WRITE` list, for `"online_and_offline"`. No permission covers feature views with those actions, so step 4 fires. The same happens to a direct `features=[...]` online request, which checks each feature view rather than the service. ## The fix Add a permission for the writer, scoped as tightly as the naming allows: - `types=[FeatureView]`, with `name_patterns` matching the pushed views; - `actions=WRITE` when it pushes to both stores, since a permission must contain every requested action; - `policy=RoleBasedPolicy(roles=["session-stream"])`, the role the job's identity carries. Then run `feast apply` and verify with `feast permissions list -v`, which prints the resources each permission matches, and `feast permissions check`, which lists resources no permission covers. ## A note on the docs The docs' own example passes `actions=[AuthzedAction.WRITE]`, but `AuthzedAction` has no `WRITE` member in 0.66; `WRITE` is the module-level list, used as `actions=WRITE` or unpacked as `*WRITE`. Copying the example verbatim fails.

  • The team applies the same permissions to a feature server whose `feature_store.yaml` has no `auth` section. What is enforced?
    Nothing. Without an `auth` section Feast uses `no_auth`, installs no security manager and permits every request. The permissions sit in the registry unused until the server runs with `kubernetes` or `oidc` auth.
  • The stream job's permission lists only `WRITE_ONLINE`, and it pushes with `"to": "online_and_offline"`. Does the push pass?
    No. That push requests `WRITE_OFFLINE` and `WRITE_ONLINE` together, and a permission matches only when its actions include every requested action. With no other match, Feast raises `FeastPermissionError`.

  • a resource no permission covers stays open to every user
  • applied Permission objects are enforced even without an auth section
  • AuthzedAction.WRITE grants both online and offline writes
  • a permission matches if it lists any one of the requested actions
  • permissions also guard direct SDK access with a local provider

Assumes Feast 0.66: its enforcer denies requests no permission matches, contrary to the concepts note, and its Operator now defaults to kubernetes auth.