You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 0006-B-external-service-invocation.md
+38-13Lines changed: 38 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Cons:
85
85
86
86
How will this work, technically?
87
87
88
-
Allow configuration of pieces needed for external service invocation through creation of new CRD titled `ExternalHTTPEndpoint`.
88
+
Allow configuration of pieces needed for external service invocation through creation of new CRD titled `HTTPEndpoint`.
89
89
It is HTTP specific in it's `Kind`.
90
90
This has benefits in being obvious upfront that it supports only `http`,
91
91
and makes it to where we do not need `spec.allowed.protocols`.
@@ -94,30 +94,51 @@ The sample `yaml` file snippet below represents the proposed configuration.
94
94
95
95
```
96
96
apiVersion: dapr.io/v1alpha1
97
-
kind: ExternalHTTPEndpoint
97
+
kind: HTTPEndpoint
98
98
metadata:
99
-
name: externalserviceinvocation
99
+
name: "github"
100
100
spec:
101
-
allowed:
102
-
- name: github
103
-
baseUrl: "github.com"
104
-
headers:
105
-
- "Accept-Language": "en-US"
106
-
metadata:
107
-
- name: mymetadata
101
+
baseUrl: "http://api.github.com"
102
+
headers:
103
+
- name: "Accept-Language"
104
+
value: "en-US"
105
+
- name: "Content-Type"
106
+
value: "application/json"
107
+
- name: "Authorization"
108
108
secretKeyRef:
109
-
name: my-secret
110
-
key: mymetadataSecret
109
+
name: "my-secret"
110
+
key: "mymetadataSecret"
111
111
auth:
112
-
secretStore: my-secretstore
112
+
secretStore: "my-secretstore"
113
113
```
114
114
115
+
Noteworthy caveat:
116
+
If `Authorization` header is specified,
117
+
then it is assumed that the [auth-scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) prefix (ie token, basic, etc)
118
+
is specified within the value for the `Authorization` header field.
119
+
This allows for headers to match with the existing HTTP header schema,
120
+
thus leading to a better user experience that is straightforward to use.
121
+
115
122
Implementation for external service invocation will sit alongside the existing service invocation building block implementation with API changes to support external invocation.
116
123
117
124
User facing changes include overriding the URL when calling Dapr for service invocation.
118
125
Users will use the existing service invocation API, but instead of using an app ID,
119
126
they can use an external URL and optionally overwrite fields at the time of invocation.
120
127
128
+
To summarize, there would be two ways of working with external service invocations:
129
+
1. The URL format programatically.
130
+
This allows for convenience and includes a single HTTP call.
131
+
2. HTTPEndpoint resource creation declaratively,
132
+
where the `HTTPEndpoint.Name` would be used as the AppId in the existing service invocation URL.
0 commit comments