-
Notifications
You must be signed in to change notification settings - Fork 86
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 links to be saved without known owner #72
Conversation
3cbcbe8
to
8ef119a
Compare
ad14992
to
724238f
Compare
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.
One comment. Otherwise LGTM.
If the current user can't be determined (either because of a legitimate error within the localapi client, or the user is coming through a subnet router and doesn't have a Tailscale IP address), and the -allow-unknown-users flag is set, then go ahead and save new links without an owner. By saving links without an owner, these unknown users can continue to modify the link, and actual Tailscale users can take ownership. Once the link is owned, it can no longer be modified by anyone other than the owner. Links that use the current user by having `{{ .User }}` in their long URL cannot be resolved by unknown users and will return an error. Fixes #60 Signed-off-by: Will Norris <[email protected]>
724238f
to
1838c9e
Compare
Signed-off-by: Will Norris <[email protected]>
22b6b3a
to
fe06ab3
Compare
@kradalby I'm not sure what this nix build error means. I tried running the update-flake.sh script, which yeilded a new signature, but apparently it still doesn't match what nix is looking for? I'm going to submit this anyway, and we can try to address the nix issue later. |
Strange, I opened #76 to address this, the weird part is that I just ran update-flake.sh and it worked. |
If the current user can't be determined (either because of a legitimate error within the localapi client, or the user is coming through a subnet router and doesn't have a Tailscale IP address), go ahead and save the link without an owner. We are assuming that the requester should have permission to create links simply by virtue of being able to connect to the golink instance.
By saving links without an owner, these unknown users can continue to modify the link, and actual Tailscale users can take ownership. Once the link is owned, it can no longer be modified by anyone other than the owner.
The one potentially undesirable behavior this could introduce is if someone is serving their golink server over Funnel or any other public-facing proxy. Previously, that would have made golink read-only for non-Tailscale users. This change would make it read-write (for new links). Users desiring the old behavior would need to make their public-facing proxy only allow GET requests.
Fixes #60