\SDP_Driver_Cactus

Determines the service to create links to upload to/download from a drive

Summary

Methods
Properties
Constants
getType()
getSymbol()
getTitle()
getDescription()
getDownloadResponse()
jsonSerialize()
getParameters()
getGeneralParam()
getExtraParam()
$client
DRIVER_PREFIX
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

DRIVER_PREFIX

DRIVER_PREFIX = 'sdp_driver_'

Properties

$client

$client : 

Type

Methods

getType()

getType() : string

Returns

string

getSymbol()

getSymbol() : string

Returns

string

getTitle()

getTitle() : string

Returns

string

getDescription()

getDescription() : string

Returns

string

getDownloadResponse()

getDownloadResponse(\SDP_Link  $link, \Pluf_Http_Request  $request) : \Pluf_Http_Response

Creats a permanent redirect (code 301) response with an URL as the following pattern:

{home}/api/v2/cactus/files/{jwt}/content

The parameter 'home' will be fetched from drive of the asset which is related to the given link. The parameter 'jwt' is a JSON Web Token which is contain at least the following information:

  • file: path to file
  • expiry: unix timestamp
  • access: r, w, rw The following information may be existed in the token:
  • account: a JSON object. Here we place 'id' of requester account.
  • host: a JSON object. Here we place 'host' of requester which is the domain of it.

Note: The key and algorithm to encode/decode the JWT should be determined in the meta information of the drive which is host of the asset.

The information to create link should be placed in the meta. All other needed information should be given from request.

Parameters

\SDP_Link $link
\Pluf_Http_Request $request

Returns

\Pluf_Http_Response

jsonSerialize()

jsonSerialize() 

(non-PHPdoc)

getParameters()

getParameters() 

Returns a list of needed parameters of a driver

Each drive needs some parameter which should be provided by the user. This function determines these parameters.

Result of this function is a list of property descriptors.

getGeneralParam()

getGeneralParam() : 

فهرست خصوصیت‌های عمومی را تعیین می‌کند.

Returns

getExtraParam()

getExtraParam() 

خصوصیت‌های اضافه را تعیین می‌کند.