Repository navigation
Add signadot auth token command - #301
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add RefreshBearerToken() to API config that always calls the refresh endpoint, and use it in the token command instead of InitAPIConfig(). Co-Authored-By: Claude Opus 4.6 <[email protected]>
| return nil | ||
| } | ||
|
|
||
| // RefreshBearerToken forces a token refresh using the stored refresh token, |
There was a problem hiding this comment.
This will invalidate the previous token when called which gives me pause. Isn't it better to just invalidate if it's close to expiry anyway how the rest of the refresh mechanic works?
Replace force-refresh with lazy refresh: return the cached token if still valid, refresh via InitAPIConfig (which uses the existing checkKeyringAuth flow) only when expired, and error if authenticated with an API key. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Thanks for implementing this feature @scott-cotton and @foxish! Just one question, out of interest - are there any tests for this CLI functionality? I was expecting to see some CLI tests to invoke the new command, check the token generation, etc.? |
We tested this one manually. Testing with auth is harder to automate and these changes largely rely on calls to existing functions. We may add tests to our internal e2e suite exercising this, as it already needs to setup auth automation. Since folks are waiting on this and we don't need to automate the tests to validate it, we've not prioritised that yet. |
|
Related - I noticed that the Signadot CLI auth docs had not been updated, so created an issue to suggest adding some @scott-cotton. |
Summary
Test plan
🤖 Generated with Claude Code