mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
Fix gitlab token length requirements (#176)
This commit is contained in:
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
- Gitlab token length requirements; thanks @dschafhauser
|
||||
### Security
|
||||
|
||||
## [1.7.5] - 12/11/21
|
||||
|
||||
@@ -228,8 +228,11 @@ func VerifyTokenSet() error {
|
||||
token = os.Getenv("GHORG_GITLAB_TOKEN")
|
||||
if strings.HasPrefix(token, "glpat-") {
|
||||
tokenLength = 26
|
||||
} else if len(token) > 0 {
|
||||
// gitlab admins can change token prefixes so we dont know the exact length
|
||||
tokenLength = len(token)
|
||||
} else {
|
||||
tokenLength = 20
|
||||
tokenLength = -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestVerifyTokenSet(t *testing.T) {
|
||||
|
||||
err := configs.VerifyTokenSet()
|
||||
if err != configs.ErrNoGitLabToken {
|
||||
tt.Errorf("Expected ErrNoGitHubTokenError, got: %v", err)
|
||||
tt.Errorf("Expected ErrNoGitLabTokenError, got: %v", err)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user