add ssh-key command
This commit is contained in:
parent
b5366c6ebf
commit
e26a1b98a1
8 changed files with 490 additions and 22 deletions
|
|
@ -203,9 +203,10 @@ func (c Client) HasMinimumScopes(hostname string) error {
|
|||
}
|
||||
|
||||
search := map[string]bool{
|
||||
"repo": false,
|
||||
"read:org": false,
|
||||
"admin:org": false,
|
||||
"repo": false,
|
||||
"read:org": false,
|
||||
"admin:org": false,
|
||||
"read:public_key": false,
|
||||
}
|
||||
for _, s := range strings.Split(scopesHeader, ",") {
|
||||
search[strings.TrimSpace(s)] = true
|
||||
|
|
@ -220,6 +221,10 @@ func (c Client) HasMinimumScopes(hostname string) error {
|
|||
missingScopes = append(missingScopes, "read:org")
|
||||
}
|
||||
|
||||
if !search["read:public_key"] && !search["admin:public_key"] {
|
||||
missingScopes = append(missingScopes, "read:public_key")
|
||||
}
|
||||
|
||||
if len(missingScopes) > 0 {
|
||||
return &MissingScopesError{MissingScopes: missingScopes}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue