FOSSology
4.4.0
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 () | |
getPlugin ($pluginName) | |
A safe wrapper around plugin_find. More... | |
validateTokenRequest ($tokenExpire, $tokenName, $tokenScope) | |
Check if the token request contains valid parameters. More... | |
validateNewOauthClient ($userId, $clientName, $clientScope, $clientId) | |
Check if the new oauth client is valid. More... | |
Public Attributes | |
const | VALID_SCOPES = ["read", "write"] |
const | SCOPE_DB_MAP = ["read" => "r", "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 31 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 94 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getAuthHelper | ( | ) |
Definition at line 162 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getDbHelper | ( | ) |
Definition at line 170 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getFolderDao | ( | ) |
Definition at line 146 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getGroupId | ( | ) |
Definition at line 121 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getJobDao | ( | ) |
Definition at line 178 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 239 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getShowJobDao | ( | ) |
Definition at line 186 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUploadDao | ( | ) |
Definition at line 130 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUploadPermissionDao | ( | ) |
Definition at line 154 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUserDao | ( | ) |
Definition at line 138 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::getUserId | ( | ) |
Definition at line 112 of file RestHelper.php.
Fossology\UI\Api\Helper\RestHelper::validateNewOauthClient | ( | $userId, | |
$clientName, | |||
$clientScope, | |||
$clientId | |||
) |
Check if the new oauth client is valid.
The function checks for following properties:
integer | $userId | User id |
string | $clientName | The name of the new client. |
string | $clientScope | The scope of the new client. |
string | $clientId | New client id. |
HttpBadRequestException | If request is invalid. |
Definition at line 300 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. |
HttpBadRequestException | If request is invalid. |
Definition at line 264 of file RestHelper.php.
|
private |
Auth helper to provide authentication
Definition at line 87 of file RestHelper.php.
|
private |
DB helper object
Definition at line 57 of file RestHelper.php.
|
private |
Folder DAO object
Definition at line 67 of file RestHelper.php.
|
private |
Job DAO object
Definition at line 77 of file RestHelper.php.
|
private |
Show job DAO object
Definition at line 82 of file RestHelper.php.
|
private |
Upload DAO object
Definition at line 52 of file RestHelper.php.
|
private |
Upload permission DAO object
Definition at line 62 of file RestHelper.php.
|
private |
User DAO object
Definition at line 72 of file RestHelper.php.
array Fossology\UI\Api\Helper\RestHelper::SCOPE_DB_MAP = ["read" => "r", "write" => "w"] |
Maps a user readable scope to DB value.
Definition at line 42 of file RestHelper.php.
int Fossology\UI\Api\Helper\RestHelper::TOKEN_KEY_LENGTH = 40 |
Length of the token secret key.
Definition at line 47 of file RestHelper.php.
array Fossology\UI\Api\Helper\RestHelper::VALID_SCOPES = ["read", "write"] |
Valid scopes for REST authentication tokens.
Definition at line 37 of file RestHelper.php.