Documentation
¶
Index ¶
- Constants
- func Canonical(h map[string][]string) http.Header
- func Execute(ctx context.Context, client *http.Client, req *triggersv1.InterceptorRequest, ...) (*triggersv1.InterceptorResponse, error)
- func Fail(c codes.Code, msg string) *triggersv1.InterceptorResponse
- func Failf(c codes.Code, format string, a ...interface{}) *triggersv1.InterceptorResponse
- func GetInterceptorParams(i *triggersv1.EventInterceptor) map[string]interface{}
- func GetSecretToken(req *http.Request, cs kubernetes.Interface, sr *triggersv1.SecretRef, ...) ([]byte, error)
- func ResolveURL(i *triggersv1.TriggerInterceptor) *url.URL
- func UnmarshalParams(ip map[string]interface{}, p interface{}) error
- type Interceptor
Constants ¶
const (
CoreInterceptorsHost = "tekton-triggers-core-interceptors"
)
const RequestCacheKey key = "interceptors.RequestCache"
Variables ¶
This section is empty.
Functions ¶
func Execute ¶ added in v0.11.0
func Execute(ctx context.Context, client *http.Client, req *triggersv1.InterceptorRequest, url string) (*triggersv1.InterceptorResponse, error)
Execute executes the InterceptorRequest using the given httpClient
func Fail ¶ added in v0.11.0
func Fail(c codes.Code, msg string) *triggersv1.InterceptorResponse
Fail constructs a InterceptorResponse that should not continue further processing.
func Failf ¶ added in v0.11.0
func Failf(c codes.Code, format string, a ...interface{}) *triggersv1.InterceptorResponse
Failf constructs a InterceptorResponse that should not continue further processing.
func GetInterceptorParams ¶ added in v0.10.0
func GetInterceptorParams(i *triggersv1.EventInterceptor) map[string]interface{}
GetInterceptorParams returns InterceptorParams for the current interceptors
func GetSecretToken ¶
func GetSecretToken(req *http.Request, cs kubernetes.Interface, sr *triggersv1.SecretRef, triggerNS string) ([]byte, error)
GetSecretToken queries Kubernetes for the given secret reference. We use this function to resolve secret material like GitHub webhook secrets, and call it once for every trigger that references it.
As we may have many triggers that all use the same secret, we cache the secret values in the request cache. TODO: we don't really use the cache here. Instead use a secretLister?
func ResolveURL ¶ added in v0.11.0
func ResolveURL(i *triggersv1.TriggerInterceptor) *url.URL
ResolveURL returns the URL for the given core interceptor
func UnmarshalParams ¶ added in v0.11.0
UnmarshalParams unmarshalls the passed in InterceptorParams into the provided param struct