Skip to content

feat: Auth registry write grpc paths - #381

Merged
jiaolong89 merged 5 commits into
masterfrom
feat/auth-registry-write-grpc-paths
Sep 29, 2026
Merged

jiaolong89 merged 5 commits into
masterfrom
feat/auth-registry-write-grpc-paths

Conversation

@jiaolong89

Copy link
Copy Markdown

What this PR does / why we need it:

adds opt-in write-path OIDC on feast serve_registry so registry mutations can require an Okta JWT without locking reads or existing no_auth deploys.

auth.write_auth_only (default false) plus optional issuer / audience on OIDC config
When on: Apply* / Delete* / Commit / UpdateInfra need a valid Bearer JWT; List/Get/Health/Refresh stay unauthenticated
Okta-safe parser: sync JWKS + jwt.decode (sig, exp, optional iss/aud); username from preferred_username else sub else cid; no Keycloak resource_access required
Skip Feast Permission RBAC when the flag is on so Apply works with a valid token and no Permission rows
Tests: flag-off regression; flag-on write/read/Health matrix with a local RSA JWT

Which issue(s) this PR fixes:

https://expediagroup.atlassian.net/browse/EAPC-23074

Misc

long jiao added 4 commits September 22, 2026 14:17
… wire _grpc_interceptors + is_auth_necessary skip

AuthConfig.write_auth_only: bool = False — declared because extra=forbid would reject it in yaml otherwise.
OidcAuthConfig.issuer / audience — optional; client_id still required (placeholder is fine for Okta write-auth).
_grpc_interceptors now reads store.config.auth_config:
NONE → [ErrorInterceptor()]
OIDC + write_auth_only → [WritePathAuthInterceptor(), ErrorInterceptor()]
else → [AuthInterceptor(), ErrorInterceptor()]
init_security_manager still creates a SecurityManager for OIDC and passes write_auth_only through. is_auth_necessary returns False when that flag is set, so Apply can succeed with a valid JWT and no Permission rows.
- Always verifies signature and exp
- Verifies iss / aud only when those fields are set on OidcAuthConfig (unset keeps Keycloak / stock OIDC working)
- Username: preferred_username else sub else cid
- Roles: resource_access[client_id].roles if present, else [] (no KeyError on Okta tokens)
- INTRA_COMMUNICATION_BASE64 path is unchanged
Added user_details_from_access_token_sync for the write interceptor
- Allowlist (19 methods) under /feast.registry.RegistryServer/: Apply/Delete for Entity, DataSource, FeatureView, FeatureService, SavedDataset, ValidationReference, Permission, Project, plus ApplyMaterialization, UpdateInfra, Commit
- Writes with no/invalid Bearer → UNAUTHENTICATED (AuthenticationError)
- Valid JWT → set_current_user, then the handler (is_auth_necessary still skips RBAC when the flag is on)
- Not gated: Health, reflection, Get/List/Proto/GetInfra, Expedia search, Refresh
…cal RSA JWT

- Flag off: unauthenticated ApplyEntity still works with no_auth; interceptor selection still uses stock AuthInterceptor when the flag is unset
- Flag on: write with no token → UNAUTHENTICATED; valid RSA JWT Apply succeeds with no Permission rows; expired / wrong aud / bad signature → UNAUTHENTICATED; List/Get/Health/Refresh with no metadata succeed
- Parser: Okta-shaped sub/cid claims; preferred_username wins; empty resource_access; missing identity fails; real JWT iss/aud/exp/signature checks
@jiaolong89 jiaolong89 changed the title Feat/auth registry write grpc paths feat: auth registry write grpc paths Sep 28, 2026
@jiaolong89 jiaolong89 changed the title feat: auth registry write grpc paths Feat: auth registry write grpc paths Sep 28, 2026
@jiaolong89 jiaolong89 changed the title Feat: auth registry write grpc paths feat: auth registry write grpc paths Sep 28, 2026
@jiaolong89 jiaolong89 changed the title feat: auth registry write grpc paths feat: Auth registry write grpc paths Sep 28, 2026
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa

ISSUER = "https://expediagroup.oktapreview.com/oauth2/default1"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we make this a more generic so it's not expedia-specific even in this test?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yeap. thats a good call out

@jiaolong89
jiaolong89 merged commit 0de49f3 into master Sep 29, 2026
29 checks passed
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.

2 participants