MCPcopy Index your code
hub / github.com/cli/cli / AuthToken

Method AuthToken

internal/prompter/prompter.go:245–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243}
244
245func (p *accessiblePrompter) AuthToken() (string, error) {
246 var result string
247 // EchoModeNone and EchoModePassword both result in disabling echo mode
248 // as password masking is outside of VT100 spec.
249 form := p.newForm(
250 huh.NewGroup(
251 huh.NewInput().
252 EchoMode(huh.EchoModeNone).
253 Title("Paste your authentication token:").
254 // Note: if this validation fails, the prompt loops.
255 Validate(func(input string) error {
256 if input == "" {
257 return fmt.Errorf("token is required")
258 }
259 return nil
260 }).
261 Value(&result),
262 ),
263 )
264
265 err := form.Run()
266 return result, err
267}
268
269func (p *accessiblePrompter) ConfirmDeletion(requiredValue string) error {
270 form := p.newForm(

Callers

nothing calls this directly

Calls 6

newFormMethod · 0.95
ValueMethod · 0.80
ValidateMethod · 0.80
TitleMethod · 0.65
ErrorfMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected