Documentation
¶
Overview ¶
Package submitter is L8 of the SigComply CLI: optional cloud submission. Acquires an OIDC token from the CI provider (GitHub Actions, GitLab CI) and POSTs the SubmissionPayload — and only the SubmissionPayload — to {cloud_base_url}/api/v1/runs. Submission failures are logged, never fatal.
See docs/architecture/02-layers.md for the full layer contract.
Package submitter is L8 of the SigComply CLI: optional cloud submission. Acquires an OIDC token from the CI provider (GitHub Actions or GitLab CI) and POSTs the core.SubmissionPayload — and only the SubmissionPayload — to {cloud_base_url}/api/v1/runs. Submission failures are logged, never fatal.
See docs/architecture/02-layers.md §L8 and 06-aggregation.md.
Index ¶
Constants ¶
const DefaultAudience = "https://api.sigcomply.com"
DefaultAudience is the OIDC token audience the CLI requests when running in CI. Self-hosted deployments override via the OIDC.Audience field.
const Path = "/api/v1/runs"
Path is the cloud endpoint relative to base_url.
Variables ¶
var ErrNoToken = fmt.Errorf("submitter: no OIDC token source detected")
ErrNoToken is returned by providers when no token source is available in the environment.
Functions ¶
Types ¶
type Decision ¶
type Decision int
Decision is the result of evaluating whether to submit.
type Options ¶
type Options struct {
BaseURL string // e.g. "https://api.sigcomply.com" — empty disables submission.
Force bool // true if --cloud was passed; require submission.
Disable bool // true if --no-cloud was passed; never submit.
// HTTPClient is injected by tests; nil defaults to a 30s-timeout
// http.Client.
HTTPClient *http.Client
// TokenProvider is injected by tests; nil uses the auto-detected
// CI providers (GitHub Actions, GitLab CI).
TokenProvider TokenProvider
// CLIVersion is stamped in the X-Sigcomply-CLI-Version header.
CLIVersion string
}
Options control whether and where to submit.
type TokenProvider ¶
type TokenProvider interface {
Token(ctx context.Context, audience string) (token, providerName string, err error)
}
TokenProvider returns an OIDC token suitable for cloud authentication. The returned providerName drives the X-OIDC-Provider header.
func DefaultTokenProvider ¶
func DefaultTokenProvider() TokenProvider
DefaultTokenProvider returns a TokenProvider that tries GitHub Actions then GitLab CI, returning ErrNoToken if neither is available.