OCaml HTTP cookie handling library with support for Eio-based storage jars

release prep

+17 -2
.gitignore
···
-
_build
-
.*.swp
+
# OCaml build artifacts
+
_build/
+
*.install
+
*.merlin
+
+
# Third-party sources (fetch locally with opam source)
+
third_party/
+
+
# Editor and OS files
+
.DS_Store
+
*.swp
+
*~
+
.vscode/
+
.idea/
+
+
# Opam local switch
+
_opam/
+5 -1
.tangled/workflows/build.yml
···
- bzip2
- gcc
- ocaml
+
- pkg-config
steps:
- name: opam
command: |
-
opam init --disable-sandboxing -any
+
opam init --disable-sandboxing -a -y
+
- name: repo
+
command: |
+
opam repo add aoah https://tangled.org/anil.recoil.org/aoah-opam-repo.git
- name: switch
command: |
opam install . --confirm-level=unsafe-yes --deps-only
+5
bin/cookeiocat.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
let () =
Eio_main.run @@ fun env ->
let args = Sys.argv in
+3 -2
cookeio.opam
···
authors: ["Anil Madhavapeddy"]
license: "ISC"
homepage: "https://tangled.sh/@anil.recoil.org/ocaml-cookeio"
+
doc: "https://tangled.sh/@anil.recoil.org/ocaml-cookeio"
bug-reports: "https://tangled.sh/@anil.recoil.org/ocaml-cookeio/issues"
depends: [
"ocaml" {>= "5.2.0"}
-
"dune" {>= "3.20"}
-
"logs" {>= "0.9.0"}
+
"dune" {>= "3.20" & >= "3.20"}
+
"logs" {>= "0.10.0"}
"ptime" {>= "1.1.0"}
"eio_main"
"alcotest" {with-test}
+5 -3
dune-project
···
(homepage "https://tangled.sh/@anil.recoil.org/ocaml-cookeio")
(maintainers "Anil Madhavapeddy <anil@recoil.org>")
(bug_reports "https://tangled.sh/@anil.recoil.org/ocaml-cookeio/issues")
+
(documentation "https://tangled.sh/@anil.recoil.org/ocaml-cookeio")
(maintenance_intent "(latest)")
(package
···
(description "Cookeio provides cookie parsing and serialization for OCaml applications. It handles parsing Set-Cookie and Cookie headers with full support for all cookie attributes.")
(depends
(ocaml (>= 5.2.0))
-
dune
-
(logs (>= 0.9.0))
+
(dune (>= 3.20))
+
(logs (>= 0.10.0))
(ptime (>= 1.1.0))
eio_main
-
(alcotest :with-test)))
+
(alcotest :with-test)
+
(odoc :with-doc)))
+5
lib/core/cookeio.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
let src = Logs.Src.create "cookeio" ~doc:"Cookie management"
module Log = (val Logs.src_log src : Logs.LOG)
+5
lib/core/cookeio.mli
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
(** Cookie management library for OCaml
HTTP cookies are a mechanism that allows "server side connections to store
+5
lib/jar/cookeio_jar.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
let src = Logs.Src.create "cookie_jar" ~doc:"Cookie jar management"
module Log = (val Logs.src_log src : Logs.LOG)
+5
lib/jar/cookeio_jar.mli
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
(** Cookie jar for storing and managing HTTP cookies.
This module provides a complete cookie jar implementation following
+5
test/test_cookeio.ml
···
+
(*---------------------------------------------------------------------------
+
Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
+
SPDX-License-Identifier: ISC
+
---------------------------------------------------------------------------*)
+
open Cookeio
open Cookeio_jar