From b943aedcec59f11760044301e665c87fbe58ffab Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Sat, 8 Aug 2026 23:46:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20functions=20to=20create=20the?= =?UTF-8?q?=20request=20to=20resolve=20a=20handle=20or=20lookup=20its=20dn?= =?UTF-8?q?s=20records.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/at/handle.gleam | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/at/handle.gleam b/src/at/handle.gleam index 4e03b59..f4e66c8 100644 --- a/src/at/handle.gleam +++ b/src/at/handle.gleam @@ -2,6 +2,7 @@ import at/internal/hostname import gleam/dynamic/decode.{type Decoder} +import gleam/http/request.{type Request} import gleam/json.{type Json} import gleam/string @@ -102,6 +103,10 @@ pub fn is_test(handle: Handle) -> Bool { } } +pub fn dns_hostname(handle: Handle) -> String { + "_atproto." <> handle.hostname +} + // CONVERSIONS ----------------------------------------------------------------- pub fn to_string(handle: Handle) -> String { @@ -111,3 +116,9 @@ pub fn to_string(handle: Handle) -> String { pub fn to_json(handle: Handle) -> Json { json.string(handle.hostname) } + +pub fn resolve(handle: Handle) -> Request(String) { + request.new() + |> request.set_host(handle.hostname) + |> request.set_path("/.well-known/atproto-did") +} -- knotmirror 0.0.1