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
feat(ui): populate agent env from connection envMappings on grant
When a user grants a connection (e.g. Google Drive) in the Configure
Agent dialog, any envMappings OneCLI declared for that app get appended
to the agent's editable env list. The user can then edit or remove the
entries like any other custom env var. On ungrant, entries that are
still untouched (name + value match the declared mapping) and not
required by any other still-granted app are removed automatically.
Requires OneCLI 0.0.20+ which adds `envMappings` as a first-class field
on the app registry and returns it on `GET /api/connections`
(kagenti/onecli#16).
Why this over storing envs on the connection itself: envs belong with
the agent (that's the K8s resource that consumes them), and users may
reasonably want to tweak the env name or remove a mapping for a
specific agent without losing the grant. Humr has zero provider
knowledge — the env-injection contract lives in OneCLI next to the
OAuth config for each app.
- api-server-api: `AppConnectionView.envMappings?` for UI consumption
- api-server: passes through OneCLI's joined envMappings verbatim on
`connections.list`; tests use a fictional provider fixture so they
don't couple to any specific provider
- ui: `EditAgentSecretsDialog.toggleApp` appends new app's envMappings
to the agent env list on first grant (dedupe by env name — user-set
wins); on ungrant removes entries only if they match the declared
mapping and no other still-granted app declares the same envName
- ui: `ConnectorsView` displays env names on each connection row so
users can see what a grant will contribute
- deploy: bump OneCLI image to 0.0.20
- docs: google-workspace README describes the new grant-time flow
Signed-off-by: Matous Havlena <havlenma@gmail.com>
Copy file name to clipboardExpand all lines: packages/agents/google-workspace/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ A Humr agent template with the [Google Workspace CLI (`gws`)](https://github.com
42
42
43
43
The agent authenticates to Google APIs through Humr's credential injection:
44
44
45
-
1.The agent template sets `GOOGLE_WORKSPACE_CLI_TOKEN=humr:sentinel`in the pod environment
45
+
1.When you grant a `gmail` or `google-drive` connection in the agent's Configure dialog, Humr auto-populates `GOOGLE_WORKSPACE_CLI_TOKEN=humr:sentinel`into the agent's editable env list. You can edit or remove it like any custom env var.
46
46
2. When `gws` makes a request to `*.googleapis.com`, it sends `Authorization: Bearer humr:sentinel`
47
47
3. The request goes through OneCLI's MITM proxy (`HTTPS_PROXY`)
48
48
4. OneCLI recognizes the sentinel and replaces it with the real Bearer token
49
49
5. Google receives a valid access token
50
50
51
-
The agent never sees your real Google credentials.
51
+
The agent never sees your real Google credentials. OneCLI's app registry declares which env var each provider needs; Humr reads it and populates the agent env on grant.
0 commit comments