Problem/Motivation
After including simple_oauth, phpunit tests started giving this warning:
Passing a third argument to "Symfony\Component\HttpFoundation\HeaderBag::get()" is deprecated since Symfony 4.4, use method "all()" instead
The only instance where a third parameter is passed is in this method, which is invoked on all requests as part of the simple_oauth Authentication Provider:
/**
* {@inheritdoc}
*/
public function isOauth2Request(Request $request) {
// Check the header. See: http://tools.ietf.org/html/rfc6750#section-2.1
// We have to perform also an exact match, as if no token is provided then
// the LWS might be stripped, but we still have to detect this as OAuth2
// authentication. See: https://www.ietf.org/rfc/rfc2616.txt
$auth_header = trim($request->headers->get('Authorization', '', TRUE));
return (strpos($auth_header, 'Bearer ') !== FALSE) || ($auth_header === 'Bearer');
}
Steps to reproduce
It looks like this would be a problem in both the 4.x and 5.x branches installed in Drupal 9 with Symfony HTTP Foundation ^4.4
Example of the failing test: https://github.com/paul121/farmOS/runs/1199433286?check_suite_focus=true...
farmOS phpunit config (inherits from Drupal config): https://github.com/farmOS/farmOS/blob/2.x/docker/dev/Dockerfile#L57
Comment | File | Size | Author |
---|---|---|---|
#2 | 3174572-2.patch | 807 bytes | paul121 |
Comments
Comment #2
paul121 CreditAttribution: paul121 commentedComment #3
paul121 CreditAttribution: paul121 commentedComment #4
paul121 CreditAttribution: paul121 commentedComment #5
bradjones1Fixed this in the course of getting CI set back up. https://git.drupalcode.org/project/simple_oauth/-/commit/c992eb8bcc7c14d...