kubewarden / policy-sdk-go

Kubewarden Policy SDK for the Go programming language
https://kubewarden.io
Apache License 2.0
8 stars 7 forks source link

refactor!: return CertificateVerficationResponse{} in VerifyCert() #74

Closed viccuad closed 8 months ago

viccuad commented 8 months ago

Description

Relates to https://github.com/kubewarden/cel-policy/issues/15.

pkg/capabilities/VerifyCert() returns a (bool, err). In the case that it returns (false, err), the error is not a runtime error but it may contain the reason for the failed certificate verification.

Return a (CertificateVerficationResponse{},err) instead, which contains the bool trusted and a reason, or a runtime error.

Test

CI.

Additional Information

Tradeoff

Potential improvement