-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
chore: remove z param from the API #2591
chore: remove z param from the API #2591
Conversation
app/Exceptions/Handler.php
Outdated
@@ -72,7 +72,6 @@ protected function buildExceptionContext(Throwable $e): array | |||
unset($params['p']); | |||
} | |||
} elseif (str_contains($context['url'], '/API/')) { | |||
unset($params['z']); |
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.
We should probably still exclude this from the exception log, as consumers will likely continue to pass it for quite some time.
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.
Yeah, that's a good point. Will revert.
There was a merge conflict here in a file I didn't touch, but seems to be resolved now |
After recognizing that the username (z) param in the API calls doesn't affect anything, I started investigating why we weren't ensuring that the provided API key (y param) matches
User->APIKey
. I thought this to be a bug, but it appears that Laravel doesn't need the username.It looks like the way that the auth guards are designed (by Laravel, not RA), providing an API token is all you need. https://laravel.com/docs/5.8/api-authentication
From what I am reading online, there doesn't seem to be any reason to include username and API token. From what I can tell, we aren't even ingesting the z= value anywhere in our API for auth purposes.
AuthServiceProvider.php seems like it used to with an override, but even that isn't set up right (it is also commented out).
TL;DR – the z param on API requests seems to be unnecessary. The API token should be the sole authentication method.