MCPcopy
hub / github.com/kopia/kopia / preActionLoadPEMPath

Method preActionLoadPEMPath

cli/storage_s3.go:56–69  ·  view source on GitHub ↗
(_ *kingpin.ParseContext)

Source from the content-addressed store, hash-verified

54}
55
56func (c *storageS3Flags) preActionLoadPEMPath(_ *kingpin.ParseContext) error {
57 if len(c.s3options.RootCA) > 0 {
58 return errors.New("root-ca-pem-base64 and root-ca-pem-path are mutually exclusive")
59 }
60
61 data, err := os.ReadFile(c.rootCaPemPath) //#nosec
62 if err != nil {
63 return errors.Wrapf(err, "error opening root-ca-pem-path %v", c.rootCaPemPath)
64 }
65
66 c.s3options.RootCA = data
67
68 return nil
69}
70
71func (c *storageS3Flags) preActionLoadPEMBase64(_ *kingpin.ParseContext) error {
72 caContent, err := base64.StdEncoding.DecodeString(c.rootCaPemBase64)

Callers 2

TestLoadPEMPathFunction · 0.95
TestLoadPEMBothFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestLoadPEMPathFunction · 0.76
TestLoadPEMBothFunction · 0.76