End of comments

This commit is contained in:
EoleDev 2016-04-27 14:22:59 +02:00
parent 5263cf00a2
commit 1d42345e07
13 changed files with 491 additions and 264 deletions

View file

@ -2,11 +2,10 @@
/**
* File containing the identity Class.
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
*/
/**
* Import the Error of the Library
*/
use OpenCloud\Common\Error;
@ -15,6 +14,11 @@ use OpenCloud\Common\Error;
*
* This class implements the management for the identity request
*
* @version 1.0 Initialisation of this file
* @since 1.0 Core application's file
*
* @author Eole 'eoledev at outlook . fr'
*
*/
class identity implements Core{
@ -29,7 +33,7 @@ class identity implements Core{
*
* @param App $app the main app object
*
* @return identity
* @return identity Object
*/
public function __construct($app){
@ -43,7 +47,7 @@ class identity implements Core{
*
* @param String $action name of another function of this class
*
* @return NULL
* @return void
*/
public function action($action){
@ -61,7 +65,7 @@ class identity implements Core{
* @param String $type Required Type of credential : ec2, cert...
* @param String $userId Required Id of the user which own the credential
*
* @return NULL
* @return void
*/
private function addCredential(){
@ -99,7 +103,7 @@ class identity implements Core{
/**
* List the credentials for a given user.
*
* @return NULL
* @return void
*/
private function listCredentials(){
try{
@ -127,7 +131,7 @@ class identity implements Core{
*
* @param String $credentialId Required credential id for which it retrieve the details
*
* @return NULL
* @return void
*/
private function showCredential(){
$credentId = $this->app->getPostParam("credentialId");
@ -164,7 +168,7 @@ class identity implements Core{
* @param JsonString $blob Required credentials information with this structure for ec2: "{\"access\":\"181920\",\"secret\":\"secretKey\"}"
* @param String $type Required Type of credential : ec2, cert...
*
* @return NULL
* @return void
*/
private function updateCredential(){
@ -206,7 +210,7 @@ class identity implements Core{
*
* @param String $credentialId Required credential id to delete
*
* @return NULL
* @return void
*/
private function deleteCredential(){
@ -244,7 +248,7 @@ class identity implements Core{
* @param String $enabled Optional Domain enabled or not : value true or false
* @param String $name Required Domain Name
*
* @return NULL
* @return void
*/
private function addDomain(){
@ -289,7 +293,7 @@ class identity implements Core{
/**
* Retrieve the different domain's list.
*
* @return NULL
* @return void
*/
private function listDomains(){
@ -318,7 +322,7 @@ class identity implements Core{
*
* @param String $domainId Required Domain id for which it retrieve the details
*
* @return NULL
* @return void
*/
private function showDomain(){
@ -356,7 +360,7 @@ class identity implements Core{
* @param String $enabled Optional Domain enabled or not : value true or false
* @param String $name Required Domain Name
*
* @return NULL
* @return void
*/
private function updateDomain(){
@ -404,7 +408,7 @@ class identity implements Core{
*
* @param String $domainId Required Domain id to delete
*
* @return NULL
* @return void
*/
private function deleteDomain(){
@ -437,7 +441,7 @@ class identity implements Core{
/**
* Retrieve the different roles of a given user in a domain.
*
* @return NULL
* @return void
*/
private function listRolesDomainUser(){
@ -472,7 +476,7 @@ class identity implements Core{
/**
* Grant a role to a given user in a domain.
*
* @return NULL
* @return void
*/
private function grantRoleDomainUser(){
$domId = $this->app->getPostParam("domainId");
@ -510,7 +514,7 @@ class identity implements Core{
/**
* Verify that a user has a given role in a domain.
*
* @return NULL
* @return void
*/
private function checkRoleDomainUser(){
$domId = $this->app->getPostParam("domainId");
@ -549,7 +553,7 @@ class identity implements Core{
/**
* Delete a role for a given user in a domain.
*
* @return NULL
* @return void
*/
private function revokeRoleDomainUser(){
$domId = $this->app->getPostParam("domainId");
@ -587,7 +591,7 @@ class identity implements Core{
/**
* Retrieve the roles of a given group in a domain.
*
* @return NULL
* @return void
*/
private function listRolesDomainGroup(){
$domId = $this->app->getPostParam("domainId");
@ -622,7 +626,7 @@ class identity implements Core{
/**
* Add a role to a given group in a domain.
*
* @return NULL
* @return void
*/
private function grantRoleDomainGroup(){
$domId = $this->app->getPostParam("domainId");
@ -660,7 +664,7 @@ class identity implements Core{
/**
* Verify that a role is associated with a given group in a domain.
*
* @return NULL
* @return void
*/
private function checkRoleDomainGroup(){
$domId = $this->app->getPostParam("domainId");
@ -699,7 +703,7 @@ class identity implements Core{
/**
* Delete a role for a given group in a domain.
*
* @return NULL
* @return void
*/
private function revokeRoleDomainGroup(){
$domId = $this->app->getPostParam("domainId");
@ -738,7 +742,7 @@ class identity implements Core{
/**
* Add an endpoint to the Openstack instance
*
* @return NULL
* @return void
*/
private function addEndpoint(){
$servId = $this->app->getPostParam("serviceId");
@ -778,7 +782,7 @@ class identity implements Core{
/**
* Retrieve the endpoint for the given id
*
* @return NULL
* @return void
*/
private function getEndpoint(){
@ -810,7 +814,7 @@ class identity implements Core{
/**
* Retrieve the list of the different endpoints
*
* @return NULL
* @return void
*/
private function listEndpoints(){
@ -836,7 +840,7 @@ class identity implements Core{
/**
* Update a given endpoint
*
* @return NULL
* @return void
*/
private function updateEndpoint(){
//Not Implemented Yet
@ -845,7 +849,7 @@ class identity implements Core{
/**
* Delete a given endpoint
*
* @return NULL
* @return void
*/
private function deleteEndpoint(){
$endId = $this->app->getPostParam("endpointId");
@ -877,7 +881,7 @@ class identity implements Core{
/**
* Add a group.
*
* @return NULL
* @return void
*/
private function addGroup(){
//Not Implemented Yet
@ -886,7 +890,7 @@ class identity implements Core{
/**
* Retrieve the group's list.
*
* @return NULL
* @return void
*/
private function listGroups(){
//Not Implemented Yet
@ -895,7 +899,7 @@ class identity implements Core{
/**
* Retrieve the details of a given group.
*
* @return NULL
* @return void
*/
private function showGroup(){
//Not Implemented Yet
@ -904,7 +908,7 @@ class identity implements Core{
/**
* Update a given group.
*
* @return NULL
* @return void
*/
private function updateGroup(){
//Todo Argument Optional
@ -945,7 +949,7 @@ class identity implements Core{
/**
* Delete the given group.
*
* @return NULL
* @return void
*/
private function deleteGroup(){
@ -979,7 +983,7 @@ class identity implements Core{
/**
* Retrieve the users of a given group.
*
* @return NULL
* @return void
*/
private function listGroupUsers(){
@ -1013,7 +1017,7 @@ class identity implements Core{
/**
* Add a user to a group.
*
* @return NULL
* @return void
*/
private function addGroupUser(){
@ -1048,7 +1052,7 @@ class identity implements Core{
/**
* Remove a user from a given group.
*
* @return NULL
* @return void
*/
private function removeGroupUser(){
@ -1083,7 +1087,7 @@ class identity implements Core{
/**
* Check if a group contains a given user.
*
* @return NULL
* @return void
*/
private function checkGroupUser(){
@ -1118,7 +1122,7 @@ class identity implements Core{
/**
* @todo
*
* @return NULL
* @return void
*/
private function addPolicies(){
//Not Implemented Yet
@ -1127,7 +1131,7 @@ class identity implements Core{
/**
* @todo
*
* @return NULL
* @return void
*/
private function listPolicies(){
//Not Implemented Yet
@ -1136,7 +1140,7 @@ class identity implements Core{
/**
* @todo
*
* @return NULL
* @return void
*/
private function showPolicie(){
//Not Implemented Yet
@ -1146,7 +1150,7 @@ class identity implements Core{
/**
* @todo
*
* @return NULL
* @return void
*/
private function updatePolicies(){
//Not Implemented Yet
@ -1155,7 +1159,7 @@ class identity implements Core{
/**
* @todo
*
* @return NULL
* @return void
*/
private function deletePolicies(){
//Not Implemented Yet
@ -1164,7 +1168,7 @@ class identity implements Core{
/**
* Add a project.
*
* @return NULL
* @return void
*/
private function addProject(){
//Todo Parameters Optional
@ -1201,7 +1205,7 @@ class identity implements Core{
/**
* Retrieve the different projects.
*
* @return NULL
* @return void
*/
private function listProjects(){
@ -1227,7 +1231,7 @@ class identity implements Core{
/**
* Retrieve the details of a given project.
*
* @return NULL
* @return void
*/
private function showProject(){
@ -1260,7 +1264,7 @@ class identity implements Core{
/**
* Update a given project.
*
* @return NULL
* @return void
*/
private function updateProject(){
//Todo Parameters Optionnal
@ -1300,7 +1304,7 @@ class identity implements Core{
/**
* Delete a given project.
*
* @return NULL
* @return void
*/
private function deleteProject(){
$projId = $this->app->getPostParam("projId");
@ -1333,7 +1337,7 @@ class identity implements Core{
/**
* List the roles of a given user in a project.
*
* @return NULL
* @return void
*/
private function listRolesProjectUser(){
@ -1370,7 +1374,7 @@ class identity implements Core{
/**
* Grant a role to an user in a project.
*
* @return NULL
* @return void
*/
private function grantRoleProjectUser(){
@ -1409,7 +1413,7 @@ class identity implements Core{
/**
* Check if a given user has a role in a project.
*
* @return NULL
* @return void
*/
private function checkRoleProjectUser(){
$projId = $this->app->getPostParam("projetId");
@ -1450,7 +1454,7 @@ class identity implements Core{
/**
* Delete a role for a given user in a project.
*
* @return NULL
* @return void
*/
private function revokeRoleProjectUser(){
@ -1489,7 +1493,7 @@ class identity implements Core{
/**
* List the roles of a group in a project.
*
* @return NULL
* @return void
*/
private function listRolesProjectGroup(){
@ -1525,7 +1529,7 @@ class identity implements Core{
/**
* Add a role to a group in a project.
*
* @return NULL
* @return void
*/
private function grantRoleProjectGroup(){
@ -1564,7 +1568,7 @@ class identity implements Core{
/**
* Check if a group has a given role in a project.
*
* @return NULL
* @return void
*/
private function checkRoleProjectGroup(){
@ -1605,7 +1609,7 @@ class identity implements Core{
/**
* Delete a role for a group in a project.
*
* @return NULL
* @return void
*/
private function revokeRoleProjectGroup(){
@ -1644,7 +1648,7 @@ class identity implements Core{
/**
* Add a role.
*
* @return NULL
* @return void
*/
private function addRole(){
@ -1678,7 +1682,7 @@ class identity implements Core{
/**
* List the different roles
*
* @return NULL
* @return void
*/
private function listRoles(){
@ -1704,7 +1708,7 @@ class identity implements Core{
/**
* List the different assignments for a given role
*
* @return NULL
* @return void
*/
private function listRoleAssignements(){
@ -1730,7 +1734,7 @@ class identity implements Core{
/**
* Add a service.
*
* @return NULL
* @return void
*/
private function addService(){
$name = $this->app->getPostParam("name");
@ -1765,7 +1769,7 @@ class identity implements Core{
/**
* Retrieve the different services.
*
* @return NULL
* @return void
*/
private function listServices(){
@ -1791,7 +1795,7 @@ class identity implements Core{
/**
* Retrieve the details for a given service.
*
* @return NULL
* @return void
*/
private function showService(){
$servId = $this->app->getPostParam("serviceId");
@ -1822,7 +1826,7 @@ class identity implements Core{
/**
* Delete a given service.
*
* @return NULL
* @return void
*/
private function deleteService(){
@ -1856,7 +1860,7 @@ class identity implements Core{
/**
* Generate a new token for a given user id.
*
* @return NULL
* @return void
*/
private function genTokenUserID(){
@ -1894,7 +1898,7 @@ class identity implements Core{
/**
* Generate a new token for a given user name.
*
* @return NULL
* @return void
*/
private function genTokenUserName(){
$username = $this->app->getPostParam("username");
@ -1936,7 +1940,7 @@ class identity implements Core{
/**
* Generate a new token from another token ID.
*
* @return NULL
* @return void
*/
private function genTokenID(){
@ -1972,7 +1976,7 @@ class identity implements Core{
/**
* Generate a new token scoped by a project ID.
*
* @return NULL
* @return void
*/
private function genTokenScopedProjectID(){
@ -2014,7 +2018,7 @@ class identity implements Core{
/**
* Generate a new token scoped by a project name.
*
* @return NULL
* @return void
*/
private function genTokenScopedProjectName(){
@ -2062,7 +2066,7 @@ class identity implements Core{
/**
* Check if a token is validate.
*
* @return NULL
* @return void
*/
private function validateToken(){
@ -2098,7 +2102,7 @@ class identity implements Core{
/**
* Delete a given token.
*
* @return NULL
* @return void
*/
private function revokeToken(){
@ -2130,7 +2134,7 @@ class identity implements Core{
/**
* Add a new user.
*
* @return NULL
* @return void
*/
private function addUser(){
//Todo Optionnal Parameter
@ -2175,7 +2179,7 @@ class identity implements Core{
/**
* Retrieve the different users.
*
* @return NULL
* @return void
*/
private function listUsers(){
@ -2201,7 +2205,7 @@ class identity implements Core{
/**
* Retrieve the details of a given user.
*
* @return NULL
* @return void
*/
private function showUser(){
@ -2234,7 +2238,7 @@ class identity implements Core{
/**
* Update a given user.
*
* @return NULL
* @return void
*/
private function updateUser(){
@ -2273,7 +2277,7 @@ class identity implements Core{
/**
* Delete a given user.
*
* @return NULL
* @return void
*/
private function deleteUser(){
@ -2306,7 +2310,7 @@ class identity implements Core{
/**
* Retrieve the groups which contains a given user.
*
* @return NULL
* @return void
*/
private function listUserGroups(){
@ -2340,7 +2344,7 @@ class identity implements Core{
/**
* Retrieve the projects which contains a given user.
*
* @return NULL
* @return void
*/
private function listUserProjects(){