zaquestion / lab

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
https://zaquestion.github.io/lab
Creative Commons Zero v1.0 Universal
1.11k stars 102 forks source link

internal/config/config.go: Warn on expiring tokens #859

Closed prarit closed 1 year ago

prarit commented 1 year ago

82444bfa9c07 ("config: Add config verification") added some simple checking to see if a user's token was valid. After the recent go module updates we can now use the PersonalAccessToken service from go-gitlab to warn a user that their token is about to expire. This warning should happen once a day when the config is verified.

Warn a user when their token is going to expire within two weeks.

claytonrcarter commented 1 year ago

BTW the build error looks like the commit just needs go fmt

claytonrcarter commented 1 year ago

FYI I think I borked the tests while working on the tests for #860 ... I updated a few of the issues and MRs in the test project and I'm still untangling a couple of the test failures. There's a wip commit in #860 w/ the updates needed, but it's not done yet. Much apologies!

prarit commented 1 year ago

Heh, I was trying to figure out what I broke. LOL Do you think it is safe to merge this?

claytonrcarter commented 1 year ago

I suspect that it is, yes. And if not, a fix is just a commit away. 😂