# Event Forwarding Exclusions

Event Forwarding 기능은 OvenMediaEngine의 특정 Application 단위에서 각종 Event를 다음 처리 단계 (내부 또는 외부)로 전달할지 여부를 결정하는 API입니다. 이를 통해 `WebRTC`, `RTMP`, `OVT`, `SRT` 등 여러 Provider의 Event가 다음 단계로 전달되는지를 제어할 수 있으며, 주로 보안 강화와 운영 정책 제어 목적으로사용됩니다.

## API Interface

### 제외할 Event Forwarding 설정하기

기본적으로 모든 Event에 대해 Event Forwarding이 허용되어 있습니다. Event Forwarding 시, 특정 Event Format(s) 차단이 필요할 경우 `setEventForwardPolicy` API를 사용하여 지정할 수 있습니다.

이 정책은 대상 Application 내의 모든 Egress Stream에 적용됩니다.

> **Request**

<details>

<summary><mark style="color:blue;">POST</mark> /v1/vhosts/{vhost}/apps/{app}:setEventForwardPolicy</summary>

**Header**

```http
Authorization: Basic {credentials}

# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
```

**Body**

```json
{
    "dropEvent" : ["amf", "scte35"]
}
```

</details>

> **Response**

<details>

<summary><mark style="color:blue;">200</mark> Ok</summary>

The request has succeeded

**Header**

```http
Content-Type: application/json
```

**Body**

```json
{
    "message": "OK",
    "statusCode": 200
}
```

</details>

<table><thead><tr><th width="154">Parameter</th><th width="159.5555419921875" align="center">Input Type</th><th>Description</th></tr></thead><tbody><tr><td><code>dropEvent</code></td><td align="center">Array</td><td><p>Event Forading 시, 제외할 Event Format(s)을 지정합니다.</p><ul><li><code>amf</code>, <code>scte35</code>, <code>id3v2</code>, <code>webvtt</code>, <code>cue</code>, <code>oven_event</code></li></ul></td></tr></tbody></table>

{% hint style="warning" %}
User가 REST API나 `EventGeneration` XML 설정을 통해 직접 생성한 Event는 위설정과 무관하게 전송됩니다.
{% endhint %}

### Event Forwading 조회하기

> **Request**

<details>

<summary><mark style="color:blue;">GET</mark> /v1/vhosts/{vhost}/apps/{app}:EventForwardPolicy</summary>

**Header**

```http
Authorization: Basic {credentials}

# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
```

</details>

> **Response**

<details>

<summary><mark style="color:blue;">200</mark> Ok</summary>

The request has succeeded

**Header**

```
Content-Type: application/json
```

**Body**

```json
{
    "message": "OK",
    "response": {
      "dropEvent" : ["amf", "scte35"]
    }
    "statusCode": 200
}
```

</details>
