package com.correx.core.events.events

import com.correx.core.events.types.SessionId
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * Grants additional egress [hosts] for this session (e.g. the hosts drawn from an approved
 * research source list). Additive to the static `networkAllowedHosts` allow-list: a host is
 * permitted if it matches the static list OR any host granted to the session, so egress can be
 * widened per-session without loosening the global default. Host matching honours the same
 * exact-or-suffix semantics the static allow-list uses (a granted "example.com" covers
 * "api.example.com"). [reason] is free-form operator context (e.g. which source list was approved).
 */
@Serializable
@SerialName("EgressHostsGranted")
data class EgressHostsGrantedEvent(
    val sessionId: SessionId,
    val hosts: Set<String>,
    val reason: String = "",
) : EventPayload
