kernel/private/oauth/classes/restclient.php

Show: inherited
Table of Contents

File containing the ezpRestClient class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Package
kernel  
Version
4.6.0  

\ezpRestClient

Package: Default

Persistent object class representing a REST application.

Constants

Constant  STATUS_DRAFT = 1
Constant  STATUS_PUBLISHED = 0

Properties

Propertypublicstring  $client_id= 'null'

Application client ID, as used over oAuth to authentify the application

Default valuenullDetails
Type
string
Propertypublicstring  $client_secret= 'null'

Application client secret, as used over oAuth to authentify the application

Default valuenullDetails
Type
string
Propertypublicint  $created= 'null'

Application creation date, as a unix timestamp

Default valuenullDetails
Type
int
Propertypublicstring  $description= 'null'

Application description

Default valuenullDetails
Type
string
Propertypublicstring  $endpoint_uri= 'null'

Application client endpoint URI. Used to validate the redirection URI requested by the authorize call.

Default valuenullDetails
Type
string
Propertypublic  $id= 'null'
Default valuenullDetails
Type
n/a
Propertypublicstring  $name= 'null'

Application name

Default valuenullDetails
Type
string
Propertypublicint  $owner_id= 'null'

ID of the eZ Publish user who owns the application

Default valuenullDetails
Type
int
Propertypublicint  $updated= 'null'

Application update date, as a unix timestamp

Default valuenullDetails
Type
int
Propertypublicint  $version= 'null'

Application version, used to pre-create a draft when first creation a new application.

Default valuenullDetails
Type
int

Methods

methodpublic__get( string $propertyName ) : mixed

eZPersistentObject wrapper method: handles "function attributes"

Parameters
Name Type Description
$propertyName string
Returns
Type Description
mixed
methodpublic__isset(  $propertyName ) : void

Parameters
Name Type Description
$propertyName
methodprotected_owner( ) : \eZUser

Returns the eZUser who owns the object

Returns
Type Description
\eZUser
methodpublicattribute( string $attributeName ) : mixed

eZPersistentObject wrapper method

Parameters
Name Type Description
$attributeName string
Returns
Type Description
mixed
methodpublicauthorizeApplication(  $clientId,  $endPointUri,  $clientSecret = null ) : bool
static

Validates an authorization request by an application using the ID, redirection URI and secret if provided.

Parameters
Name Type Description
$clientId
$endPointUri
$clientSecret
Returns
Type Description
bool True if the app is valid, false if it isn't
Details
Todo
Enhance the return variable, as several status would be required. Exceptions, or constants ?  
string
string
string
methodpublicauthorizeFor( \eZUser $user = null ) : void

Authorizes this application for a user

Parameters
Name Type Description
$user \eZUser
methodpublicfetchByClientId( string $clientId ) : \ezpRestClient
static

Fetches a rest application using a client Id

Parameters
Name Type Description
$clientId string
Returns
Type Description
\ezpRestClient
methodpublicgetState( ) : void

methodpublichasAttribute( string $attributeName ) : bool

eZPersistentObject wrapper method

Parameters
Name Type Description
$attributeName string
Returns
Type Description
bool
methodpublicisAuthorizedByUser( mixed $scope, \eZUser $user = null ) : bool

Checks if this application has been authorized by the current user

Parameters
Name Type Description
$scope mixed

The requested security scope

$user \eZUser

The user to check authorization for. Will check for current user if not given.

Returns
Type Description
bool
Details
Todo
Handle non-authorization using  
methodpublicisEndPointValid( string $endPointUri ) : bool

Validates an attempt (endpoint) redirect URI against the one configured for the client

Parameters
Name Type Description
$endPointUri string
Returns
Type Description
bool true if the URI is valid, false otherwise
methodpublicsetState(  $properties ) : void

Parameters
Name Type Description
$properties
methodpublicvalidateSecret(  $secret ) : bool

Convenience method to validate a client secret.

Parameters
Name Type Description
$secret
Returns
Type Description
bool
Documentation was generated by DocBlox 0.18.1.