Rotate piko connection jwt
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Problem Statement
The `jwt` that we use to connect a Wormhole app to `piko` has an expiration date. While we disable closing a `piko` connection on `jwt` expiry, other failures, network hiccups, machine restarts, etc, may force the `piko` agent to need to reconnect. If the `jwt` is expired, this will fail.
## Proposed Solution
I added an API some time ago in Route Registry that allows the exchange of an unexpired `piko` `jwt` for a new one with an extended expiration time. This API can be called periodically to refresh the `jwt` so that a connection can be reestablished.
Failure on the side of `wh` (process killed, machine goes down, etc) _could_ be recovered if the `piko` `jwt` is persisted to some durable storage (disk). Rotating the `jwt` queues another check in Route Registry to see that the route is up and restores it in the routing table. _But_, for now, I will consider this functionality out of scope for this issue. We can add it in the future if we see fit.
## Exit Criteria
- [ ] `wh` periodically rotates the `piko` `jwt` before expiry
- [ ] `wh` detects connection failures to `piko` and attempts to reestablish a connection (with backoff)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the wh code that establishes the piko connection and handles its JWT, then review the Route Registry API described in the issue. Done means wh periodically rotates the JWT before expiry and retries failed piko connections with backoff; no files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authentication, cli, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100