Skip to content

Rotate piko connection jwt #1

Description

@zephiyr

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions