Skip to content

feat: DNS 제공자의 레코드 타입 일반화 - #121

Merged
yessjun merged 1 commit into
mainfrom
feat/dns-record-types
Sep 9, 2026
Merged

feat: DNS 제공자의 레코드 타입 일반화#121
yessjun merged 1 commit into
mainfrom
feat/dns-record-types

Conversation

@yessjun

@yessjun yessjun commented Sep 9, 2026

Copy link
Copy Markdown
Member

📝 작업내용

  • DnsRecordProviderensure(fqdn, type, values, ttl)remove(fqdn, type)를 갖고, Google 클라이언트의 rrset 경로에서 /A 하드코딩 제거
  • ensureAremoveA는 기본 메서드로 남아 플랫폼 서브도메인 경로 무변경
  • 쓰기가 받는 타입은 DnsRecordType 열거(A, AAAA, CNAME, TXT)
  • NSCAA 제외. 앞은 이름의 하위 전체를 남에게 넘기고, 뒤는 그 이름에 누가 인증서를 발급할 수 있는지 결정
  • 읽기는 존을 있는 대로 보고하므로 DnsRecord.type은 문자열 유지
  • TxtValues가 표현형과 원래 값 사이를 변환. 존이 따옴표와 이스케이프를 붙여 돌려주므로 원시 비교로는 리컨실마다 레코드를 다시 씀
  • TXT 값 255옥텟 초과는 거부. 여러 문자열로 쪼개는 것은 옥텟 단위라 멀티바이트 문자가 두 조각에 걸치고, 바이트 수준으로 다루지 않으면 값이 조용히 깨짐

⭐️ 검증

  • 테스트 1353개 통과, 실패 0, 오류 0
  • 타입 경로와 TXT 정규화 각각에 변이를 넣어 빨간불 확인 후 원복
  • TXT 시험은 처음에 거짓 초록이었음. 목이 이 클라이언트가 만드는 표현형을 그대로 되비춰 정규화를 들어내도 통과했고, 존이 값을 두 문자열로 들고 있는 모양으로 바꾼 뒤 변이를 잡음

💬 리뷰 포인트

  • 255옥텟 초과를 쪼개지 않고 거부한 선택. 지금 필요한 값은 전부 토큰이고, 쪼개기는 바이트 수준 이스케이프를 요구함
  • 쓰기 타입을 열거로 닫고 읽기 타입은 문자열로 둔 비대칭
  • DnsRecordProviderensureAremoveA를 기본 메서드로 남긴 것. 호출부 변경을 없앤 대신 같은 일을 하는 진입점이 둘이 됨

ensure and remove now name a record type, and the Google client stops
hardcoding /A in the rrset path. ensureA and removeA stay as defaults over
them, so the platform-subdomain paths that only ever want one address are
unchanged.

Writes take a DnsRecordType rather than a string: the types this platform
is willing to put in its own zone should be a list one can read, not
whatever a caller passed. NS and CAA are absent on purpose, one handing a
name's whole subtree away and the other deciding who may issue for it.
Reads stay a string, because listRecords reports the zone as it is.

TXT needs normalising on both sides of the idempotence check. DNS carries
it as a character-string and the zone API returns it quoted, so comparing
a given value against a stored one differs every time and rewrites the
record on every reconcile. TxtValues refuses anything over 255 octets
instead of splitting it: the split is on octets, a multi-byte character
straddling two chunks needs byte-level escaping to survive, and getting
that subtly wrong corrupts a value rather than failing.

The TXT test proved nothing at first — its stub echoed the exact
presentation form this client produces, so removing the normalising left
it green. It now holds the value as two character-strings, the shape
another tool writes, and both that and the type-in-path change fail under
a deliberate mutation.
@yessjun
yessjun merged commit 1c99f9c into main Sep 9, 2026
1 check passed
@yessjun
yessjun deleted the feat/dns-record-types branch September 9, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant