File: default.go

package info (click to toggle)
glab 1.53.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,936 kB
  • sloc: sh: 295; makefile: 153; perl: 99; ruby: 68; javascript: 67
file content (12 lines) | stat: -rw-r--r-- 505 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
package api

var DefaultListLimit = 30

// IsValidToken checks if a token provided is valid.
// The token string must be 26 characters in length and have the 'glpat-'
// prefix or just be 20 characters long to be recognized as a valid personal access token.
// token can be 64 characters to include oauth tokens
// TODO: check if token has minimum scopes required by glab
func IsValidToken(token string) bool {
	return (len(token) == 26 && token[:6] == "glpat-") || len(token) == 20 || len(token) == 64
}