[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] Getting Github Milestones via Basic Authentcation



So the issue that needs to be addressed is that the Socket transport doesn't properly deal with the user credentials.

Ian

On Monday, 24 March 2014 21:50:58 UTC-4, Eric wrote:
Hi Ian,

Yes I get the same:

int(0) int(0) 
Fatal error: Uncaught exception 'DomainException' with message 'Not Found' in /home/pbbookin/public_html/j25comm/modules/mod_githubmodule/vendor/joomla/github/src/AbstractGithubObject.php:128 Stack trace: #0 

If it matters I am running this on a CentOS VPS.

Eric.


On 25/03/2014, at 11:34 AM, Ian <ianl... AT gmail.com> wrote:

Can you dump your github object and see what transport is being used?

I have the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');

use Joomla\Github\Github;
use Joomla\Github\Http;
use Joomla\Http\Transport;
use Joomla\Registry\Registry;

$options = new Registry;
$options->set('api.username', $username);
$options->set('api.password', $password);

$curl = new Transport\Curl();
$stream = new Transport\Stream();
$socket = new Transport\Socket();

$httpCurl = new Http(array(), $curl);
$httpStream = new Http(array(), $stream);
$httpSocket = new Http(array(), $socket);

$githubCurl = new Github($options, $httpCurl);
$githubStream = new Github($options, $httpStream);
$githubSocket = new Github($options, $httpSocket);

var_dump(count($githubCurl->orgs->getList()));
var_dump(count($githubStream->orgs->getList()));
var_dump(count($githubSocket->orgs->getList()));

and I get:

int(5)
int(5)
Fatal error: Uncaught exception 'DomainException' with message 'Not Found'

i.e. the credentials get passed in fine with Curl and with Stream, but there is an issue with Socket.  Can you check to see if socket is being used?

Ian

On Monday, 24 March 2014 21:09:16 UTC-4, Andrew Eddie wrote:
On 25 March 2014 11:06, Eric Fernance <> wrote:
> Hi Andrew,
>
> Yes I've just submitted a PR to the gihub-api package that sets the relevant
> HTTP client headers for basic auth if the api.username and api.password are
> set.
>
> https://github.com/joomla-framework/github-api/pull/4
>
> I'm not sure if this is the best approach through?

Thanks. I've asked Ian to have a look at it as well because it feels
like there is either a problem in the HTTP transport code, or Github
has a strange idiosyncrasy. Just keep using the brute force header
injection until we can sort it out.

Thanks! We appreciate the feedback.

Regards,
Andrew Eddie

--
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.

--
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.