-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow List #11
Allow List #11
Conversation
We could F/U with testing although really the only thing we can test here would require setting up a database in testing or mocking the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
skyd/api.go
Outdated
// allow list, it returns true if the skylink is present on the allow list | ||
func (skyd *SkydAPI) IsAllowListed(ctx context.Context, skylink string) bool { | ||
// build the request to resolve the skylink with skyd | ||
url := fmt.Sprintf("http://%s:%d/skynet/resolve/%s", skyd.staticSkydHost, skyd.staticSkydPort) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F/U: We can check if it's a V2 skylink before making a request.
Also, resolving the skylink can make a nice helper func.
PULL REQUEST
Overview
This PR adds an allow list. It's an initial version but it will give us the option to manually put allow listed (v1) skylinks in the database and have the reported/blocked skylink be verified against that list before proceeding to block it.
Example for Visual Changes
N/A
Checklist
Review and complete the checklist to ensure that the PR is complete before assigned to an approver.
Issues Closed
N/A