Repository navigation
OpenGateLLM 0.9.5 carries on the move to OpenFGA started in 0.9.4: every /v1/admin/routers and /v1/admin/roles route, and the GET and PATCH /v1/admin/organizations routes, are now decided by the platform:api#admin relation, not by the Postgres role.
The new relations are computed from admin: no data migration, no Alembic migration, no configuration change. scripts/setup_openfga.sh publishes the new authorization model at start-up.
A router is now loaded together with its providers and checks the rules on them under a lock, so two concurrent writes can no longer leave a mixed router.
A Redis user denied a command the provider limits need is now reported at start-up instead of silently turning the limits off.
Breaking changes
- Authorize
GET(list and get-one) andPATCH /v1/admin/organizationswith OpenFGA (platform:api#can_read_organization,organization:<id>#can_update).PATCHchecks the permission before the existence lookup: a user without it gets a 403, not a 404, for an unknown id (#1488, #1512) - Authorize
GET(list and get-one),POST,PATCHandDELETE /v1/admin/routerswith OpenFGA (platform:api#can_read_router,can_create_router,can_update_router,can_delete_router) (#1522, #1523, #1525, #1530) - Authorize
GET(list and get-one),POST,PATCHandDELETE /v1/admin/roleswith OpenFGA (platform:api#can_read_role,can_create_role,can_update_role,can_delete_role) (#1533, #1534, #1541, #1546) - On all the routes above, a user who does not hold
platform:api#admingets403 "User <id> is not allowed to perform this action.", whatever their Postgres role, instead of403 "User has no admin rights."(#1488, #1512, #1522, #1523, #1525, #1530, #1533, #1534, #1541, #1546)
Refactoring
- Load a router together with its providers: forwarding and the model health no longer query the providers separately, and the admin API is unchanged (#1508)
- Check the rules on a router's providers (same vector size, same context length, no mix of providers with and without a
qos_limit) in one place, under a lock on the router: two concurrent provider writes can no longer each pass the check and leave a mixed router. Existing mixed routers keep working (#1529)
Bug fix
- Log an error naming the refused command, at start-up and on every request that needs it, when the Redis user is denied a command the provider limits need, instead of logging
Redis is unreachableonce per worker. The API still starts and serves requests without the provider limits (#1539)
Chore
Upgrade notes
- Check that every admin holds
platform:api#adminbefore upgrading, now that routers, roles and organizations depend on it: rundb-migrateagain, whosem001_platform_adminsgrants it to every user whose role holdsADMIN, including those created or promoted through SSO login since the last run. - Check that
SELECT count(*) FROM provider WHERE model_hosting_zone IS NULLreturns 0, and set those rows toWORotherwise: reading a router now reads its providers, so such a row would also fail the admin list of routers and the start-up (#1508). - If the API logs
The Redis user is not allowed to run a command the provider limits needat start-up, allow that command to its Redis user: the list is in the Redis permissions (#1539). - Rolling back to 0.9.4 needs no migration:
scripts/setup_openfga.shpublishes the 0.9.4 model again, and the OpenFGA store keeps its tuples.
Full Changelog: 0.9.4...0.9.5
- chore(doc): update generated documentation and release versions by @github-actions[bot] in #1514
- feat(admin): patch /v1/admin/organizations with openfga by @bakr-a in #1512
- feat(organizations): authorize GET /v1/admin/organizations with OpenFGA by @bakr-a in #1488
- refacto(routers): load the router together with its providers (#1490) by @benjaminpilia in #1508
- feat(routers): authorize POST /v1/admin/routers with OpenFGA by @bakr-a in #1523
- feat(routers): authorize DELETE /v1/admin/routers with OpenFGA by @bakr-a in #1525
- feat(routers): authorize PATCH /v1/admin/routers with OpenFGA by @bakr-a in #1530
- refacto(routers): write providers through their router (#1505) by @benjaminpilia in #1529
- feat(routers): authorize GET /v1/admin/routers with OpenFGA by @bakr-a in #1522
- feat(roles): authorize POST /v1/admin/roles with OpenFGA by @tibo-pendino in #1533
- feat(roles): authorize DELETE /v1/admin/roles with OpenFGA by @tibo-pendino in #1534
- fix(qos): refuse to start when the Redis user is denied a command the provider limits need (#1531) by @benjaminpilia in #1539
- chore: update issue templates by @leoguillaume in #1540
- feat(roles): authorize GET /v1/admin/roles with OpenFGA by @tibo-pendino in #1541
- feat(roles): authorize PATCH /v1/admin/roles with OpenFGA by @tibo-pendino in #1546