(cfg *AttestationAddOpts)
| 60 | } |
| 61 | |
| 62 | func NewAttestationAdd(cfg *AttestationAddOpts) (*AttestationAdd, error) { |
| 63 | opts := []crafter.NewOpt{crafter.WithLogger(&cfg.Logger)} |
| 64 | if cfg.RegistryServer != "" && cfg.RegistryUsername != "" && cfg.RegistryPassword != "" { |
| 65 | cfg.Logger.Debug().Str("server", cfg.RegistryServer).Str("username", cfg.RegistryUsername).Msg("using OCI registry credentials") |
| 66 | opts = append(opts, crafter.WithOCIAuth(cfg.RegistryServer, cfg.RegistryUsername, cfg.RegistryPassword)) |
| 67 | } |
| 68 | if cfg.NoStrictValidation { |
| 69 | opts = append(opts, crafter.WithNoStrictValidation(cfg.NoStrictValidation)) |
| 70 | } |
| 71 | |
| 72 | return &AttestationAdd{ |
| 73 | ActionsOpts: cfg.ActionsOpts, |
| 74 | newCrafterOpts: &newCrafterOpts{cpConnection: cfg.CPConnection, opts: opts}, |
| 75 | casURI: cfg.CASURI, |
| 76 | casCAPath: cfg.CASCAPath, |
| 77 | connectionInsecure: cfg.ConnectionInsecure, |
| 78 | localStatePath: cfg.LocalStatePath, |
| 79 | }, nil |
| 80 | } |
| 81 | |
| 82 | var ErrAttestationNotInitialized = errors.New("attestation not yet initialized") |
| 83 |
no test coverage detected