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
{{ message }}
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: docs/api.md
+134
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ This document contains the API documentation for both Events and Configuration A
9
9
1.[Event Definition](#event-definition)
10
10
1.[How To Emit an Event](#how-to-emit-an-event)
11
11
1.[HTTP Request Event](#http-request-event)
12
+
1.[CORS](#cors)
12
13
1.[Legacy Mode](#legacy-mode)
13
14
1.[Configuration API](#configuration-api)
14
15
1.[Event Types](#event-types)
@@ -29,6 +30,11 @@ This document contains the API documentation for both Events and Configuration A
29
30
1.[Delete Subscription](#delete-subscription)
30
31
1.[Get Subscriptions](#get-subscriptions)
31
32
1.[Get Subscription](#get-subscription)
33
+
1.[CORS](#cors-1)
34
+
1.[Create CORS Configuration](#create-cors-configuration)
35
+
1.[Update CORS Configuration](#update-cors-configuration)
36
+
1.[Delete CORS Configuration](#delete-cors-configuration)
37
+
1.[Get CORS Configuration](#get-cors-configuration)
32
38
1.[Prometheus Metrics](#prometheus-metrics)
33
39
1.[Status](#status)
34
40
@@ -86,6 +92,14 @@ CloudEvent created by Event Gateway where `data` field has the following structu
86
92
*`params` - `object` - matched path parameters
87
93
*`body` - depends on `Content-Type` header - request payload
88
94
95
+
### CORS
96
+
97
+
By default cross-origin resource sharing (CORS) is disabled. CORS is configured per-method/path basis using
98
+
[CORS Configuration API](#cors-1).
99
+
100
+
Event Gateway handles preflight `OPTIONS` requests for you. You don't need to setup subscription for `OPTIONS` method
101
+
because the Event Gateway will respond with all appropriate headers.
102
+
89
103
### Legacy Mode
90
104
91
105
*Legacy mode is deprecated and will be removed in upcoming releases.*
@@ -200,6 +214,8 @@ JSON object:
200
214
*`name` - `string` - event type name
201
215
*`authorizerId` - `string` - authorizer function ID
202
216
217
+
---
218
+
203
219
#### Get Event Type
204
220
205
221
**Endpoint**
@@ -350,6 +366,8 @@ JSON object:
350
366
*`functionId` - `string` - function ID
351
367
*`provider` - `object` - provider specific information about a function
352
368
369
+
---
370
+
353
371
#### Get Function
354
372
355
373
**Endpoint**
@@ -478,6 +496,8 @@ JSON object:
478
496
*`method` - `string` - HTTP method that accepts requests
479
497
*`path` - `string` - path that accepts requests, starts with `/`
480
498
499
+
---
500
+
481
501
#### Get Subscription
482
502
483
503
**Endpoint**
@@ -501,6 +521,120 @@ JSON object:
501
521
*`method` - `string` - HTTP method that accepts requests
502
522
*`path` - `string` - path that accepts requests, starts with `/`
503
523
524
+
### CORS
525
+
526
+
#### Create CORS Configuration
527
+
528
+
**Endpoint**
529
+
530
+
`POST <Configuration API URL>/v1/spaces/<space>/cors`
531
+
532
+
**Request**
533
+
534
+
*`method` - `string` - endpoint method
535
+
*`path` - `string` - endpoint path
536
+
*`allowedOrigins` - `array` of `string` - list of allowed origins. An origin may contain a wildcard (\*) to replace 0 or more characters (i.e.: http://\*.domain.com), default: `*`
537
+
*`allowedMethods` - `array` of `string` - list of allowed methods, default: `HEAD`, `GET`, `POST`
538
+
*`allowedHeaders` - `array` of `string` - list of allowed headers, default: `Origin`, `Accept`, `Content-Type`
0 commit comments