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

Function migrateToken

internal/config/migration/multi_account.go:196–203  ·  view source on GitHub ↗
(hostname, username string, tokenSource tokenSource)

Source from the content-addressed store, hash-verified

194}
195
196func migrateToken(hostname, username string, tokenSource tokenSource) error {
197 // If token is not currently stored in the keyring do not migrate it,
198 // as it is being stored in the config and is being handled when migrating the config.
199 if !tokenSource.inKeyring {
200 return nil
201 }
202 return keyring.Set(keyringServiceName(hostname), username, tokenSource.token)
203}
204
205func migrateConfig(c *config.Config, hostname, username string) error {
206 // Set the user key in case it was previously an anonymous user.

Callers 1

DoMethod · 0.85

Calls 2

SetFunction · 0.92
keyringServiceNameFunction · 0.70

Tested by

no test coverage detected