llama-stack-mirror/tests/unit/server
ehhuang 21bae296f2
feat(auth): API access control (#2822)
# What does this PR do?
- Added ability to specify `required_scope` when declaring an API. This
is part of the `@webmethod` decorator.
- If auth is enabled, a user can access an API only if
`user.attributes['scope']` includes the `required_scope`
- We add `required_scope='telemetry.read'` to the telemetry read APIs.

## Test Plan
CI with added tests

1. Enable server.auth with github token
2. Observe `client.telemetry.query_traces()` returns 403
2025-07-24 15:30:48 -07:00
..
test_access_control.py fix: fixed test_access_control.py unit test (#2876) 2025-07-23 11:50:20 -07:00
test_auth.py feat(auth): API access control (#2822) 2025-07-24 15:30:48 -07:00
test_auth_github.py feat(auth): support github tokens (#2509) 2025-07-08 11:02:36 -07:00
test_quota.py feat(quota): add server‑side per‑client request quotas (requires auth) (#2096) 2025-05-21 10:58:45 +02:00
test_replace_env_vars.py chore(test): migrate unit tests from unittest to pytest for server en… (#2795) 2025-07-17 16:20:12 -07:00
test_resolver.py chore: default to pytest asyncio-mode=auto (#2730) 2025-07-11 13:00:24 -07:00
test_server.py fix: AccessDeniedError leads to HTTP 500 instead of error 403 (#2595) 2025-07-03 10:50:49 -07:00
test_sse.py chore: default to pytest asyncio-mode=auto (#2730) 2025-07-11 13:00:24 -07:00