package com.cameleer.server.core.http;

import java.time.Duration;
import java.util.List;

public record OutboundHttpRequestContext(
        TrustMode trustMode,
        List<String> trustedCaPemPaths,
        Duration connectTimeout,
        Duration readTimeout
) {
    public OutboundHttpRequestContext {
        if (trustMode == null) trustMode = TrustMode.SYSTEM_DEFAULT;
        trustedCaPemPaths = trustedCaPemPaths == null ? List.of() : List.copyOf(trustedCaPemPaths);
    }

    public static OutboundHttpRequestContext systemDefault() {
        return new OutboundHttpRequestContext(TrustMode.SYSTEM_DEFAULT, List.of(), null, null);
    }
}
