Skip to content

Commit

Permalink
Fix SetVersion to use correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
bbockelm committed Mar 10, 2024
1 parent d2b775f commit d98f5ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions token/token_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ func (config *TokenConfig) SetVersion(ver string) error {
if ver == "" {
ver = "scitokens:2.0"
} else if !scitokensVerPattern.MatchString(ver) {
return errors.New("the provided version '" + config.version +
return errors.New("the provided version '" + ver +

This comment has been minimized.

Copy link
@haoming29

haoming29 Mar 11, 2024

Contributor

Good catch! We don't want to use Pelican version for token version for sure.

"' is not valid. It must match 'scitokens:<version>', where version is of the form 2.x")
}
} else if config.tokenProfile == TokenProfileWLCG {
if ver == "" {
ver = "1.0"
} else if !wlcgVerPattern.MatchString(config.version) {
return errors.New("the provided version '" + config.version + "' is not valid. It must be of the form '1.x'")
} else if !wlcgVerPattern.MatchString(ver) {
return errors.New("the provided version '" + ver + "' is not valid. It must be of the form '1.x'")
}
}
config.version = ver
Expand Down

0 comments on commit d98f5ad

Please sign in to comment.