JGithubPackageAuthorization
Extends \JGithubPackageGitHub API Authorization class for the Joomla Platform.
documentation | |
---|---|
since |
3.1.4 |
deprecated |
4.0 Use the |
package |
Joomla.Platform |
Methods
__construct
Constructor.
__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null)
since |
1.7.3 |
---|
Arguments
- $options
\Joomla\Registry\Registry
GitHub options object.- $client
\JGithubHttp
The HTTP client object.
__get
Magic method to lazily create API objects
__get(string $name) : \JGithubPackage
since |
3.3 |
---|---|
throws |
|
Arguments
- $name
string
Name of property to retrieve
Response
\JGithubPackage
GitHub API package object.
create
Method to create an authorization.
create(array $scopes = array(), string $note = '', string $url = '') : object
throws |
|
---|---|
since |
3.1.4 |
Arguments
- $scopes
array
A list of scopes that this authorization is in.- $note
string
A note to remind you what the OAuth token is for.- $url
string
A URL to remind you what app the OAuth token is for.
Response
object
delete
Method to delete an authorization
delete(integer $id) : object
throws |
|
---|---|
since |
3.1.4 |
Arguments
- $id
integer
ID 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 |
|
---|---|
since |
3.1.4 |
Arguments
- $id
integer
ID of the authorization to edit- $scopes
array
Replaces the authorization scopes with these.- $addScopes
array
A list of scopes to add to this authorization.- $removeScopes
array
A list of scopes to remove from this authorization.- $note
string
A note to remind you what the OAuth token is for.- $url
string
A 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
since |
1.7.3 |
---|
Arguments
- $path
string
URL to inflect- $page
integer
Page to request- $limit
integer
Number of results to return per page
Response
string
The request URL.
get
Method to get details about an authorised application for the authenticated user.
get(integer $id) : object
throws |
|
---|---|
since |
3.1.4 |
note |
This method will only accept Basic Authentication |
Arguments
- $id
integer
ID of the authorization to retrieve
Response
object
getAuthorizationLink
- Request authorization on GitHub.
getAuthorizationLink(string $clientId, string $redirectUri = '', string $scope = '', string $state = '') : \JUri
since |
3.3 |
---|
Arguments
- $clientId
string
The client ID you received from GitHub when you registered.- $redirectUri
string
URL in your app where users will be sent after authorization.- $scope
string
Comma separated list of scopes.- $state
string
An unguessable random string. It is used to protect against cross-site request forgery attacks.
Response
\JUri
getList
Method to get the authorised applications for the authenticated user.
getList() : object
throws |
|
---|---|
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 |
|
---|---|
since |
3.1.4 |
Response
object
processResponse
Process the response and decode it.
processResponse(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
throws |
|
---|---|
since |
3.3.0 |
Arguments
- $response
\JHttpResponse
The response.- $expectedCode
integer
The expected "good" code.- $decode
boolean
If the should be response be JSON decoded.
Response
mixed
requestToken
- Request the access token.
requestToken(string $clientId, string $clientSecret, string $code, string $redirectUri = '', string $format = '') : string
throws |
|
---|---|
since |
3.3 |
Arguments
- $clientId
string
The client ID you received from GitHub when you registered.- $clientSecret
string
The client secret you received from GitHub when you registered.- $code
string
The code you received as a response to Step 1.- $redirectUri
string
URL in your app where users will be sent after authorization.- $format
string
The response format (json, xml, ).
Response
string
Properties
name
since |
3.3 |
---|
Type(s)
string
packages
since |
3.3 |
---|
Type(s)
array
client
The HTTP client object to use in sending HTTP requests.