MCPcopy Create free account
hub / github.com/Scalingo/cli / askForConsent

Function askForConsent

utils/consent.go:127–142  ·  view source on GitHub ↗
(override bool)

Source from the content-addressed store, hash-verified

125}
126
127func 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
144func checkAccessContent(t *time.Time) bool {
145 value := t != nil && t.After(time.Now())

Callers 1

CheckForConsentFunction · 0.85

Calls 1

BoldRedFunction · 0.92

Tested by

no test coverage detected