-
Notifications
You must be signed in to change notification settings - Fork 143
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
Access-Control-Allow-Origin #267
Open
shocknet-justin
wants to merge
4
commits into
lnurl:luds
Choose a base branch
from
shocknet-justin:patch-3
base: luds
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I still disagree with the reference to reverse proxies. A reverse proxy is something completely separate and controlled by the user or platform, not by the application developer.
A reverse proxy is not always part of the application stack, and not under the control of an app developer. For example, BTCPay, which supports LNUrl, can be run on StartOS, Umbrel, ... which may already include a reverse proxy.
Requiring this for apps themselves means apps are correct without users externally modifying something about the app's responses.
If we impose this rule on reverse proxies, a lot of people are going to set
Access-Control-Allow-Origin: *
for all routes, which will make apps insecure.Clearly putting the responsibility on the app developer is much better imo.
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.
That's a very niche subset of reverse proxies and afaik they function more as gateways than reverse proxies, an umbrel user exposing services to the internet would need to reconfigure the reverse proxy anyway for things like SSL and so on... I also explicitly mentioned the directive for the endpoint, of which there would be many in an box like that for various apps
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.
Still, these proxies are controlled by the user and not the application developer, who is responsible for implementing the spec.
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.
By exposing an umbrel etc to the internet the user is now a service provider, the box is the application including the customized reverse proxy configuration
It's services that need these fixes, not users.
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.
Every other part of the spec is implemented by app developers, not users. All of these services have implemented LNURL. No user configured the LNURL handling in their reverse proxy or has to read the spec. Application & library developers have to know them, however.
The application can do this, and the reverse proxy is not needed for such functionality, so it should be part of the app.
Saying "our app may support LNURL" is incredibly bad as a developer and complicates setup for users unnecessarily.
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.
I think the spec should talk about apps, and then service providers can fix invalid apps if they choose so, but that should be outside of the spec.
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.
Apps are geared towards services, services which are run by operators that may be trying to figure out why teir app isn't working in certian cases- including searching on the CORS error from their browser
A reference to app directives gives both sides the information they need, and doesn't imply app developers shouldn't do it directly
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.
But it may lead app developers to put the responsibility onto users. Not mentioning reverse proxies makes it clear app developers must do it.
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.
The responsibility is already on operators of broken services to fix them, a bad app developer or unmaintained app will deviate no matter whats added to the spec and so verbiage is warranted for both configurations
It's also fair for an app to simply document the external requirement just as it might SSL
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.
Then the app is just broken. The spec is written for correct apps, not for broken apps.
CORS is something completely different from SSL. For CORS, an app should always handle it itself, because the app developers know what CORS rules are safe.