Add netrc helpers in EvaluatorSettings.pkl (#1817)

This adds the `netRcHeaders` helper method that parses netrc file contents, and returns a mapping suitable to be used as Http headers.
This commit is contained in:
Yarden Bar
2026-09-09 14:25:06 -07:00
committed by GitHub
parent 713adac824
commit c95b3d11f4
9 changed files with 1007 additions and 0 deletions
+11
View File
@@ -300,6 +300,17 @@ class Http {
/// <https://pkl-lang.org/main/current/language-reference/index.html#glob-patterns>.
@Since { version = "0.32.0" }
headers: Mapping<String(isGlobPattern), HttpHeaders>?
/// Returns parsed headers from the given netrc file contents.
///
/// Example:
/// ```
/// headers = netRcHeaders(read("/path/to/.netrc"))
/// ```
@Since { version = "0.33.0" }
external function netRcHeaders(
contents: String | Resource,
): Mapping<String(isGlobPattern), HttpHeaders>
}
/// Settings that control how Pkl talks to HTTP proxies.