MCPcopy Create free account
hub / github.com/cli/cli / checkUploadTokenType

Function checkUploadTokenType

internal/attachments/client.go:80–85  ·  view source on GitHub ↗

checkUploadTokenType rejects a credential that cannot upload. It is an allowlist, so an unlisted kind is rejected rather than sent.

(tokenType gh.TokenType)

Source from the content-addressed store, hash-verified

78// checkUploadTokenType rejects a credential that cannot upload. It is an
79// allowlist, so an unlisted kind is rejected rather than sent.
80func checkUploadTokenType(tokenType gh.TokenType) error {
81 if slices.Contains(uploadTokenTypes, tokenType) {
82 return nil
83 }
84 return errors.New("unsupported authentication type")
85}
86
87// uploadPermissions lists the repository permissions that can attach a file.
88// The list matches api.Repository.ViewerCanPush, and it is measured against the

Callers 1

NewUploaderFunction · 0.85

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected