Skip to content
Snippets Groups Projects

feat: rotate personal, project or group access tokens

1 unresolved thread
Compare and Show latest version
2 files
+ 6
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -81,7 +81,7 @@ func NewCmdRevoke(f *cmdutils.Factory, runE func(opts *RevokeOptions) error) *co
}
if opts.Group != "" && opts.User != "" {
return cmdutils.FlagError{Err: errors.New("--group and --user are mutual exclusive.")}
return cmdutils.FlagError{Err: errors.New("'--group' and '--user' are mutually exclusive.")}
}
if runE != nil {
@@ -131,7 +131,7 @@ func revokeTokenRun(opts *RevokeOptions) error {
case 0:
return cmdutils.FlagError{Err: fmt.Errorf("no token found with the name '%v'.", opts.Name)}
default:
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v', use the ID instead.", opts.Name)}
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v'. Use the ID instead.", opts.Name)}
}
if err = api.RevokePersonalAccessToken(httpClient, token.ID); err != nil {
return err
@@ -156,7 +156,7 @@ func revokeTokenRun(opts *RevokeOptions) error {
case 0:
return cmdutils.FlagError{Err: fmt.Errorf("no token found with the name '%v'.", opts.Name)}
default:
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v', use the ID instead.", opts.Name)}
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v'. Use the ID instead.", opts.Name)}
}
if err = api.RevokeGroupAccessToken(httpClient, opts.Group, token.ID); err != nil {
@@ -185,7 +185,7 @@ func revokeTokenRun(opts *RevokeOptions) error {
case 0:
return cmdutils.FlagError{Err: fmt.Errorf("no token found with the name '%v'.", opts.Name)}
default:
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v', use the ID instead.", opts.Name)}
return cmdutils.FlagError{Err: fmt.Errorf("multiple tokens found with the name '%v'. Use the ID instead.", opts.Name)}
}
if err = api.RevokeProjectAccessToken(httpClient, repo.FullName(), token.ID); err != nil {
Loading