[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/Services/Twilio/ -> Capability.php (summary)

(no description)

File Size: 346 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

Services_Twilio_Capability:: (6 methods):
  __construct()
  allowClientIncoming()
  allowClientOutgoing()
  allowEventStream()
  generateToken()
  allow()

ScopeURI:: (3 methods):
  __construct()
  toString()
  parse()

JWT:: (8 methods):
  decode()
  encode()
  sign()
  jsonDecode()
  jsonEncode()
  urlsafeB64Decode()
  urlsafeB64Encode()
  handleJsonError()


Class: Services_Twilio_Capability  - X-Ref

Twilio Capability Token generator

__construct($accountSid, $authToken)   X-Ref
Create a new TwilioCapability with zero permissions. Next steps are to
grant access to resources by configuring this token through the
functions allowXXXX.

param: $accountSid the account sid to which this token is granted access
param: $authToken the secret key used to sign the token. Note, this auth

allowClientIncoming($clientName)   X-Ref
If the user of this token should be allowed to accept incoming
connections then configure the TwilioCapability through this method and
specify the client name.

param: $clientName

allowClientOutgoing($appSid, array $appParams=array()   X-Ref
Allow the user of this token to make outgoing connections.

param: $appSid the application to which this token grants access
param: $appParams signed parameters that the user of this token cannot

allowEventStream(array $filters=array()   X-Ref
Allow the user of this token to access their event stream.

param: $filters key/value filters to apply to the event stream

generateToken($ttl = 3600)   X-Ref
Generates a new token based on the credentials and permissions that
previously has been granted to this token.

param: $ttl the expiration time of the token (in seconds). Default
return: the newly generated token that is valid for $ttl seconds

allow($service, $privilege, $params)   X-Ref
No description

Class: ScopeURI  - X-Ref

Scope URI implementation

Simple way to represent configurable privileges in an OAuth
friendly way. For our case, they look like this:

scope:<service>:<privilege>?<params>

For example:
scope:client:incoming?name=jonas

__construct($service, $privilege, $params = array()   X-Ref
No description

toString()   X-Ref
No description

parse($uri)   X-Ref
Parse a scope URI into a ScopeURI object

param: string    $uri  The scope URI
return: ScopeURI The parsed scope uri

Class: JWT  - X-Ref

JSON Web Token implementation

Minimum implementation used by Realtime auth, based on this spec:
http://self-issued.info/docs/draft-jones-json-web-token-01.html.

decode($jwt, $key = null, $verify = true)   X-Ref

param: string      $jwt    The JWT
param: string|null $key    The secret key
param: bool        $verify Don't skip verification process
return: object The JWT's payload as a PHP object

encode($payload, $key, $algo = 'HS256')   X-Ref

param: object|array $payload PHP object or array
param: string       $key     The secret key
param: string       $algo    The signing algorithm
return: string A JWT

sign($msg, $key, $method = 'HS256')   X-Ref

param: string $msg    The message to sign
param: string $key    The secret key
param: string $method The signing algorithm
return: string An encrypted message

jsonDecode($input)   X-Ref

param: string $input JSON string
return: object Object representation of JSON string

jsonEncode($input)   X-Ref

param: object|array $input A PHP object or array
return: string JSON representation of the PHP object or array

urlsafeB64Decode($input)   X-Ref

param: string $input A base64 encoded string
return: string A decoded string

urlsafeB64Encode($input)   X-Ref

param: string $input Anything really
return: string The base64 encode of what you passed in

handleJsonError($errno)   X-Ref

param: int $errno An error number from json_last_error()
return: void



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1