(override bool)
| 125 | } |
| 126 | |
| 127 | func askForConsent(override bool) { |
| 128 | if override { |
| 129 | // If the override boolean is set to true, we know that the operator does not have consent for this app, asking for an override |
| 130 | fmt.Fprint(os.Stderr, io.BoldRed("You do not have consent for this app, Override ? (y/n) ")) |
| 131 | } else { |
| 132 | // If the override boolean is set to false, we do not know if the operator has consent for this app, asking for confirmation |
| 133 | fmt.Fprint(os.Stderr, "Do you have consent to access this app? (y/n) ") |
| 134 | } |
| 135 | var confirm string |
| 136 | fmt.Scanln(&confirm) |
| 137 | if confirm != "y" && confirm != "Y" { |
| 138 | fmt.Fprintln(os.Stderr, io.BoldRed("No consent given, stopping...")) |
| 139 | os.Exit(1) |
| 140 | } |
| 141 | fmt.Fprintln(os.Stderr) |
| 142 | } |
| 143 | |
| 144 | func checkAccessContent(t *time.Time) bool { |
| 145 | value := t != nil && t.After(time.Now()) |
no test coverage detected