You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## [Unreleased]
9
9
10
10
### Changed
11
+
-**Governed authority mode**: HTTP and Live WebSocket calls can now use a `Gemini.GovernedAuthority` value that supplies authority-selected base URLs and materialized credential headers/query params while rejecting unmanaged request credentials in governed mode.
11
12
-**Provider payload parsing**: service account keys, SSE fields, model list payloads, Live response modalities, and WebSocket redaction now use bounded field maps and deterministic string parsing.
12
13
13
14
### Tests
15
+
- Added governed authority regression coverage for HTTP auth materialization, request override rejection, WebSocket query redaction, and standalone auth compatibility.
14
16
- Added focused regression coverage for provider-authored service account keys and unknown SSE fields to ensure they are ignored instead of interned as new atoms.
Copy file name to clipboardExpand all lines: README.md
+51-3Lines changed: 51 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ Or set the environment variable:
83
83
export GEMINI_API_KEY="your_api_key_here"
84
84
```
85
85
86
-
For default Gemini auth resolution, `config :gemini_ex, api_key: ...` now takes precedence over `GEMINI_API_KEY`. Narrower overrides still win: pass `api_key:` directly on a request or on `Gemini.Live.Session.start_link/1` for session-scoped credentials.
86
+
For default Gemini auth resolution, `config :gemini_ex, api_key: ...` now takes precedence over `GEMINI_API_KEY`. Narrower overrides still win in standalone mode: pass `api_key:` directly on a request or on `Gemini.Live.Session.start_link/1` for session-scoped credentials. Governed mode does not use these standalone sources; pass `Gemini.GovernedAuthority` so credentials and targets come from the selected authority materializer.
87
87
88
88
### Simple Content Generation
89
89
@@ -1380,13 +1380,19 @@ The examples follow a consistent pattern:
Copy file name to clipboardExpand all lines: guides/AUTHENTICATION_SYSTEM.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,13 @@ The system is built on two core principles:
13
13
1.**Dual-Strategy Support:** It natively supports both the simple **Gemini API Key** (`:gemini`) and the more complex **Vertex AI OAuth/JWT** (`:vertex_ai`) authentication methods.
14
14
2.**Hierarchical Configuration:** It provides a clear and predictable order of precedence for sourcing credentials, prioritizing per-request overrides, then environment variables, and finally Elixir application configuration.
15
15
16
-
This design makes the library easy to use for simple scripts while being powerful enough for complex, multi-tenant production applications.
16
+
This design makes the library easy to use for standalone scripts while keeping
17
+
governed runtime effects separate. Env, app config, ADC, native Google
18
+
credential discovery, and direct request/session overrides are standalone
19
+
compatibility only. Governed execution passes `Gemini.GovernedAuthority`, which
20
+
contains the authority-selected base URL, credential reference, lease reference,
21
+
target reference, redaction reference, and materialized credential headers or
For Live WebSocket calls, authority can materialize the query credential and
300
+
the WebSocket path. GeminiEx redacts `key`, `access_token`, and `token` query
301
+
params in path logs and test helpers.
302
+
267
303
### 6. Live API Authentication (New in v0.9.0)
268
304
269
305
The Live API uses WebSocket connections for bidirectional streaming. Authentication works similarly to HTTP requests but with some specific considerations:
Copy file name to clipboardExpand all lines: guides/live_api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,7 @@ model = Models.resolve(:audio)
283
283
# Session is now ready for messages
284
284
```
285
285
286
-
For Gemini sessions, you can also pass `api_key:` directly to `Session.start_link/1`. When `api_key:` is present and `auth:` is omitted, the session uses Gemini auth for that connection only.
286
+
For standalone Gemini sessions, you can also pass `api_key:` directly to `Session.start_link/1`. When `api_key:` is present and `auth:` is omitted, the session uses Gemini auth for that connection only. Governed sessions use `Gemini.GovernedAuthority` instead and reject direct per-session credentials.
0 commit comments