MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / NewAttestationInit

Function NewAttestationInit

app/cli/pkg/action/attestation_init.go:77–93  ·  view source on GitHub ↗
(cfg *AttestationInitOpts)

Source from the content-addressed store, hash-verified

75}
76
77func NewAttestationInit(cfg *AttestationInitOpts) (*AttestationInit, error) {
78 c, err := newCrafter(&newCrafterStateOpts{enableRemoteState: cfg.UseRemoteState, localStatePath: cfg.LocalStatePath}, cfg.CPConnection, crafter.WithLogger(&cfg.Logger), crafter.WithAuthRawToken(cfg.AuthTokenRaw))
79 if err != nil {
80 return nil, fmt.Errorf("failed to load crafter: %w", err)
81 }
82
83 return &AttestationInit{
84 ActionsOpts: cfg.ActionsOpts,
85 c: c,
86 dryRun: cfg.DryRun,
87 force: cfg.Force,
88 useRemoteState: cfg.UseRemoteState,
89 casURI: cfg.CASURI,
90 casCAPath: cfg.CASCAPath,
91 connectionInsecure: cfg.ConnectionInsecure,
92 }, nil
93}
94
95// returns the attestation ID
96type AttestationInitRunOpts struct {

Callers 1

newAttestationInitCmdFunction · 0.92

Calls 3

WithLoggerFunction · 0.92
WithAuthRawTokenFunction · 0.92
newCrafterFunction · 0.85

Tested by

no test coverage detected