JGithubPackageAuthorization

Extends \JGithubPackage

GitHub API Authorization class for the Joomla Platform.

deprecated
documentation

https://developer.github.com/v3/oauth/

since

3.1.4

deprecated

4.0 Use the joomla/github package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null) 
inherited
since

1.7.3

Arguments

$options

\Joomla\Registry\RegistryGitHub options object.

$client

\JGithubHttpThe HTTP client object.

__get

Magic method to lazily create API objects

__get(string $name) : \JGithubPackage
inherited
since

3.3

throws

\RuntimeException

Arguments

$name

stringName of property to retrieve

Response

\JGithubPackageGitHub API package object.

create

Method to create an authorization.

create(array $scopes = array(), string $note = '', string $url = '') : object
throws

\DomainException

since

3.1.4

Arguments

$scopes

arrayA list of scopes that this authorization is in.

$note

stringA note to remind you what the OAuth token is for.

$url

stringA URL to remind you what app the OAuth token is for.

Response

object

delete

Method to delete an authorization

delete(integer $id) : object
throws

\DomainException

since

3.1.4

Arguments

$id

integerID of the authorization to delete

Response

object

edit

Method to edit an authorization.

edit(integer $id, array $scopes = array(), array $addScopes = array(), array $removeScopes = array(), string $note = '', string $url = '') : object
throws

\RuntimeException

\DomainException

since

3.1.4

Arguments

$id

integerID of the authorization to edit

$scopes

arrayReplaces the authorization scopes with these.

$addScopes

arrayA list of scopes to add to this authorization.

$removeScopes

arrayA list of scopes to remove from this authorization.

$note

stringA note to remind you what the OAuth token is for.

$url

stringA URL to remind you what app the OAuth token is for.

Response

object

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $page, integer $limit) : string
inherited
since

1.7.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

get

Method to get details about an authorised application for the authenticated user.

get(integer $id) : object
throws

\DomainException

since

3.1.4

note

This method will only accept Basic Authentication

Arguments

$id

integerID of the authorization to retrieve

Response

object

getList

Method to get the authorised applications for the authenticated user.

getList() : object
throws

\DomainException

since

3.1.4

note

This method will only accept Basic Authentication

Response

object

getRateLimit

Method to get the rate limit for the authenticated user.

getRateLimit() : object
throws

\DomainException

since

3.1.4

Response

object

processResponse

Process the response and decode it.

processResponse(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
inherited
throws

\DomainException

since

3.3.0

Arguments

$response

\JHttpResponseThe response.

$expectedCode

integerThe expected "good" code.

$decode

booleanIf the should be response be JSON decoded.

Response

mixed

requestToken

  1. Request the access token.
requestToken(string $client_id, string $client_secret, string $code, string $redirect_uri = '', string $format = '') : string
throws

\UnexpectedValueException

since

3.3

Arguments

$client_id

stringThe client ID you received from GitHub when you registered.

$client_secret

stringThe client secret you received from GitHub when you registered.

$code

stringThe code you received as a response to Step 1.

$redirect_uri

stringURL in your app where users will be sent after authorization.

$format

stringThe response format (json, xml, ).

Response

string

Properties

name

inherited
since

3.3

Type(s)

string

packages

inherited
since

3.3

Type(s)

array

options

Options for the GitHub object.

inherited
since

1.7.3

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.7.3

Type(s)

\JGithubHttp