Skip to content

plugin.CliConnection#AccessToken returns stale tokens #597

@sykesm

Description

@sykesm

While working with the new plugin API, I removed my home-grown wrapper around the oauth-token command and replaced it with a call to thew new AccessToken method on the CLI connection. Unfortunately, the new method does not refresh the access token like the old method did and there is absolutely no documentation about why I would choose one over the other.

This behavior results in scenarios where end users must explicitly do something that causes their token to be refreshed before trying to use a plugin that relies on a valid access token. My assumption was that the new method existed to make it easier on users to acquire a token without having to scrape the token from the output and deal with all of the error cases.

  1. The documentation should clearly indicated wha the CLI plugin commands do, the expected environment, and the expected results.
  2. The AccessToken method should ensure that it returns an access token that is not expired or it should return an error indicating a refresh is necessary.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions