(ctx context.Context, authConfig *auth.ConfigData)
| 279 | } |
| 280 | |
| 281 | func writeAuthFile(ctx context.Context, authConfig *auth.ConfigData) error { |
| 282 | file, err := os.OpenFile(C.AuthFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0700) |
| 283 | if err != nil { |
| 284 | return errors.Wrapf(ctx, err, "open authentication file for writing") |
| 285 | } |
| 286 | defer file.Close() |
| 287 | |
| 288 | enc := json.NewEncoder(file) |
| 289 | if err := enc.Encode(authConfig); err != nil { |
| 290 | return errors.Wrapf(ctx, err, "encode authentication file") |
| 291 | } |
| 292 | return nil |
| 293 | } |
| 294 | |
| 295 | func existingAuth(ctx context.Context) (*auth.ConfigData, error) { |
| 296 | authConfig := auth.NewConfigData() |
no outgoing calls
no test coverage detected