Repository navigation
Conversation
The alternative to pasting a key: the member signs in and approves Blurt
on AssemblyAI's consent page (authorization code + PKCE, public client,
ASWebAuthenticationSession, redirect com.assemblyai.blurt://oauth/callback),
and Blurt trades the access token for the connection's own API key, which
it stores where a pasted key goes.
- AssemblyAI library: OAuthAuthorization (PKCE, consent URL, callback
check) and OAuthClient (token endpoint, POST /api/v2/oauth/api-key and
/revoke). Refused calls log the route, status and server reason, never
a token.
- Engine: AssemblyAIAccount (sign-in, renewal, sign-out), SignInSession
in its own Keychain item with a read that keeps "none" apart from
"unavailable", CredentialRows (which rows show), runRenewal (launch,
then hourly; renews daily or within two days of key expiry). A
generation counter keeps a renewal from undoing a sign-out or reset.
- Shell: AccountSignIn (the web session) and AccountRowView ("Sign In
with AssemblyAI…" / "Signed in as …" + Sign Out; recoverable failures
inline, Keychain faults as alerts). The reset clears the session too.
- Off unless a build sets BLURT_OAUTH_CLIENT_ID, _TOKEN_URL,
_AUTHORIZE_URL and _API_ORIGIN (https, or http to loopback for a local
dashboard). Debug points at the Stytch test project and staging;
Release stays empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key minted by a sandbox sign-in only works against that sandbox's dictation host, and dictation always went to production, so a signed-in Debug build got a 401 on every dictation. - BLURT_OAUTH_DICTATION_ORIGIN (optional): the dictation host the sign-in mints keys for. Debug: https://dictation.sandbox000.assemblyai-labs.com. Release: empty, i.e. production. - AssemblyAIAccount keeps a DictationOrigin (Mutex) current as it signs in and out; AssemblyAITranscriber reads it at every request and warm-up. A pasted key, or no origin configured, stays on production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
Contributor
Author
|
Superseded by #254. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds "Sign in with AssemblyAI" as an alternative to pasting a key (PE-2657, part of the Agent OAuth epic PE-2644). The member signs in and approves Blurt on AssemblyAI's consent page. Blurt then trades the access token for the connection's own API key and stores it where a pasted key goes, so dictation, the press gate and Settings read it unchanged.
ASWebAuthenticationSession, with redirectcom.assemblyai.blurt://oauth/callback, which the session catches without a registered URL handler.POST /api/v2/oauth/api-key/revoke), then clears it on the Mac. If the server can't confirm, everything stays in place and the user can retry.BLURT_OAUTH_*inApp/Blurt/project.yml). Debug points at the Stytch test project and the staging dashboard and site. Release is empty, so shipping builds still offer only the paste-a-key path.AGENTS.md(Settings, persistence) describes the design. The AssemblyAI library gainsOAuthAuthorizationandOAuthClient; Blurt's policy (storage, renewal, wording) stays in the engine.Draft because a sandbox key can't dictate yet: Blurt always calls production dictation. A follow-up commit adds
BLURT_OAUTH_DICTATION_ORIGIN, so a signed-in Debug build dictates against sandbox.How it was tested
scripts/check.shpasses locally: engine coverage 89.06%, iOS check green, swift-format and swiftlint cleanAGENTS.mdandSources/AssemblyAI/README.mdUnit tests:
End to end against sandbox (ad-hoc Debug build, staging dashboard, sandbox000 AMS):
Reviewed by the repo's three agents: swift6-concurrency, macos-hig and cleanup. Their findings are applied.
Found along the way, fixed elsewhere:
🤖 Generated with Claude Code