Repository navigation
be: tell when a token expires, so a merchant can be asked for a new one before it stops working - #71
Merged
Merged
Conversation
…ne before it stops working
landsman
commented
Nov 11, 2026
landsman
left a comment
Owner
Author
There was a problem hiding this comment.
The shape is right: one call, a 403 already lands in InvalidToken through the existing case 401, 403, the template is registered for metrics, and the reachability metadata picks up the new record by itself. CI is green.
One thing worth doing before merge (the native caller), one typo, one nit.
…ackson binds a java.time into
landsman
commented
Nov 12, 2026
landsman
left a comment
Owner
Author
There was a problem hiding this comment.
Second round: all three points are in. NativeCaller now reads the token's expiry, so the native image check proves the OffsetDateTime binding the JVM test already did, and native image is green on 85283f7. Nothing blocking left; two nits below, both fine to skip.
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.
A merchant's token expires, and until now an app found out from a 401 when payments stopped arriving. `client.tokenExpiry(token)` (and `me.tokenExpiry()`) reads it from `GET /api/v1/vip/token/introspect`, MONETA's `VipTokenIntrospect_v1`, so the app can ask for a new token in time.
A 403, which MONETA sends for a token that is not a MONETA API token, is `InvalidToken` like any refused token; an answer without `expiration` is `InvalidResponse`. The endpoint gets its own `uriTemplate` for metrics.
Checked live with `make peek-token`, added here: a merchant token issued in November 2026 answered `2027-02-08T17:25:00Z`.