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
REST amDigestAuthenticated doesn't work with framework modules #49
Comments
Index: src/Codeception/Lib/Connector/Guzzle.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Codeception/Lib/Connector/Guzzle.php (revision 2e51a84355f69b8b091abdac497a21a2ebc5621c)
+++ src/Codeception/Lib/Connector/Guzzle.php (revision f057e640435466d64a929faa69a4a9cafb8a4da5)
@@ -79,13 +79,18 @@
unset($this->requestOptions['headers'][$name]);
}
- public function setAuth($username, $password)
+ /**
+ * @param string $username
+ * @param string $password
+ * @param string $type Default: 'basic'
+ */
+ public function setAuth($username, $password, $type='basic')
{
if (!$username) {
unset($this->requestOptions['auth']);
return;
}
- $this->requestOptions['auth'] = [$username, $password];
+ $this->requestOptions['auth'] = [$username, $password, $type];
}
/**
Index: src/Codeception/Lib/Connector/Guzzle6.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Codeception/Lib/Connector/Guzzle6.php (revision 2e51a84355f69b8b091abdac497a21a2ebc5621c)
+++ src/Codeception/Lib/Connector/Guzzle6.php (revision f057e640435466d64a929faa69a4a9cafb8a4da5)
@@ -82,13 +82,18 @@
unset($this->requestOptions['headers'][$name]);
}
- public function setAuth($username, $password)
+ /**
+ * @param string $username
+ * @param string $password
+ * @param string $type Default: 'basic'
+ */
+ public function setAuth($username, $password, $type='basic')
{
if (!$username) {
unset($this->requestOptions['auth']);
return;
}
- $this->requestOptions['auth'] = [$username, $password];
+ $this->requestOptions['auth'] = [$username, $password, $type];
}
/**
Index: src/Codeception/Module/REST.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Codeception/Module/REST.php (revision 2e51a84355f69b8b091abdac497a21a2ebc5621c)
+++ src/Codeception/Module/REST.php (revision f057e640435466d64a929faa69a4a9cafb8a4da5)
@@ -295,7 +295,7 @@
*/
public function amDigestAuthenticated($username, $password)
{
- $this->client->setAuth($username, $password, CURLAUTH_DIGEST);
+ $this->client->setAuth($username, $password, 'digest');
}
/**
|
Oh, great, it doesn't work with any module. |
@doctorx Please make a pull request |
Naktibalda
referenced
this issue
in Naktibalda/Codeception
Aug 6, 2016
DavertMik
referenced
this issue
in Codeception/Codeception
Aug 10, 2016
* Fix REST.php amDigestAuthenticated and Guzzle (#2509) * Fix Styles (#2509)
This issue is still valid, the fix which closed this issue was for Guzzle connectors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
REST amDigestAuthenticated method doesn't work with framework modules.
https://github.com/Codeception/Codeception/blob/6f30eeb1032cff54ffcf99a87b01d8d6c839450b/src/Codeception/Module/REST.php#L263
Only Guzzle connectors have
setAuth
method.The text was updated successfully, but these errors were encountered: