Skip to content

Commit

Permalink
CIP Domain Validation: Clarify DNS/HTTP(S) method
Browse files Browse the repository at this point in the history
Methods are considered to be used even if their results are malformed or
empty.
  • Loading branch information
HeptaSean committed Sep 25, 2022
1 parent 3638814 commit 891932a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
13 changes: 9 additions & 4 deletions CIP--HeptaSean-DomainValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ For a DNS domain, all related addresses are found by:
`/.well-known/cardano/addresses.json` at the given domain.
If a JSON file is obtained, all addresses given in this JSON file are
considered HTTP(S)-related addresses.
* If both, HTTP(S)-related addresses and DNS-related addresses are found,
only their intersection is the set of related addresses.
If one of the sets is found, it is the set of related addresses.
If none is found, the set of related addresses is empty.
* If both methods are used, the intersection of HTTP(S)-related addresses
and DNS-related addresses is the set of related addresses.
If only one method is used, its result is the set of related addresses.
If none of the methods is used, the set of related addresses is empty.

Observe that if at least one TXT record for the DNS method or a JSON file
for the HTTP(S) method is found, the method is considered to be used even
if the content of the TXT record is not a valid address or the JSON file is
malformed.

If the relation is established in both directions, applications can give a
rating to the verification, for example, one star for DNS, one for HTTP,
Expand Down
10 changes: 6 additions & 4 deletions CIP--HeptaSean-DomainValidation/cardano-domain-validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ def query_domain(domain: str) -> Tuple[Dict[str, Dict[str, Any]], int]:
"""Query DNS and HTTP(S) for Cardano addresses and combine results.
From CIP:
* If both, HTTP(S)-related addresses and DNS-related addresses are
found, only their intersection is the set of related addresses.
If one of the sets is found, it is the set of related addresses.
If none is found, the set of related addresses is empty.
* If both methods are used, the intersection of HTTP(S)-related
addresses and DNS-related addresses is the set of related addresses.
If only one method is used, its result is the set of related
addresses.
If none of the methods is used, the set of related addresses is
empty.
Returns a pair consisting of
* a dictionary from addresses to dictionaries of additional metadata
Expand Down

0 comments on commit 891932a

Please sign in to comment.