feat(analytics): add service account authentication support#175
Merged
lajohn4747 merged 41 commits intoJun 17, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #175 +/- ##
==========================================
+ Coverage 94.50% 95.79% +1.29%
==========================================
Files 12 13 +1
Lines 1947 2259 +312
Branches 116 129 +13
==========================================
+ Hits 1840 2164 +324
+ Misses 70 62 -8
+ Partials 37 33 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Rename service_account parameter to credentials for extensibility - Add MixpanelCredentials type alias (Union[ServiceAccountCredentials]) - Keep ServiceAccountCredentials as standalone class (no base class) - Update Mixpanel, Consumer, and BufferedConsumer signatures - Update all tests, README, and CHANGELOG Benefits: - Generic parameter name supports future credential types - Type alias is single source of truth for supported types - Easy to extend: just add to Union when adding OAuth, API keys, etc. - Self-documenting via IDE type hints
- Create mixpanel/credentials.py for authentication classes - Move ServiceAccountCredentials and MixpanelCredentials to new file - Import from credentials module in __init__.py - Improves code organization and separation of concerns Benefits: - Cleaner module structure - Easier to add new credential types in one place - Credentials logic isolated from core tracking code
- Add APISecretCredentials for API secret authentication - Mark as deprecated in favor of ServiceAccountCredentials - Update MixpanelCredentials type alias to Union of both types - Add 4 new tests for API secret credentials Benefits: - Consistent credentials pattern for all auth types - Explicit deprecation path from API secrets to service accounts - Type-safe: validation at construction time - All auth methods now use credentials classes
efahk
reviewed
Jun 11, 2026
lajohn4747
commented
Jun 12, 2026
3 tasks
efahk
previously approved these changes
Jun 16, 2026
tylerjroach
approved these changes
Jun 17, 2026
tylerjroach
left a comment
Contributor
There was a problem hiding this comment.
The changelog is autogenerated at release time. However, the feature will just read the PR title: add service account authentication support.
Given the scope of these changes, I think were good to leave the changelog changes in. The release prep will probably mess up the formatting, but we can edit it manually at that time.
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.
Summary
Adds service account authentication support to enable secure server-to-server integration and prepare for API key deprecation.
We are moving away from API keys in favor of service account credentials for enhanced security in server-to-server integrations.
Failing tests are fixed here -> #176 (version is eol)