MCPcopy
hub / github.com/getsops/sops / prompt

Method prompt

keyservice/server.go:266–280  ·  view source on GitHub ↗
(key *Key, requestType string)

Source from the content-addressed store, hash-verified

264}
265
266func (ks Server) prompt(key *Key, requestType string) error {
267 keyString := keyToString(key)
268 var response string
269 for response != "y" && response != "n" {
270 fmt.Printf("\nReceived %s request using %s. Respond to request? (y/n): ", requestType, keyString)
271 _, err := fmt.Scanln(&response)
272 if err != nil {
273 return err
274 }
275 }
276 if response == "n" {
277 return status.Errorf(codes.PermissionDenied, "Request rejected by user")
278 }
279 return nil
280}
281
282// Decrypt takes a decrypt request and decrypts the provided ciphertext with the provided key, returning the decrypted
283// result

Callers 2

EncryptMethod · 0.95
DecryptMethod · 0.95

Calls 1

keyToStringFunction · 0.85

Tested by

no test coverage detected