fix: update login to /auth2/login endpoint#230
Merged
Conversation
Spond replaced /core/v1/login with /core/v1/auth2/login on 2026-05-13.
The new response wraps the bearer token under accessToken.token (with an
explicit expiration) instead of a flat loginToken string. Public API
unchanged: self.token still holds the bearer string and auth_headers
still produces the same Authorization header.
Adds the first test coverage for login() and parses defensively so
error-shaped responses ({"error": ...}, null accessToken, empty token)
all surface as AuthenticationError with the raw response in the message.
Closes #229
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Spond login flow to use the new /core/v1/auth2/login endpoint and parses the new response shape (accessToken.token) rather than the old flat loginToken. Token extraction is factored into a reusable static helper, and tests are added for login() and the parser.
Changes:
- Switch
login()URL toauth2/loginand read the bearer token fromaccessToken.token. - Extract token-parsing logic into
_SpondBase._extract_access_token, raisingAuthenticationErrorfor any unexpected shape. - Add
TestLogincovering happy path, error response, and parametrized parser cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spond/base.py | Updates login URL and refactors token extraction into a static helper that validates the new response structure. |
| tests/test_spond.py | Adds first test coverage for login() and the new _extract_access_token parser. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 14, 2026
Merged
Closed
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
https://api.spond.com/core/v1/loginwithhttps://api.spond.com/core/v1/auth2/loginon 2026-05-13, breaking all calls (issue login() fails with 404 — https://api.spond.com/core/v1/login no longer responding #229).accessToken.token(with an ISO expiration) instead of a flatloginTokenstring.login(). Public API (self.token,auth_headers,login()signature) is unchanged.Test plan
TestLoginclass adds the first test coverage forlogin()— happy path + error-response path + parametrized unit tests on the parserpytest— 21 passed (8 new)ruff check— cleanCloses #229
🤖 Generated with Claude Code