-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_types.go
99 lines (76 loc) · 2.82 KB
/
http_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
"github.com/zeiss/typhoon/pkg/apis/common/v1alpha1"
)
// +genclient
// +genreconciler
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// HTTPTarget is the Schema for an HTTP Target.
type HTTPTarget struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HTTPTargetSpec `json:"spec"`
Status v1alpha1.Status `json:"status,omitempty"`
}
// Check the interfaces the event target should be implementing.
var (
_ v1alpha1.EventSource = (*HTTPTarget)(nil)
_ v1alpha1.EventReceiver = (*HTTPTarget)(nil)
_ v1alpha1.Reconcilable = (*HTTPTarget)(nil)
_ v1alpha1.AdapterConfigurable = (*HTTPTarget)(nil)
)
// HTTPTargetSpec defines the desired state of the event target.
type HTTPTargetSpec struct {
// Response data to be used at replies.
Response HTTPEventResponse `json:"response"`
// Endpoint to connect to.
Endpoint apis.URL `json:"endpoint"`
// Method to use at requests.
Method string `json:"method"`
// Headers to be included at HTTP requests
// +optional
Headers map[string]string `json:"headers,omitempty"`
// SkipVerify disables server certificate validation.
// +optional
SkipVerify *bool `json:"skipVerify"`
// CACertificate uses the CA certificate to verify the remote server certificate.
// +optional
CACertificate *string `json:"caCertificate"`
// BasicAuthUsername used for basic authentication.
// +optional
BasicAuthUsername *string `json:"basicAuthUsername,omitempty"`
// BasicAuthPassword used for basic authentication.
// +optional
BasicAuthPassword SecretValueFromSource `json:"basicAuthPassword,omitempty"`
// OAuthClientID used for OAuth2 authentication.
// +optional
OAuthClientID *string `json:"oauthClientID,omitempty"`
// OAuthClientSecret used for OAuth2 authentication.
// +optional
OAuthClientSecret SecretValueFromSource `json:"oauthClientSecret,omitempty"`
// OAuthTokenURL used for OAuth2 authentication.
// +optional
OAuthTokenURL *string `json:"oauthTokenURL,omitempty"`
// OAuthScopes used for OAuth2 authentication.
// +optional
OAuthScopes *[]string `json:"oauthScopes,omitempty"`
// Adapter spec overrides parameters.
// +optional
AdapterOverrides *v1alpha1.AdapterOverrides `json:"adapterOverrides,omitempty"`
}
// HTTPEventResponse for reply events context.
type HTTPEventResponse struct {
// EventType for the reply.
EventType string `json:"eventType"`
// EventSource for the reply.
EventSource string `json:"eventSource"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// HTTPTargetList is a list of event target instances.
type HTTPTargetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []HTTPTarget `json:"items"`
}