mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #1027] [MERGED] Support $INCLUDE for master files #1888
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1888
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/1027
Author: @kachayev
Created: 2/23/2020
Status: ✅ Merged
Merged: 3/9/2020
Merged by: @bluejekyll
Base:
master← Head:feature-master-include📝 Commits (10+)
93b916eAdd $INCLUDE, make sure that tests fail now9184e49Update FileAuthority test to try to find subdomain mentioned in INCLUDE-d filea02b57aQuick but working implementation, a lot of TODOs1cc5e70File reader to rely on Lexer to detect INCLUDE instead of manual processing5feaeeeParser to notify about expectation for INCLUDE to be inlined before parsingc390198Differentiate absolute file path and relative file path when performing INCLUDEdf4a4fdAdd comment about INCLUDE with custom origin90dbcbbMerge branch 'master' into feature-master-includeb78d712Extend logging for included filesa5b7da9Track recursion depth and about in case of overlimit📊 Changes
4 files changed (+151 additions, -24 deletions)
View changed files
📝
crates/client/src/serialize/txt/master.rs(+5 -9)📝
crates/server/src/store/file/authority.rs(+142 -14)📝
tests/test-data/named_test_configs/example.com.zone(+3 -1)➕
tests/test-data/named_test_configs/include.example.com.zone(+1 -0)📄 Description
Note: this is WIP. Sharing earlier to discuss some architectural challenges to get full support for
$INCLUDE.Because of how
Parser/Lexerare implemented right now, the approach that I took is to updateFileAuthorityloader to read file line-by-line, run each line through Lexer to detect INCLUDEs, recursively process included file and inline the result. I extended the test file with a single$INCLUDEdirective to make sure that the approach works in general. It exposes a few interesting problems tho'...Lexeris executed twice for the fileParserlogic is not very intuitive now as it requires file to be pre-processed before parsing. Error message that explains this makes it a little bit better, but overall still feels bad.$INCLUDEmight specify a different origin domain. Meaning that inclining content of the file is not enough, we should actually parse it with respect to origin.I'm not sure what's the best way forward from here because all of these couples logic of file loader/parser/lexer pretty heavily. Somewhat simple solution would be to define file loaders as a
Lexerthat internally maintains stack of nested lexers flattening stream of tokens. Problem #3 remains unsolved in this case, as far as we need to propagate not only the token, but current origin as well.@bluejekyll What do you think?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.