Repository navigation
Conversation
7af15db to
4530692
Compare
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
When you've addressed these, the pipeline will re-assess on its next cycle. |
4530692 to
c53d1a2
Compare
|
Rebased onto main
Main's new Ran locally: black/isort/flake8 on changed files, the 4 meetings test files (509 passed), all Please review the resolution. A maintainer push makes the maintainer the last pusher, so a second approver is needed under the repo's last-push rule. Reply if anything looks wrong. |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The Google/Microsoft connect path rests on an unverified provider claim — "loopback redirect on any port, without re-registration" — never completed against a live tenant. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: let a user connect CalDAV, Google, or Microsoft 365 from Settings with no stored value ever reaching the page — ADDITION (diff includes the declared stacked base #2190).
[FIRST-PRINCIPLES-REVIEWED] 3117c52 Description read[DESCRIPTION-READ] 6ba77d1b1f7bb7a29e0243391f8253db943a1e80b6a606d371afe9b05c03e670 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Fable 5, fork) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK Cannot evaluate: missing every screenshot of the new Settings → Calendar credentials UI — the description itself says captures are "still owed." Evidence gaps
Watch
Suggestions
[UX-REVIEWED] 3117c52 Description read[DESCRIPTION-READ] 175abe2ae61ec1c9370877b58330efa68ff68c21937e376c37f3b427e9bf3220 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)Design-level review of Design-Verdict: BLOCK Cannot evaluate: missing screenshots of the new Settings → Calendar credentials panel — no rendered evidence of this revision exists. BlockersMissing rendered evidence for a new user-visible surface. WatchThe live OAuth handshake is unrun: "loopback redirect on any port" acceptance by Google/Microsoft and the origin-derived redirect URI rest on provider documentation, so a rejection would surface only at the consent screen for the first real user. [DESIGN-REVIEWED] 3117c52 Description read[DESCRIPTION-READ] dadc04345119982e09bfc36d6226f97f9a125a36949d11074e593ccbd1550c83 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsAdvisory only — the calendar credential store's FINDING — src/kiro_crew/apps/builtins/meetings/backend/credentials.py:150 — [OPUS-REVIEWED] 3117c52 |
|
|
|
|
@bolichen97 thanks. The credential store is fixed in the base: #2190 (now Also in this push: switching the calendar provider now discards unsaved input, so a Google secret typed but not saved cannot be stored under Microsoft or blank Microsoft's stored secret. There is a test for each case. Still open and needing a person: a live Google / Microsoft 365 consent from the desktop shell, and fresh screenshots. Merge order is #2190 first. |
Security Scope Review (fork) — 🟡 CONCERNSWhich legitimate operations does the reviewer's own judgement; no confirmed regression Scope-Verdict: CONCERNS TIGHTENING: the agent-facing fences around the new calendar credential store, plus the server-side gates the new providers route through -- the ONE threat refused is an agent (file tool or spawned sandboxed command) reading the live calendar credentials (a CalDAV password, Google / Microsoft 365 OAuth refresh + access tokens) out of ADJUDICATED: 13 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: posix rows cover the data-home and app-data reads in UNADJUDICATED: most of this tightening lives outside the shell composite (which deliberately has no path tier), so no verdict exists for it and the candidates above probe only accidental coupling:
[SCOPE-REVIEWED] 3117c52Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. |
…osoft 365
Meetings had to be created by hand, so the app never knew what was already
scheduled. This adds calendar providers -- CalDAV, Google Calendar and
Microsoft 365 -- behind the existing `CalendarProvider` seam, plus the
credential store and OAuth handshake they need. Five providers ship:
`none`, `ics`, `caldav`, `google`, `microsoft`.
Credential store (`backend/credentials.py`)
Credentials live in a TOP-LEVEL leaf of the crew data home,
`<crew-home>/meetings-credentials/calendar-credentials.json`. Not under
`app_data_dir("meetings")`, which `store.contain` opens to agent-supplied
paths; and not under `workspace/`, because the OS sandbox mask binds only
over a directory that exists at spawn time and only a direct child of the
data home can be materialised before every spawn (a nested leaf's
agent-writable parent could also be renamed out from under the mask). The
directory is registered in all three places at once: `_CREW_SECRET_LEAVES`
(agent file tools), `sandbox._CREW_HIDDEN_LEAVES` (spawned commands, every
mode) and `sandbox._CREW_PRECREATE_HIDDEN_DIR_LEAVES` (created empty at 0700
before each namespace spawn). The DIRECTORY is fenced, not the file, so the
`atomic_write` temp sibling is covered too. A store an earlier build left at
`workspace/meetings/calendar-credentials.json` is moved (never copied) on
the first read that finds the new location empty; only a regular file is
moved (lstat), and a reader that loses the move race to a concurrent reader
still reads the relocated store.
The store is read-modify-write under one lock, written through
`atomic_write(restrict_to_owner=True)` fail-closed, and refuses writes
while the file is unreadable or schema-invalid (display degrades to "not
connected"; the malformed file stays for a human to salvage). The path is
module state, not a request parameter. `GET /calendar/credentials`
publishes field names and booleans only; `PUT` is an allow-list per
provider, so a client cannot hand the app an `access_token`.
Fetch safety (`fetch_vetted`)
All outbound HTTP -- the `.ics` fetch, the CalDAV REPORT, both cloud APIs
and the OAuth token POST -- goes through one module-level gated fetch:
`link_unfurl.vet_unfurl_url` vets the address, DNS is pinned per hop,
redirects are followed manually so every hop is vetted, the body is
size-capped while streaming. `auth_headers` are dropped across a
cross-origin redirect, and a non-GET follows only the method-preserving
307/308. https-only implies port 443 at the vet boundary.
OAuth (`backend/oauth.py`)
Authorization-code + PKCE (S256), run by the gateway's app backend rather
than through kiro-cli's connections because the token is consumed by the
gateway itself (the calendar poller syncs with no agent session). Pending
flows live in memory with a TTL; `state` is compared in constant time and
the flow is consumed before the exchange; access tokens refresh early. The
token POST accepts HTTP 400 so an RFC 6749 error body (`invalid_grant`) is
read and its description surfaced. Every callback exit, including a forged
or expired `state`, writes a `meetings.calendar_oauth_callback` audit
record. The redirect URI derives from the request's own origin.
Events
Every provider funnels through `build_event`, which redacts displayed
fields once and derives `event_id` from the ORIGINAL uid; a uid the
redactor flags as credential-shaped switches to a digest-only id.
Google's date-only start and Graph's `isAllDay` set `all_day`. Graph
responses that ignore the UTC `Prefer` header are mapped through
`_WINDOWS_TO_IANA` before the UTC fallback. CalDAV Multi-Status is parsed
with `defusedxml` (`forbid_dtd=True`).
Two ratchets re-pinned for the new leaf, each with its reason recorded at
the pin: `test_security_gate_liveness._PACKAGE_LINE_BUDGET` (the fence
declaration and its comment in `paths.py`) and
`test_sandbox_protected_name_holds.EXPECTED` (a root leaf is held by its
own name only, three launcher entries per tier, like `auth-store-staging`).
Specs updated: `docs/system-specs/modules/meetings.md` (routes, provider
table, credential store, OAuth custody decision) and `security.md`
(keystone directory `meetings-credentials`).
Co-authored-by: Kiro Crew <noreply@kirodotdev.github.io>
The calendar providers that need a credential (CalDAV, Google Calendar, Microsoft 365) could only be connected by calling the credentials and OAuth routes by hand: Settings -> Calendar showed a provider picker and a source field and nothing else. Settings -> Calendar now renders the credential form for the active provider under the picker. The form's shape comes from the backend: GET /calendar/credentials gains a `providers` map built from the same allowlist and OAuth table the PUT enforces, so the fields shown are the fields that can be written and a provider that takes none renders nothing. Every field is write-only (a stored value never reaches the browser): a set field shows a mask with Replace / Remove, a typed value is sent as a string, a removed one as null, an untouched one not at all. The status badge is derived from field names, and only an OAuth provider is ever called Connected: its refresh token exists because a sign-in against the real tenant succeeded. A password provider with every field stored reads "Credentials saved", because nothing in the form verified the password. The status re-reads on window focus, because the OAuth consent finishes in another tab. The OAuth client fields link to the provider's console, where a client id comes from. Sign-in stays disabled until a client id is stored; it opens the consent URL in a new tab. `window.open` with `noopener` answers null whether or not a tab opened, so a blocked popup cannot be detected: the same URL is always offered as a link and the toast is worded for both outcomes. Disconnect sits on the status row beside the badge, so the action row stays at Save + Sign in. Failures render in-page through ErrorNotice: a status load that failed with no form on screen carries the agent hand-off; a failure beside typed-but-unsaved credential values does not. The OAuth callback, GET /api/apps/meetings/calendar/oauth/callback, is exempt from the dashboard token gate (GET only, on the method-scoped bypass map beside the self-authenticating webhooks). From the Electron shell the consent runs in the OS browser, which holds no dashboard cookie, so on the ordinary gate every desktop sign-in lands on a 403 JSON page and no token is stored. The handler's single-use `state` is its admission; a test pins the exemption to that one path and method and to the route the app registers. Strings land in all twelve locales; the pseudolocale is regenerated. Stacked on kirodotdev#2190; rebase onto main once kirodotdev#2190 lands. Co-authored-by: Kiro Crew <noreply@kirodotdev.github.io>
33ed7af to
3117c52
Compare
|
|
|
|
Open PR triage (2026-10-05): REBASE after #2190, merge discussion on the stackThis is a code-level audit of head Stack, confirmed from git. Stale. The merge base Nothing on main covers this. Main still has only the The 2026-09-25 request-changes review is addressed on this head. That review was against Still open (already raised, so this is a note, not a new request-changes):
No breaking change or P0 in this commit. The GET-only bypass for Recommendation: land #2190 first, or deliberately collapse the two PRs into one. Then rebase this PR and re-measure the ratchet tests. Do not close either PR on its own. |
|
Thanks for the thorough work on the calendar providers and the Settings flow. We are closing #2190 and #8081 together: both branches are about 5,500 commits behind main and conflict, #8081 has an open security review (the Linux sandbox does not mask workspace/meetings for already-running namespaces), and #2190 still has open review blocks. Main now ships the .ics provider plus the calendar poller (#8080), and Google Calendar and Microsoft 365 can both publish an .ics feed, so the basic need is covered. Richer provider support is tracked in #6769 (first-party Google Workspace connectors) and #16228 (multiple calendar sources). A fresh, smaller PR on current main is welcome. The branch is left untouched, so you can reopen this PR at any time, or open a fresh one on current main, if you want to pick it back up. |
Problem / Motivation
Goal: Let a user connect CalDAV, Google or Microsoft 365 from Settings without the page ever seeing a stored value, and without a second, hand-kept list of what each provider needs.
#2190 adds the CalDAV, Google Calendar and Microsoft 365 providers and the routes to store their credentials and run the OAuth handshake, but no screen calls them. Settings → Calendar shows a provider picker and a source field and nothing else, so the three new providers can only be connected by hand-crafting
PUT /calendar/credentialsandPOST /calendar/oauth/startrequests.Why it matters
A provider nobody can configure from the product is not shipped. Until this lands, the calendar picker offers three choices that lead nowhere for anyone not comfortable with curl, and #2190's write-only store and PKCE OAuth protect credentials that no user can enter.
Not a goal
What changed (motivation → approach → change)
The form's shape comes from the backend. #2190's write path already owns the per-provider field allowlist (
_CREDENTIAL_FIELDS) and the OAuth client map (_OAUTH_CLIENTS);GET /calendar/credentialsinroutes/calendar.pynow returns them asproviders, so the fields a user sees and the fields a PUT accepts cannot disagree.components/CalendarCredentials.tsx(new) renders them with the dashboard's write-onlySecretField: a typed value is sent, a removed field is sent asnull, an untouched field is not sent. The status row shows a badge — Connected only for an OAuth provider holding a refresh token, Credentials saved for a complete password provider — with Disconnect beside it; the action row is Save credentials and Sign in with {provider}, which opens the consent page and always offers it as a link as well. Google and Microsoft fields link to where their client id comes from. Every failure renders an inlineErrorNotice.SettingsView.tsxmounts the component keyed by provider, so switching provider discards unsaved input instead of saving it under the other provider;api.tsadds the client methods.The desktop shell opens the consent page in the OS browser, which carries no dashboard token, so
dashboard/token_auth.pyadmits the OAuth callback for GET only (the same method-scoped bypass as the self-authenticating webhooks); the callback's single-usestateis its admission, and/calendar/oauth/startstill requires the token. 21 strings are added to every catalog underwebsite/src/i18n/locales/(for examplelocales/en.json) with translator notes inen.context.json, anddocs/system-specs/modules/meetings.mdgains #2190's routes and a Credentials in Settings section.Backwards compatibility
Compatible: the GET gains one field, and the only auth change admits GET on the callback path.
Tests
website/src/test/MeetingsCalendarCredentials.test.tsx— schema-driven fields; only typed values are sent and none echoed;nullfor a removed field; the draft kept on a failed save; Disconnect through the forget route and outside the Save / Sign in row; sign-in disabled without a client id; the consent link always offered;ErrorNoticewith and without the agent hand-off; badge states; setup links.website/src/test/MeetingsSettingsViewCoverage.test.tsx— switching provider after typing a secret, or after pressing Remove, saves nothing from the old provider (both fail without thekey).test/test_meetings_oauth_callback_auth.py— through the real middleware: a tokenless GET reaches the callback, other methods are denied, and/calendar/oauth/startstill needs the token.test/test_meetings_calendar_routes.py— the GET'sprovidersmap equals the allowlist and omitsics.Manual verification
The OAuth consent has not been completed against a live Google or Microsoft 365 tenant, from the browser or the desktop shell; that needs a registered client. The handshake is covered by #2190's tests, and this PR's side is covered at the
window.openboundary and by the callback-admission test.Screenshots / video
Not captured for this head. The earlier screenshots predate the badge, status-row and error-notice changes, and the committed PNGs were removed from the branch; fresh captures of Settings → Calendar (CalDAV not connected / credentials saved, Google before and after a client id) are still owed and will be added to this description.
Related Issues
no linked issue: feature work from the Meetings stack; depends on #2190.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)