Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arns): enforce undername limit #234

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

dtfiedler
Copy link
Collaborator

@dtfiedler dtfiedler commented Nov 14, 2024

The ANTs provide the sorted array of records in resolution order. We are now enforcing the undername limits and returning a 402 to arns names that are not supported. Additional X-ArNS-Limit and X-ArNS-Index headers are added to indicate where the name/undername is in the list of records returned by the ANT.

❯ curl -I http://localhost:3000 -H 'Host: turtles.example.com'
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: X-ArNS-Resolved-Id,X-ArNS-TTL-Seconds,X-ArNS-Process-Id,X-ArNS-Resolved-At
X-ArNS-Resolved-Id: 4jBV3ofWh41KhuTs2pFvj-KBZWUkbrbCYlJH0vLA6LM
X-ArNS-TTL-Seconds: 3600
X-ArNS-Process-Id: U2dlP4DMMZFO82tWzcDfcgNGq5aGYY6CU84oeHAfNHE
X-ArNS-Resolved-At: 1731610778844
X-ArNS-Limit: 100
X-ArNS-Index: 0
Cache-Control: public, max-age=3600
Accept-Ranges: bytes
X-Cache: MISS
X-AR-IO-Hops: 1
Content-Type: text/html; charset=utf-8
Content-Length: 5
Date: Thu, 14 Nov 2024 18:59:38 GMT
Connection: keep-alive
Keep-Alive: timeout=5

❯ curl -I http://localhost:3000 -H 'Host: baby_turtles.example.com'
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: X-ArNS-Resolved-Id,X-ArNS-TTL-Seconds,X-ArNS-Process-Id,X-ArNS-Resolved-At
X-ArNS-Resolved-Id: KmCzrswTGzRTSzNx2oyke2M_x6mSUf5jIOvyItGOnkg
X-ArNS-TTL-Seconds: 3600
X-ArNS-Process-Id: U2dlP4DMMZFO82tWzcDfcgNGq5aGYY6CU84oeHAfNHE
X-ArNS-Resolved-At: 1731610792864
X-ArNS-Limit: 100
X-ArNS-Index: 1
Cache-Control: public, max-age=3600
Accept-Ranges: bytes
X-Cache: MISS
X-AR-IO-Hops: 1
Content-Type: image/jpeg
Content-Length: 577710
Date: Thu, 14 Nov 2024 18:59:53 GMT
Connection: keep-alive
Keep-Alive: timeout=5

@dtfiedler dtfiedler force-pushed the PE-7089-enforce-undername-limits branch from 6d1eb4d to e07f53c Compare November 14, 2024 19:06
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.47%. Comparing base (0d3e2a9) to head (3a1a711).
Report is 15 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #234      +/-   ##
===========================================
+ Coverage    68.46%   68.47%   +0.01%     
===========================================
  Files           33       33              
  Lines         8139     8144       +5     
  Branches       435      435              
===========================================
+ Hits          5572     5577       +5     
  Misses        2565     2565              
  Partials         2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

The ANTs provide the sorted array of records in resolution order. We are now enforcing the undername limits and returning a 402 to arns names that are not supported. Additional `X-ArNS-Limit` and `X-ArNS-Index` headers are added to indicate where the name/undername is in the list of records returned by the ANT.
@dtfiedler dtfiedler force-pushed the PE-7089-enforce-undername-limits branch from e07f53c to 7f8893a Compare November 14, 2024 19:09
dtfiedler added 2 commits November 14, 2024 13:18
Operators can toggle this off if they are willing to resolve more arns names than a name owner has paid for.
We will likely make this default to true before release, but for now set to false to avoid breaking any existing behavior
@dtfiedler
Copy link
Collaborator Author

We'll create an ADR for this before we finalize the implementation. Will keep the PR in draft and link that once created.

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