MCPcopy Create free account
hub / github.com/auth0/auth0-cli / displayDeprecationStatus

Function displayDeprecationStatus

internal/cli/universal_login_customize.go:410–456  ·  view source on GitHub ↗

displayDeprecationStatus displays timeline information. The `showCommands` flag controls whether to display helpful usage examples.

(cli *cli, showCommands bool)

Source from the content-addressed store, hash-verified

408// displayDeprecationStatus displays timeline information.
409// The `showCommands` flag controls whether to display helpful usage examples.
410func displayDeprecationStatus(cli *cli, showCommands bool) error {
411 parsedSunset, _ := time.Parse("2006-01-02", sunsetDate)
412 now := time.Now()
413 daysUntil := int(parsedSunset.Sub(now).Hours() / 24)
414 formattedDate := ansi.Bold(ansi.Cyan(parsedSunset.Format("Jan 2, 2006")))
415
416 switch {
417 case daysUntil <= 0:
418 cli.renderer.Errorf("Advanced rendering mode was retired on %s", formattedDate)
419 cli.renderer.Errorf(" Use instead: %s", ansi.Green("auth0 acul config"))
420 if showCommands {
421 showNewConfigExamples(cli)
422 }
423 return fmt.Errorf("advanced rendering mode is no longer supported")
424
425 case daysUntil <= warningPeriodDays:
426 cli.renderer.Output("")
427 cli.renderer.Output(ansi.Bold(ansi.Red("🚨 URGENT: DEPRECATION NOTICE 🚨")))
428 cli.renderer.Warnf("%s will be retired soon (%d days left)",
429 ansi.Bold("Advanced rendering mode"), daysUntil)
430 cli.renderer.Warnf(" Switch to: %s", ansi.Bold(ansi.Cyan("auth0 acul config")))
431
432 if showCommands {
433 cli.renderer.Output("")
434 showNewConfigExamples(cli)
435 }
436
437 cli.renderer.Warnf("⏳ Proceeding with advanced rendering mode (deprecated)")
438
439 default:
440 cli.renderer.Output("")
441 cli.renderer.Output(ansi.Bold(ansi.Red("⚠️ DEPRECATION NOTICE ⚠️")))
442 cli.renderer.Warnf("%s will be retired on %s (%d days remaining)",
443 ansi.Bold("Advanced rendering mode"), formattedDate, daysUntil)
444 cli.renderer.Warnf(" Try new commands: %s", ansi.Bold(ansi.Cyan("auth0 acul config")))
445 if showCommands {
446 cli.renderer.Output("")
447 showNewConfigExamples(cli)
448 }
449 }
450
451 cli.renderer.Output("")
452 cli.renderer.Warnf(" For help: %s", ansi.Bold(ansi.Cyan("auth0 acul config --help")))
453 cli.renderer.Output("")
454
455 return nil
456}
457
458// showNewConfigExamples displays example commands for managing ACUL configurations.
459func showNewConfigExamples(cli *cli) {

Callers 2

Calls 8

BoldFunction · 0.92
CyanFunction · 0.92
GreenFunction · 0.92
RedFunction · 0.92
showNewConfigExamplesFunction · 0.85
ErrorfMethod · 0.80
OutputMethod · 0.80
WarnfMethod · 0.80

Tested by

no test coverage detected