feat: DNS 제공자의 레코드 타입 일반화 - #121
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 작업내용
DnsRecordProvider가ensure(fqdn, type, values, ttl)와remove(fqdn, type)를 갖고, Google 클라이언트의 rrset 경로에서/A하드코딩 제거ensureA와removeA는 기본 메서드로 남아 플랫폼 서브도메인 경로 무변경DnsRecordType열거(A, AAAA, CNAME, TXT)NS와CAA제외. 앞은 이름의 하위 전체를 남에게 넘기고, 뒤는 그 이름에 누가 인증서를 발급할 수 있는지 결정DnsRecord.type은 문자열 유지TxtValues가 표현형과 원래 값 사이를 변환. 존이 따옴표와 이스케이프를 붙여 돌려주므로 원시 비교로는 리컨실마다 레코드를 다시 씀⭐️ 검증
💬 리뷰 포인트
DnsRecordProvider의ensureA와removeA를 기본 메서드로 남긴 것. 호출부 변경을 없앤 대신 같은 일을 하는 진입점이 둘이 됨