Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Remove csrf endpoint once clients have time to upgrade #158

Open
ganemone opened this issue Oct 30, 2018 · 5 comments
Open

Remove csrf endpoint once clients have time to upgrade #158

ganemone opened this issue Oct 30, 2018 · 5 comments

Comments

@ganemone
Copy link
Contributor

After simplifying the plugin we can now remove the csrf endpoint. However, we should wait some time for clients to have time to upgrade.

@chrisirhc
Copy link

chrisirhc commented Dec 28, 2018

I saw that this endpoint is only on the POST method. However, doesn't the Uber internal xhr mechanism expect a csrf-token endpoint on the GET (see reference)?
Is this for external clients? Wouldn't it make more sense for this to also handle the GET method as well?

if (ctx.path === '/csrf-token' && ctx.method === 'POST') {

@ganemone
Copy link
Contributor Author

The internal implementation is being phased out in favor of this implementation. Technically we are phasing out token refreshing all together so eventually you won't need to hit any endpoint at all.

@chrisirhc
Copy link

I understand it is being phased out.
I'm saying the quoted POST endpoint doesn't seem to serve any purpose if it doesn't handle the legacy compatibility use cases in the internal implementation, since internal implementation uses GET, not POST.

To handle an internal legacy migration that depend on components that aren't yet fusion/fetch compatible, I needed to create a compatibility plugin with this same code but for GET.

@ganemone
Copy link
Contributor Author

ganemone commented Jan 2, 2019

The purpose is to allow clients to gradually upgrade to the newer server version. The internal csrf protection is not designed to be used with this library. That is entirely separate.

@chrisirhc
Copy link

You meant old clients of this plugin. Gotcha.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants