FOSSology
3.2.0rc1
Open Source License Compliance by Open Source Software
|
Provides various DAO helper functions for REST api. More...
Public Member Functions | |
__construct (UploadPermissionDao $uploadPermissionDao, UploadDao $uploadDao, UserDao $userDao, FolderDao $folderDao, DbHelper $dbHelper, AuthHelper $authHelper, JobDao $jobDao, ShowJobsDao $showJobDao) | |
RestHelper constructor. More... | |
getUserId () | |
getGroupId () | |
getUploadDao () | |
getUserDao () | |
getFolderDao () | |
getUploadPermissionDao () | |
getAuthHelper () | |
getDbHelper () | |
getJobDao () | |
getShowJobDao () | |
copyUpload ($uploadId, $newFolderId, $isCopy) | |
getPlugin ($pluginName) | |
A safe wrapper around plugin_find. More... | |
validateTokenRequest ($tokenExpire, $tokenName, $tokenScope) | |
Check if the token request contains valid parameters. More... | |
Public Attributes | |
const | VALID_SCOPES = ["read", "write"] |
const | SCOPE_DB_MAP = ["read" => "r" |
const | write => "w"] |
const | TOKEN_KEY_LENGTH = 40 |
Private Attributes | |
$uploadDao | |
$dbHelper | |
$uploadPermissionDao | |
$folderDao | |
$userDao | |
$jobDao | |
$showJobDao | |
$authHelper | |
Provides various DAO helper functions for REST api.
Definition at line 40 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::__construct | ( | UploadPermissionDao | $uploadPermissionDao, |
UploadDao | $uploadDao, | ||
UserDao | $userDao, | ||
FolderDao | $folderDao, | ||
DbHelper | $dbHelper, | ||
AuthHelper | $authHelper, | ||
JobDao | $jobDao, | ||
ShowJobsDao | $showJobDao | ||
) |
RestHelper constructor.
This constructor initialize all the members
Definition at line 103 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::copyUpload | ( | $uploadId, | |
$newFolderId, | |||
$isCopy | |||
) |
Copy/move a given upload id to a new folder id.
integer | $uploadId | Upload to copy/move |
integer | $newFolderId | New folder id |
boolean | $isCopy | Set true to perform copy, false to move |
Definition at line 207 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getAuthHelper | ( | ) |
Definition at line 171 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getDbHelper | ( | ) |
Definition at line 179 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getFolderDao | ( | ) |
Definition at line 155 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getGroupId | ( | ) |
Definition at line 130 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getJobDao | ( | ) |
Definition at line 187 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getPlugin | ( | $pluginName | ) |
A safe wrapper around plugin_find.
Get the FOSSology plugin from the plugin array.
string | $pluginName | The required plugin |
Definition at line 248 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getShowJobDao | ( | ) |
Definition at line 195 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUploadDao | ( | ) |
Definition at line 139 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUploadPermissionDao | ( | ) |
Definition at line 163 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUserDao | ( | ) |
Definition at line 147 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUserId | ( | ) |
Definition at line 121 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::validateTokenRequest | ( | $tokenExpire, | |
$tokenName, | |||
$tokenScope | |||
) |
Check if the token request contains valid parameters.
The function checks for following properties:
string | $tokenExpire | The expiry of token requested. |
string | $tokenName | The name of the token requested. |
string | $tokenScope | The scope of the token requested. |
Definition at line 273 of file RestHelper.php.
|
private |
Auth helper to provide authentication
Definition at line 96 of file RestHelper.php.
|
private |
DB helper object
Definition at line 66 of file RestHelper.php.
|
private |
Folder DAO object
Definition at line 76 of file RestHelper.php.
|
private |
Job DAO object
Definition at line 86 of file RestHelper.php.
|
private |
Show job DAO object
Definition at line 91 of file RestHelper.php.
|
private |
Upload DAO object
Definition at line 61 of file RestHelper.php.
|
private |
Upload permission DAO object
Definition at line 71 of file RestHelper.php.
|
private |
User DAO object
Definition at line 81 of file RestHelper.php.
array Fossology\UI\Api\Helper\RestHelper::SCOPE_DB_MAP = ["read" => "r" |
Maps a user readable scope to DB value.
Definition at line 51 of file RestHelper.php.
int Fossology\UI\Api\Helper\RestHelper::TOKEN_KEY_LENGTH = 40 |
Length of the token secret key.
Definition at line 56 of file RestHelper.php.
array Fossology\UI\Api\Helper\RestHelper::VALID_SCOPES = ["read", "write"] |
Valid scopes for REST authentication tokens.
Definition at line 46 of file RestHelper.php.