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

Function migrateToken

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

Source from the content-addressed store, hash-verified

186}
187
188func migrateToken(hostname, username string, tokenSource tokenSource) error {
189 // If token is not currently stored in the keyring do not migrate it,
190 // as it is being stored in the config and is being handled when migrating the config.
191 if !tokenSource.inKeyring {
192 return nil
193 }
194 return keyring.Set(keyringServiceName(hostname), username, tokenSource.token)
195}
196
197func migrateConfig(c *config.Config, hostname, username string) error {
198 // 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