Skip to content

feat(tools): implement OAuth2 helper with encrypted token storage (Phase 2 Slice 5b) - #14

Closed
SarkarShubhdeep wants to merge 2 commits into
developmentfrom
phase2/integrations-oauth
Closed

feat(tools): implement OAuth2 helper with encrypted token storage (Phase 2 Slice 5b)#14
SarkarShubhdeep wants to merge 2 commits into
developmentfrom
phase2/integrations-oauth

Conversation

@SarkarShubhdeep

Copy link
Copy Markdown
Collaborator

Summary

  • Add integrations/oauth.ts with generic OAuth2 authorization-code flow
  • Implement AES-GCM token encryption using JERRY_OAUTH_ENCRYPTION_KEY env var
  • Add TokenStore interface with memory and DB implementations
  • Add oauth_tokens migration for encrypted blob storage
  • Export via @mieweb/jerry-tools/integrations/oauth package path

Test plan

  • Unit tests for encryption (roundtrip, ciphertext doesn't contain secrets)
  • Unit tests for createMemoryTokenStore (save/load/delete/isolation)
  • Unit tests for createOAuthClient (auth URL, exchange, refresh, revoke)
  • Error messages don't leak secrets
  • All existing tests pass
  • Typecheck passes
  • Integration test with real Google OAuth (deferred to 5c)

Phase 2 Slice 5b Checklist

  • Shared OAuth helper module functional
  • OAuth token storage encrypted at rest
  • Mock OAuth tests pass

Made with Cursor

SarkarShubhdeep and others added 2 commits July 24, 2026 16:06
Break external integrations into approval/OAuth foundations, Drive and YouTube workstreams, and pin Time Huddle until API availability is confirmed.

Co-authored-by: Cursor <cursoragent@cursor.com>
…rage (Phase 2 Slice 5b)

- Add integrations/oauth.ts with createOAuthClient and TokenStore interface
- Implement AES-GCM encryption for tokens using JERRY_OAUTH_ENCRYPTION_KEY
- Add oauth_tokens migration for encrypted blob storage
- Create memory and DB token store implementations
- Add comprehensive OAuth flow tests with mock endpoints
- Export via ./integrations/oauth package path

Co-authored-by: Cursor <cursoragent@cursor.com>
@SarkarShubhdeep

Copy link
Copy Markdown
Collaborator Author

Will create combined PR after Slice 5 is completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant