Repository navigation
feat(auth,transport): configurable user-agent, updated origins, operationName - #20
Conversation
…tionName - Make auth user-agent configurable via ClientOptions.UserAgent (defaults to monarchmoney-go/1.0.0) - Update Origin/Referer to app.monarch.com (matching current domain) - Extract and send operationName in GraphQL requests - Simplify LoginWithEmailOTP to re-submit with email_otp field (initial login attempt triggers the OTP email separately) - Expose LoginWithEmailOTP on AuthService interface - Include raw body in BAD_REQUEST errors for better debugging
…llback - Test operationName extraction from mutation/query/subscription - Test BAD_REQUEST error with raw body fallback - Test default and custom header configuration - Test auth guard (not authenticated, session expired) - Test truncateQuery, SetAuth, SetSession
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (53.57%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
==========================================
+ Coverage 42.77% 46.44% +3.67%
==========================================
Files 16 16
Lines 1833 1858 +25
==========================================
+ Hits 784 863 +79
+ Misses 974 904 -70
- Partials 75 91 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
Thanks for splitting this up @brewgator. I tested this manually and it looks good. Just fix up the CI errors and this will be good to merge |
Fixes errcheck lint failures in CI.
Summary
ClientOptions.UserAgent(defaults tomonarchmoney-go/1.0.0)Origin/Refererheaders toapp.monarch.com(matching Monarch's current domain)operationNamein GraphQL requests (some servers require it)LoginWithEmailOTP— the initial login attempt triggers the OTP email, so this method now just re-submits with theemail_otpfieldLoginWithEmailOTPon theAuthServiceinterfaceBAD_REQUESTerrors when no structured error is foundSplit from #19 per review feedback.
Test plan
go test ./...)UserAgentinClientOptionsoperationNamefield