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

Re: [jfw] Getting Github Milestones via Basic Authentcation



From the github docs under authentication it says:

There are three ways to authenticate through GitHub API v3. Requests that require authentication will return 404 Not Found, instead of 403 Forbidden, in some places. This is to prevent the accidental leakage of private repositories to unauthorized users.


That's why I was curious how I could pass the AUTHENTICATION_BASIC to the Joomla\Github\Http.  I thought about creating a Joomla\Github\Http object then passing it as part of creating the Github object but I can't figure out what the option key would be.

Eric. 




On 24/03/2014, at 5:38 PM, Eric Fernance <beanie AT purplebeanie.com> wrote:

A Joomla\Http\Response object with code 404.

Which apparently is pretty standard for github on private repos without authentication (at least according to the github site)

full extract here:

Joomla\Http\Response Object ( [code] => 404 [headers] => Array ( [Server] => GitHub.com [Date] => Mon, 24 Mar 2014 07:33:48 GMT [Content-Type] => application/json; charset=utf-8 [Connection] => close [Status] => 404 Not Found [X-RateLimit-Limit] => 60 [X-RateLimit-Remaining] => 3 [X-RateLimit-Reset] => 1395648458 [X-GitHub-Media-Type] => github.beta; format=json [X-Content-Type-Options] => nosniff [Content-Length] => 76 [Access-Control-Allow-Credentials] => true [Access-Control-Expose-Headers] => ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval [Access-Control-Allow-Origin] => * [X-GitHub-Request-Id] => DF1B12EC:64AE:5850672:532FDFDB ) [body] => {"message":"Not Found","documentation_url":"http://developer.github.com/v3"} ) 1

Eric
On 24/03/2014, at 5:22 PM, Andrew Eddie <mamboblue AT gmail.com> wrote:

Interesting problem. I've never tried private repo's before.

https://github.com/joomla-framework/github-api/blob/master/src/Package/Issues/Milestones.php#L48

What do you get on your server if you do a var_dump on $response?

Regards,
Andrew Eddie


On 24 March 2014 15:54, Eric Fernance <beanie AT purplebeanie.com> wrote:
Hi Folks,

I've spent a couple of hours hunting around trying to work out how to do this but I'm stumped.

I need to retrieve milestones for a couple of different github repos (all owned by me).  I need to use basic authentication as I will only have username and password.

So far I have gotten to this:

//create the registry object containing the github options
$options = new Registry;
$options->set('api.username','githubusername');
$options->set('api.password','githubpassword');
$options->set('api.url','https://api.github.com');


//create the github object.
$github = new Github($options);

$milestonedetails = $github->issues->milestones->get('githubusername','reponame',milestoneid);

Works fine on public repos and from my test environment (but I have SSH keys) but won't get milestones for my private repos when I install on host's server.

I can see the constant: AUTHENTICATION_BASIC in the source code but I'm unsure where to set it and what the option name should be.  I'm guessing I can pass it as part of the Registry object but I can't work out what name it should be.

Can anyone give me some pointers?

Eric.


--
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.


--
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.