Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C3E118FF3 for ; Sun, 3 May 2015 12:28:47 +0000 (UTC) Received: (qmail 46247 invoked by uid 500); 3 May 2015 12:28:47 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 46125 invoked by uid 500); 3 May 2015 12:28:47 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 46107 invoked by uid 99); 3 May 2015 12:28:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 12:28:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BE095E0833; Sun, 3 May 2015 12:28:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Sun, 03 May 2015 12:28:46 -0000 Message-Id: <6b009e24c274444ba7804eb8dfbd2e87@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] airavata-php-gateway git commit: Wrapping Identitiy Server Code as a Laravel package Repository: airavata-php-gateway Updated Branches: refs/heads/master 71079c5f4 -> e3fce17c2 http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/app/libraries/wsis_utilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/wsis_utilities.php b/app/libraries/wsis_utilities.php index fbf90f8..530fa52 100755 --- a/app/libraries/wsis_utilities.php +++ b/app/libraries/wsis_utilities.php @@ -1,65 +1,12 @@ wsis_client = new WSISClient( - $username, - $password, - $wsis_config['server'], - $wsis_config['service-url'], - $wsis_config['cafile-path'], - $wsis_config['verify-peer'], - $wsis_config['allow-self-signed'] - ); - } /** * Return true if the given username exists in the identity server. @@ -69,7 +16,7 @@ class WSISUtilities implements IdUtilities{ public function username_exists($username) { try{ //$this->wsis_client = new WSISClient( $username); - return $this->wsis_client->username_exists($username); + return WSIS::username_exists($username); } catch (Exception $ex) { print_r( $ex); throw new Exception("Unable to check whether username exists", 0, NULL); @@ -85,7 +32,7 @@ class WSISUtilities implements IdUtilities{ */ public function authenticate($username, $password) { try{ - return $this->wsis_client->authenticate($username, $password); + return WSIS::authenticate($username, $password); } catch (Exception $ex) { var_dump( $ex); throw new Exception("Unable to authenticate user", 0, NULL); @@ -101,7 +48,7 @@ class WSISUtilities implements IdUtilities{ public function add_user($username, $password, $first_name, $last_name, $email, $organization, $address, $country,$telephone, $mobile, $im, $url) { try{ - $this->wsis_client->addUser($username, $password, $first_name . " " . $last_name); + WSIS::addUser($username, $password, $first_name . " " . $last_name); } catch (Exception $ex) { var_dump($ex); throw new Exception("Unable to add new user", 0, NULL); @@ -195,7 +142,7 @@ class WSISUtilities implements IdUtilities{ */ public function isExistingRole( $roleName){ try{ - return $this->wsis_client->is_existing_role( $roleName); + return WSIS::is_existing_role( $roleName); } catch (Exception $ex) { var_dump($ex); throw new Exception("Unable to check if role exists.", 0, $ex); @@ -209,7 +156,7 @@ class WSISUtilities implements IdUtilities{ */ public function addRole($roleName){ try{ - return $this->wsis_client->add_role( $roleName); + return WSIS::add_role( $roleName); } catch (Exception $ex) { var_dump( $ex); throw new Exception("Unable to add role.", 0, $ex); @@ -225,7 +172,7 @@ class WSISUtilities implements IdUtilities{ */ public function deleteRole($roleName) { try { - $this->wsis_client->delete_role($roleName); + WSIS::delete_role($roleName); } catch (Exception $ex) { throw new Exception("Unable to delete role", 0, $ex); } @@ -239,7 +186,7 @@ class WSISUtilities implements IdUtilities{ public function getRoleNames() { try{ - return $this->wsis_client->get_all_roles(); + WSIS::get_all_roles(); } catch (Exception $ex) { var_dump($ex); throw new Exception("Unable to get roles.", 0, NULL); @@ -255,7 +202,7 @@ class WSISUtilities implements IdUtilities{ public function getRoleListOfUser($username) { try{ - return $this->wsis_client->get_user_roles( $username); + return WSIS::get_user_roles( $username); } catch (Exception $ex) { var_dump($ex); throw new Exception("Unable to get roles.", 0, NULL); @@ -271,7 +218,7 @@ class WSISUtilities implements IdUtilities{ public function getUserListOfRole($role) { try{ - return $this->wsis_client->get_userlist_of_role( $role); + return WSIS::get_userlist_of_role( $role); } catch (Exception $ex) { var_dump( $ex); exit; throw new Exception("Unable to get users.", 0, NULL); @@ -307,7 +254,7 @@ class WSISUtilities implements IdUtilities{ public function updateRoleListOfUser($username, $roles) { try{ - return $this->wsis_client->update_user_roles( $username, $roles); + return WSIS::update_user_roles( $username, $roles); } catch (Exception $ex) { var_dump($ex); exit; throw new Exception("Unable to update User roles.", 0, NULL); @@ -326,7 +273,7 @@ class WSISUtilities implements IdUtilities{ */ public function listUsers(){ try { - return $this->wsis_client->list_users(); + return WSIS::list_users(); } catch (Exception $ex) { throw new Exception( "Unable to list users", 0, $ex); @@ -341,7 +288,7 @@ class WSISUtilities implements IdUtilities{ */ public function getTenantId(){ try { - return $this->wsis_client->get_tenant_id(); + return WSIS::get_tenant_id(); } catch (Exception $ex) { var_dump( $ex->debug_message); throw new Exception("Unable to get the Tenant Id.", 0, $ex); @@ -355,10 +302,19 @@ class WSISUtilities implements IdUtilities{ */ public function createTenant( $inputs){ try { - return $this->wsis_client->create_tenant( $inputs); + return WSIS::create_tenant( $inputs); } catch (Exception $ex) { var_dump( $ex); //throw new Exception("Unable to create Tenant.", 0, $ex); } } + + /** + * Connect to the user database. + * @return mixed|void + */ + public function connect() + { + // TODO: Implement connect() method. + } } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/app/libraries/xml_id_utilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/xml_id_utilities.php b/app/libraries/xml_id_utilities.php index 6b54767..0ba9760 100755 --- a/app/libraries/xml_id_utilities.php +++ b/app/libraries/xml_id_utilities.php @@ -249,4 +249,46 @@ class XmlIdUtilities implements IdUtilities { // TODO: Implement removeUserFromRole() method. } + + /** + * Function to get the entire list of roles in the application + * + * @return mixed + */ + public function getRoleNames() + { + // TODO: Implement getRoleNames() method. + } + + /** + * Function to check whether a role is existing + * + * @param string $roleName + * @return IsExistingRoleResponse + */ + public function isExistingRole($roleName) + { + // TODO: Implement isExistingRole() method. + } + + /** + * Function to add new role by providing the role name. + * + * @param string $roleName + */ + public function addRole($roleName) + { + // TODO: Implement addRole() method. + } + + /** + * Function to update role list of user + * + * @param UpdateRoleListOfUser $parameters + * @return void + */ + public function updateRoleListOfUser($username, $roles) + { + // TODO: Implement updateRoleListOfUser() method. + } } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/.gitignore ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/.gitignore b/workbench/airavata/wsis/.gitignore new file mode 100755 index 0000000..5826402 --- /dev/null +++ b/workbench/airavata/wsis/.gitignore @@ -0,0 +1,4 @@ +/vendor +composer.phar +composer.lock +.DS_Store http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/.travis.yml ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/.travis.yml b/workbench/airavata/wsis/.travis.yml new file mode 100755 index 0000000..f60bbe0 --- /dev/null +++ b/workbench/airavata/wsis/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - hhvm + +before_script: + - travis_retry composer self-update + - travis_retry composer install --prefer-source --no-interaction --dev + +script: phpunit http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/composer.json ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/composer.json b/workbench/airavata/wsis/composer.json new file mode 100755 index 0000000..2af236e --- /dev/null +++ b/workbench/airavata/wsis/composer.json @@ -0,0 +1,20 @@ +{ + "name": "airavata/wsis", + "description": "", + "authors": [ + { + "name": "Apache Airavata", + "email": "dev@airavata.apache.org" + } + ], + "require": { + "php": ">=5.4.0", + "illuminate/support": "4.2.*" + }, + "autoload": { + "psr-0": { + "Airavata\\Wsis": "src/" + } + }, + "minimum-stability": "stable" +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/phpunit.xml ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/phpunit.xml b/workbench/airavata/wsis/phpunit.xml new file mode 100755 index 0000000..3347b75 --- /dev/null +++ b/workbench/airavata/wsis/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests/ + + + http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/Facades/Wsis.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/Facades/Wsis.php b/workbench/airavata/wsis/src/Airavata/Wsis/Facades/Wsis.php new file mode 100755 index 0000000..d89bc7c --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/Facades/Wsis.php @@ -0,0 +1,16 @@ +serviceStub = new TenantMgtAdminStub( + $server_url . "TenantMgtAdminService?wsdl", $options + ); + } + + /** + * Function to get the soap client + * + * @return SoapClient + */ + public function getSoapClient(){ + return $this->serviceStub; + } + + /** + * Method to retrieve all tenant information. Some tenant information + * such as admin name are not returned by wso2 IS + * @return mixed + */ + public function retrieveTenants(){ + $parameters = new retrieveTenants(); + return $this->serviceStub->retrieveTenants($parameters)->return; + } + + /** + * Method to get tenant information giving tenant domain + * @param $domain domain of the tenant + * @return mixed + */ + public function getTenant($domain){ + $parameters = new getTenant(); + $parameters->tenantDomain = $domain; + return $this->serviceStub->getTenant($parameters)->return; + } + + /** + * Method to create a new tenant + * @param $active whether tenant active or not + * @param $adminUsername + * @param $adminPassword + * @param $email + * @param $firstName Admin's first name + * @param $lastName Admin's last name + * @param $tenantDomain + */ + public function addTenant($active, $adminUsername, $adminPassword, $email, + $firstName, $lastName, $tenantDomain){ + $tenantInfoBean = new TenantInfoBean(); + $tenantInfoBean->active = $active; + $tenantInfoBean->admin = $adminUsername; + $tenantInfoBean->adminPassword = $adminPassword; + $tenantInfoBean->email = $email; + $tenantInfoBean->firstName = $firstName; + $tenantInfoBean->lastName = $lastName; + $tenantInfoBean->tenantDomain = $tenantDomain; + + $addTenant = new addTenant(); + $addTenant->tenantInfoBean = $tenantInfoBean; + $this->serviceStub->addTenant($addTenant); + } + + /** + * Method to remove an existing tenant giving tenant domain + * @param $tenantDomain + */ + public function deleteTenant($tenantDomain){ + $parameters = new deleteTenant(); + $parameters->tenantDomain = $tenantDomain; + $this->serviceStub->deleteTenant($parameters); + } + + /** + * Method to activate a tenant + * @param $tenantDomain + */ + public function activateTenant($tenantDomain){ + $parameters = new activateTenant(); + $parameters->tenantDomain = $tenantDomain; + $this->serviceStub->activateTenant($parameters); + } + + /** + * Method to deactivate a tenant + * @param $tenantDomain + */ + public function deactivateTenant($tenantDomain){ + $parameters = new deactivateTenant(); + $parameters->tenantDomain = $tenantDomain; + $this->serviceStub->deactivateTenant($parameters); + } + + /** + * Method to update an existing tenant + * @param $tenantId + * @param $active + * @param $adminUsername + * @param $adminPassword + * @param $email + * @param $firstName + * @param $lastName + * @param $tenantDomain + */ + public function updateTenant($tenantId, $active, $adminUsername, $adminPassword, $email, + $firstName, $lastName, $tenantDomain){ + $tenantInfoBean = new TenantInfoBean(); + $tenantInfoBean->tenantId = $tenantId; + $tenantInfoBean->active = $active; + $tenantInfoBean->admin = $adminUsername; + $tenantInfoBean->adminPassword = $adminPassword; + $tenantInfoBean->email = $email; + $tenantInfoBean->firstName = $firstName; + $tenantInfoBean->lastName = $lastName; + $tenantInfoBean->tenantDomain = $tenantDomain; + + $updateTenant = new updateTenant(); + $updateTenant->tenantInfoBean = $tenantInfoBean; + $this->serviceStub->updateTenant($updateTenant); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/TenantMgtAdminStub.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/TenantMgtAdminStub.php b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/TenantMgtAdminStub.php new file mode 100755 index 0000000..70dca16 --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/TenantMgtAdminStub.php @@ -0,0 +1,306 @@ + 'TenantMgtAdminServiceException', + 'deleteTenant' => 'deleteTenant', + 'updateTenant' => 'updateTenant', + 'addTenant' => 'addTenant', + 'addTenantResponse' => 'addTenantResponse', + 'activateTenant' => 'activateTenant', + 'deactivateTenant' => 'deactivateTenant', + 'getTenant' => 'getTenant', + 'getTenantResponse' => 'getTenantResponse', + 'retrievePaginatedTenants' => 'retrievePaginatedTenants', + 'retrievePaginatedTenantsResponse' => 'retrievePaginatedTenantsResponse', + 'retrieveTenants' => 'retrieveTenants', + 'retrieveTenantsResponse' => 'retrieveTenantsResponse', + 'retrievePartialSearchTenants' => 'retrievePartialSearchTenants', + 'retrievePartialSearchTenantsResponse' => 'retrievePartialSearchTenantsResponse', + 'addSkeletonTenant' => 'addSkeletonTenant', + 'addSkeletonTenantResponse' => 'addSkeletonTenantResponse', + 'retrievePaginatedPartialSearchTenants' => 'retrievePaginatedPartialSearchTenants', + 'retrievePaginatedPartialSearchTenantsResponse' => 'retrievePaginatedPartialSearchTenantsResponse', + 'TenantInfoBean' => 'TenantInfoBean', + 'PaginatedTenantInfoBean' => 'PaginatedTenantInfoBean', + ); + + public function TenantMgtAdminStub($wsdl, $options = array()) { + foreach(self::$classmap as $key => $value) { + if(!isset($options['classmap'][$key])) { + $options['classmap'][$key] = $value; + } + } + parent::__construct($wsdl, $options); + } + + /** + * + * + * @param retrieveTenants $parameters + * @return retrieveTenantsResponse + */ + public function retrieveTenants(retrieveTenants $parameters) { + return $this->__soapCall('retrieveTenants', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param getTenant $parameters + * @return getTenantResponse + */ + public function getTenant(getTenant $parameters) { + return $this->__soapCall('getTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param deactivateTenant $parameters + * @return void + */ + public function deactivateTenant(deactivateTenant $parameters) { + return $this->__soapCall('deactivateTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param retrievePartialSearchTenants $parameters + * @return retrievePartialSearchTenantsResponse + */ + public function retrievePartialSearchTenants(retrievePartialSearchTenants $parameters) { + return $this->__soapCall('retrievePartialSearchTenants', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param retrievePaginatedTenants $parameters + * @return retrievePaginatedTenantsResponse + */ + public function retrievePaginatedTenants(retrievePaginatedTenants $parameters) { + return $this->__soapCall('retrievePaginatedTenants', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param updateTenant $parameters + * @return void + */ + public function updateTenant(updateTenant $parameters) { + return $this->__soapCall('updateTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param addSkeletonTenant $parameters + * @return addSkeletonTenantResponse + */ + public function addSkeletonTenant(addSkeletonTenant $parameters) { + return $this->__soapCall('addSkeletonTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param addTenant $parameters + * @return addTenantResponse + */ + public function addTenant(addTenant $parameters) { + return $this->__soapCall('addTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param retrievePaginatedPartialSearchTenants $parameters + * @return retrievePaginatedPartialSearchTenantsResponse + */ + public function retrievePaginatedPartialSearchTenants(retrievePaginatedPartialSearchTenants $parameters) { + return $this->__soapCall('retrievePaginatedPartialSearchTenants', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param activateTenant $parameters + * @return void + */ + public function activateTenant(activateTenant $parameters) { + return $this->__soapCall('activateTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + + /** + * + * + * @param deleteTenant $parameters + * @return void + */ + public function deleteTenant(deleteTenant $parameters) { + return $this->__soapCall('deleteTenant', array($parameters), array( + 'uri' => 'http://services.mgt.tenant.carbon.wso2.org', + 'soapaction' => '' + ) + ); + } + +} + +?> http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManager.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManager.php b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManager.php new file mode 100755 index 0000000..b1b013e --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManager.php @@ -0,0 +1,203 @@ +serviceStub = new UserStoreManagerStub( + $server_url . "RemoteUserStoreManagerService?wsdl", $options + ); + } + + /** + * Function to get the soap client + * + * @return SoapClient + */ + public function getSoapClient(){ + return $this->serviceStub; + } + + /** + * Function to authenticate the user with RemoteUserStoreManager Service + * @param type $username + * @param type $password + */ + public function authenticate($username, $password){ + $parameters = new Authenticate(); + $parameters->userName = $username; + $parameters->credential = $password; + return $this->serviceStub->authenticate($parameters)->return; + } + + /** + * Function to add new user by providing username and password + * + * @param type $userName + * @param type $password + */ + public function addUser($userName, $password, $fullName){ + $parameters = new AddUser(); + $parameters->userName = $userName; + $parameters->credential = $password; + $parameters->claims = null; + $parameters->profileName = $fullName; + $parameters->requirePasswordChange = false; + $parameters->roleList = null; + $this->serviceStub->addUser($parameters); + } + /** + * Function to delete existing user by providing the username. + * + * @param string $username + */ + public function deleteUser($username){ + $parameters = new DeleteUser(); + $parameters->userName = $username; + $this->serviceStub->deleteUser($parameters); + } + + /** + * Function to check whether a role is existing + * + * @param string $roleName + * @return IsExistingRoleResponse + */ + public function isExistingRole( $roleName) { + $parameters = new IsExistingRole(); + $parameters->roleName = $roleName; + $this->serviceStub->isExistingRole( $parameters)->return; + } + /** + * Function to add new role by providing the role name. + * + * @param string $roleName + */ + public function addRole($roleName){ + $paramerters = new AddRole(); + $paramerters->roleName=$roleName; + $paramerters->userList=null; + $paramerters->permissions=null; + $this->serviceStub->addRole($paramerters); + } + + /** + * Function to delete an existing role + * + * @param string $roleName + */ + public function deleteRole($roleName){ + $parameters = new DeleteRole(); + $parameters->roleName = $roleName; + $this->serviceStub->deleteRole($parameters); + } + + /** + * Function to get a list of users + * + * @return username list + */ + public function listUsers(){ + $parameters = new ListUsers(); + $parameters->filter = "*"; + $parameters->maxItemLimit = -1; + + return $this->serviceStub->listUsers($parameters)->return; + } + + /** + * Function get user list + * + * @param GetUserList $parameters + * @return GetUserListResponse + */ + public function getUserList(){ + $parameters = new GetUserList(); + } + + + /** + * Function to check whether the given username already exists + * + * @param string $username + * @return boolean + */ + public function isExistingUser($username) { + $parameters = new IsExistingUser(); + $parameters->userName = $username; + + return $this->serviceStub->isExistingUser($parameters)->return; + } + + /** + * Function to get the list of all existing roles + * + * @return roles list + */ + public function getRoleNames( $parameters = null){ + $parameters = new GetRoleNames(); + return $this->serviceStub->getRoleNames( $parameters)->return; + } + + /** + * Function to get role of a user + * + * @return User Role + */ + public function getRoleListOfUser( $username){ + $parameters = new GetRoleListOfUser(); + $parameters->userName = $username; + return $this->serviceStub->GetRoleListOfUser( $parameters)->return; + } + + /** + * Function to get the user list of role + * + * @param GetUserListOfRole $parameters + * @return GetUserListOfRoleResponse + */ + public function getUserListOfRole( $roleName){ + $parameters = new GetUserListOfRole(); + $parameters->roleName = $roleName; + return $this->serviceStub->getUserListOfRole( $parameters); + } + + /** + * Function to update role list of user + * + * @param UpdateRoleListOfUser $parameters + * @return void + */ + public function updateRoleListOfUser( $username, $roles){ + $parameters = new UpdateRoleListOfUser(); + $parameters->userName = $username; + $parameters->deletedRoles = $roles["deleted"]; + $parameters->newRoles = $roles["new"]; + return $this->serviceStub->updateRoleListOfUser( $parameters); + } + + /** + * Function to get the tenant id + * + * @param GetTenantId $parameters + * @return GetTenantIdResponse + */ + public function getTenantId(){ + $parameters = new GetTenantId(); + + return $this->serviceStub->getTenantId( $parameters); + } +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManagerStub.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManagerStub.php b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManagerStub.php new file mode 100755 index 0000000..c43fa48 --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/Stubs/UserStoreManagerStub.php @@ -0,0 +1,1570 @@ + $return + * @access public + */ + public $return; + +} + +class IsReadOnly { + +} + +class IsReadOnlyResponse { + + /** + * @var boolean $return + * @access public + */ + public $return; + +} + +class Authenticate { + + /** + * @var string $userName + * @access public + */ + public $userName; + + /** + * @var string $credential + * @access public + */ + public $credential; + +} + +class AuthenticateResponse { + + /** + * @var boolean $return + * @access public + */ + public $return; + +} + +class UserStoreException { + +} + +/** + * UserStoreManagerService class + * + */ +class UserStoreManagerStub extends SoapClient { + + private static $classmap = array( + 'ClaimDTO' => 'ClaimDTO', + 'PermissionDTO' => 'PermissionDTO', + 'Tenant' => 'Tenant', + 'RealmConfiguration' => 'RealmConfiguration', + 'ClaimValue' => 'ClaimValue', + 'addUserClaimValues' => 'AddUserClaimValues', + 'getUserClaimValuesForClaims' => 'GetUserClaimValuesForClaims', + 'getUserClaimValuesForClaimsResponse' => 'GetUserClaimValuesForClaimsResponse', + 'getTenantIdofUser' => 'GetTenantIdofUser', + 'getTenantIdofUserResponse' => 'GetTenantIdofUserResponse', + 'addUserClaimValue' => 'AddUserClaimValue', + 'getUserClaimValues' => 'GetUserClaimValues', + 'getUserClaimValuesResponse' => 'GetUserClaimValuesResponse', + 'getTenantId' => 'GetTenantId', + 'getTenantIdResponse' => 'GetTenantIdResponse', + 'addUser' => 'AddUser', + 'addRole' => 'AddRole', + 'getUserList' => 'GetUserList', + 'getUserListResponse' => 'GetUserListResponse', + 'updateCredential' => 'UpdateCredential', + 'updateUserListOfRole' => 'UpdateUserListOfRole', + 'updateRoleListOfUser' => 'UpdateRoleListOfUser', + 'setUserClaimValue' => 'SetUserClaimValue', + 'setUserClaimValues' => 'SetUserClaimValues', + 'deleteUserClaimValue' => 'DeleteUserClaimValue', + 'deleteUserClaimValues' => 'DeleteUserClaimValues', + 'getHybridRoles' => 'GetHybridRoles', + 'getHybridRolesResponse' => 'GetHybridRolesResponse', + 'getPasswordExpirationTime' => 'GetPasswordExpirationTime', + 'getPasswordExpirationTimeResponse' => 'GetPasswordExpirationTimeResponse', + 'updateRoleName' => 'UpdateRoleName', + 'listUsers' => 'ListUsers', + 'listUsersResponse' => 'ListUsersResponse', + 'isExistingUser' => 'IsExistingUser', + 'isExistingUserResponse' => 'IsExistingUserResponse', + 'isExistingRole' => 'IsExistingRole', + 'isExistingRoleResponse' => 'IsExistingRoleResponse', + 'getRoleNames' => 'GetRoleNames', + 'getRoleNamesResponse' => 'GetRoleNamesResponse', + 'getProfileNames' => 'GetProfileNames', + 'getProfileNamesResponse' => 'GetProfileNamesResponse', + 'getUserListOfRole' => 'GetUserListOfRole', + 'getUserListOfRoleResponse' => 'GetUserListOfRoleResponse', + 'getUserClaimValue' => 'GetUserClaimValue', + 'getUserClaimValueResponse' => 'GetUserClaimValueResponse', + 'getAllProfileNames' => 'GetAllProfileNames', + 'getAllProfileNamesResponse' => 'GetAllProfileNamesResponse', + 'updateCredentialByAdmin' => 'UpdateCredentialByAdmin', + 'deleteUser' => 'DeleteUser', + 'deleteRole' => 'DeleteRole', + 'getUserId' => 'GetUserId', + 'getUserIdResponse' => 'GetUserIdResponse', + 'getRoleListOfUser' => 'GetRoleListOfUser', + 'getRoleListOfUserResponse' => 'GetRoleListOfUserResponse', + 'getProperties' => 'GetProperties', + 'getPropertiesResponse' => 'GetPropertiesResponse', + 'isReadOnly' => 'IsReadOnly', + 'isReadOnlyResponse' => 'IsReadOnlyResponse', + 'authenticate' => 'Authenticate', + 'authenticateResponse' => 'AuthenticateResponse', + 'Tenant' => 'Tenant' + ); + + public function RemoteUserStoreManagerStub($wsdl, $options = array()) { + foreach (self::$classmap as $key => $value) { + if (!isset($options['classmap'][$key])) { + $options['classmap'][$key] = $value; + } + } + parent::__construct($wsdl, $options); + } + + /** + * Function to authenticate + * + * @param Authenticate $parameters + * @return AuthenticateResponse + */ + public function authenticate(Authenticate $parameters) { + return $this->__soapCall('authenticate', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function get user list + * + * @param GetUserList $parameters + * @return GetUserListResponse + */ + public function getUserList(GetUserList $parameters) { + return $this->__soapCall('getUserList', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the user claim value + * + * @param GetUserClaimValue $parameters + * @return GetUserClaimValueResponse + */ + public function getUserClaimValue(GetUserClaimValue $parameters) { + return $this->__soapCall('getUserClaimValue', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the user list of role + * + * @param GetUserListOfRole $parameters + * @return GetUserListOfRoleResponse + */ + public function getUserListOfRole(GetUserListOfRole $parameters) { + return $this->__soapCall('getUserListOfRole', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to check whether the service is read only + * + * @param IsReadOnly $parameters + * @return IsReadOnlyResponse + */ + public function isReadOnly(IsReadOnly $parameters) { + return $this->__soapCall('isReadOnly', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to update the credentials + * + * @param UpdateCredential $parameters + * @return void + */ + public function updateCredential(UpdateCredential $parameters) { + return $this->__soapCall('updateCredential', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to set user claim value + * + * @param SetUserClaimValue $parameters + * @return void + */ + public function setUserClaimValue(setUserClaimValue $parameters) { + return $this->__soapCall('setUserClaimValue', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the claim values for claims + * + * @param GetUserClaimValuesForClaims $parameters + * @return GetUserClaimValuesForClaimsResponse + */ + public function getUserClaimValuesForClaims(GetUserClaimValuesForClaims $parameters) { + return $this->__soapCall('getUserClaimValuesForClaims', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to delete user claim values + * + * @param DeleteUserClaimValues $parameters + * @return void + */ + public function deleteUserClaimValues(DeleteUserClaimValues $parameters) { + return $this->__soapCall('deleteUserClaimValues', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to delete user claim value + * + * @param DeleteUserClaimValue $parameters + * @return void + */ + public function deleteUserClaimValue(DeleteUserClaimValue $parameters) { + return $this->__soapCall('deleteUserClaimValue', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to check whether use is existing + * + * @param IsExistingUser $parameters + * @return IsExistingUserResponse + */ + public function isExistingUser(IsExistingUser $parameters) { + return $this->__soapCall('isExistingUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to update credential by admin + * + * @param UpdateCredentialByAdmin $parameters + * @return void + */ + public function updateCredentialByAdmin(UpdateCredentialByAdmin $parameters) { + return $this->__soapCall('updateCredentialByAdmin', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the tenant id + * + * @param GetTenantId $parameters + * @return GetTenantIdResponse + */ + public function getTenantId(GetTenantId $parameters) { + return $this->__soapCall('getTenantId', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get role names + * + * @param GetRoleNames $parameters + * @return GetRoleNamesResponse + */ + public function getRoleNames(GetRoleNames $parameters) { + return $this->__soapCall('getRoleNames', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Funtion to get properties + * + * @param GetProperties $parameters + * @return GetPropertiesResponse + */ + public function getProperties(GetProperties $parameters) { + return $this->__soapCall('getProperties', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get user id + * + * @param GetUserId $parameters + * @return GetUserIdResponse + */ + public function getUserId(GetUserId $parameters) { + return $this->__soapCall('getUserId', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get all the profile names + * + * @param GetAllProfileNames $parameters + * @return GetAllProfileNamesResponse + */ + public function getAllProfileNames(GetAllProfileNames $parameters) { + return $this->__soapCall('getAllProfileNames', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the password expiration time + * + * @param GetPasswordExpirationTime $parameters + * @return GetPasswordExpirationTimeResponse + */ + public function getPasswordExpirationTime(GetPasswordExpirationTime $parameters) { + return $this->__soapCall('getPasswordExpirationTime', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to list users + * + * @param ListUsers $parameters + * @return ListUsersResponse + */ + public function listUsers(ListUsers $parameters) { + return $this->__soapCall('listUsers', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to delete role + * + * @param DeleteRole $parameters + * @return void + */ + public function deleteRole(DeleteRole $parameters) { + return $this->__soapCall('deleteRole', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to delete user + * + * @param DeleteUser $parameters + * @return void + */ + public function deleteUser(DeleteUser $parameters) { + return $this->__soapCall('deleteUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function get the role list of the user + * + * @param GetRoleListOfUser $parameters + * @return GetRoleListOfUserResponse + */ + public function getRoleListOfUser(GetRoleListOfUser $parameters) { + return $this->__soapCall('getRoleListOfUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to update the role name + * + * @param UpdateRoleName $parameters + * @return void + */ + public function updateRoleName(UpdateRoleName $parameters) { + return $this->__soapCall('updateRoleName', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to check whether a role is existing + * + * @param IsExistingRole $parameters + * @return IsExistingRoleResponse + */ + public function isExistingRole(IsExistingRole $parameters) { + return $this->__soapCall('isExistingRole', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to update role list of user + * + * @param UpdateRoleListOfUser $parameters + * @return void + */ + public function updateRoleListOfUser(UpdateRoleListOfUser $parameters) { + return $this->__soapCall('updateRoleListOfUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get user claim values + * + * @param GetUserClaimValues $parameters + * @return GetUserClaimValuesResponse + */ + public function getUserClaimValues(GetUserClaimValues $parameters) { + return $this->__soapCall('getUserClaimValues', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get hybrid roles + * + * @param GetHybridRoles $parameters + * @return GetHybridRolesResponse + */ + public function getHybridRoles(GetHybridRoles $parameters) { + return $this->__soapCall('getHybridRoles', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to add user claim values + * + * @param AddUserClaimValues $parameters + * @return void + */ + public function addUserClaimValues(AddUserClaimValues $parameters) { + return $this->__soapCall('addUserClaimValues', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to add user + * + * @param AddUser $parameters + * @return void + */ + public function addUser(AddUser $parameters) { + return $this->__soapCall('addUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to add role + * + * @param AddRole $parameters + * @return void + */ + public function addRole(AddRole $parameters) { + return $this->__soapCall('addRole', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to update user list of roles + * + * @param UpdateUserListOfRole $parameters + * @return void + */ + public function updateUserListOfRole(UpdateUserListOfRole $parameters) { + return $this->__soapCall('updateUserListOfRole', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the tenant Id + * + * @param GetTenantIdofUser $parameters + * @return GetTenantIdofUserResponse + */ + public function getTenantIdofUser(GetTenantIdofUser $parameters) { + return $this->__soapCall('getTenantIdofUser', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to set user claim values + * + * @param SetUserClaimValues $parameters + * @return void + */ + public function setUserClaimValues(SetUserClaimValues $parameters) { + return $this->__soapCall('setUserClaimValues', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to add user claim value + * + * @param AddUserClaimValue $parameters + * @return void + */ + public function addUserClaimValue(AddUserClaimValue $parameters) { + return $this->__soapCall('addUserClaimValue', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + + /** + * Function to get the profile names + * + * @param GetProfileNames $parameters + * @return GetProfileNamesResponse + */ + public function getProfileNames(GetProfileNames $parameters) { + return $this->__soapCall('getProfileNames', array($parameters), array( + 'uri' => 'http://service.ws.um.carbon.wso2.org', + 'soapaction' => '' + )); + } + +} + +?> http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/Wsis.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/Wsis.php b/workbench/airavata/wsis/src/Airavata/Wsis/Wsis.php new file mode 100755 index 0000000..e4cbb6e --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/Wsis.php @@ -0,0 +1,280 @@ + array( + 'verify_peer' => $verify_peer, + "allow_self_signed"=> $allow_selfsigned_cert, + 'cafile' => $cafile_path, + 'CN_match' => $server, + ) + )); + + $parameters = array( + 'login' => $admin_username, + 'password' => $admin_password, + 'stream_context' => $context, + 'trace' => 1, + 'features' => SOAP_WAIT_ONE_WAY_CALLS + ); + + $this->server = $server; + $this->service_url = $service_url; + + try { + $this->userStoreManager = new UserStoreManager($service_url, $parameters); + } catch (Exception $ex) { + print_r( $ex); exit; + throw new Exception("Unable to instantiate client", 0, $ex); + } + } + + + /** + * Function to add new user + * + * @param string $userName + * @param string $password + * @return void + * @throws Exception + */ + public function addUser($userName, $password, $fullName) { + try { + $this->userStoreManager->addUser($userName, $password, $fullName); + } catch (Exception $ex) { + throw new Exception("Unable to add new user", 0, $ex); + } + } + + /** + * Function to delete existing user + * + * @param string $username + * @return void + * @throws Exception + */ + public function deleteUser($username) { + try { + $this->userStoreManager->deleteUser($username); + } catch (Exception $ex) { + throw new Exception("Unable to delete user", 0, $ex); + } + } + + + /** + * Function to authenticate user + * + * @param string $username + * @param string $password + * @return boolean + * @throws Exception + */ + public function authenticate($username, $password){ + try { + return $this->userStoreManager->authenticate($username, $password); + } catch (Exception $ex) { + var_dump( $ex); exit; + throw new Exception("Unable to authenticate user", 0, $ex); + } + } + + /** + * Function to check whether username exists + * + * @param string $username + * @return boolean + * @throws Exception + */ + public function username_exists($username){ + try { + return $this->userStoreManager->isExistingUser($username); + } catch (Exception $ex) { + throw new Exception("Unable to verify username exists", 0, $ex); + } + } + + /** + * Function to check whether a role is existing + * + * @param string $roleName + * @return IsExistingRoleResponse + */ + public function is_existing_role( $roleName){ + try { + return $this->userStoreManager->isExistingRole( $roleName); + } catch (Exception $ex) { + throw new Exception("Unable to check if the role exists", 0, $ex); + } + } + + /** + * Function to add new role by providing the role name. + * + * @param string $roleName + */ + public function add_role($roleName){ + try { + return $this->userStoreManager->addRole( $roleName); + } catch (Exception $ex) { + throw new Exception("Unable to add this role", 0, $ex); + } + } + + /** + * Function to delete existing role + * + * @param string $roleName + * @return void + * @throws Exception + */ + public function delete_role($roleName) { + try { + $this->userStoreManager->deleteRole($roleName); + } catch (Exception $ex) { + var_dump( $ex); exit; + + throw new Exception("Unable to delete role", 0, $ex); + } + } + + /** + * Function to get the list of all existing roles + * + * @return roles list + */ + public function get_all_roles(){ + try { + return $this->userStoreManager->getRoleNames(); + } catch (Exception $ex) { + throw new Exception("Unable to get all roles", 0, $ex); + } + } + + /** + * Function to get role of a user + * + * @return user role + */ + public function get_user_roles( $username){ + try { + return $this->userStoreManager->getRoleListOfUser( $username); + } catch (Exception $ex) { + throw new Exception("Unable to get User roles.", 0, $ex); + } + } + + /** + * Function to get the user list of role + * + * @param GetUserListOfRole $parameters + * @return GetUserListOfRoleResponse + */ + public function get_userlist_of_role( $role){ + try { + return $this->userStoreManager->getUserListOfRole( $role); + } catch (Exception $ex) { + var_dump( $ex); exit; + throw new Exception("Unable to get user list of roles.", 0, $ex); + } + } + + /** + * Function to update role list of user + * + * @param UpdateRoleListOfUser $parameters + * @return void + */ + public function update_user_roles( $username, $roles){ + try { + return $this->userStoreManager->updateRoleListOfUser( $username, $roles); + } catch (Exception $ex) { + throw new Exception("Unable to update role of the user.", 0, $ex); + } + } + + /** + * Function to list users + * + * @param void + * @return void + */ + public function list_users(){ + try { + return $this->userStoreManager->listUsers(); + } catch (Exception $ex) { + var_dump( $ex->debug_message); + throw new Exception("Unable to list users.", 0, $ex); + } + } + + /** + * Function to get the tenant id + * + * @param GetTenantId $parameters + * @return GetTenantIdResponse + */ + public function get_tenant_id(){ + try { + return $this->userStoreManager->getTenantId(); + } catch (Exception $ex) { + var_dump( $ex->debug_message); + throw new Exception("Unable to get the tenant Id.", 0, $ex); + } + } + + /** + * Function create a new Tenant + * + * @param Tenant $parameters + * @return void + */ + public function create_tenant( $inputs){ + try { + return $this->userStoreManager->createTenant( $inputs); + } catch (Exception $ex) { + var_dump( $ex); + throw new Exception("Unable to create Tenant.", 0, $ex); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/Airavata/Wsis/WsisServiceProvider.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/Airavata/Wsis/WsisServiceProvider.php b/workbench/airavata/wsis/src/Airavata/Wsis/WsisServiceProvider.php new file mode 100755 index 0000000..e5a2cf4 --- /dev/null +++ b/workbench/airavata/wsis/src/Airavata/Wsis/WsisServiceProvider.php @@ -0,0 +1,64 @@ +package('airavata/wsis'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + //registering service provider + $this->app['wsis'] = $this->app->share(function($app) + { + return new Wsis( + Config::get('wsis::admin-username'), + Config::get('wsis::admin-password'), + Config::get('wsis::server'), + Config::get('wsis::service-url'), + Config::get('wsis::cafile-path'), + Config::get('wsis::verify-peer'), + Config::get('wsis::allow-selfsigned-cert') + ); + }); + + //registering alis + $this->app->booting(function() + { + $loader = \Illuminate\Foundation\AliasLoader::getInstance(); + $loader->alias('WSIS', 'Airavata\Wsis\Facades\Wsis'); + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return array('wsis'); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/src/config/config.php ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/src/config/config.php b/workbench/airavata/wsis/src/config/config.php new file mode 100644 index 0000000..69f61cf --- /dev/null +++ b/workbench/airavata/wsis/src/config/config.php @@ -0,0 +1,52 @@ + 'admin', + + /** + * Gateway user role + */ + 'gateway-admin' => 'Internal/everyone', + + /** + * Tenant admin's username + */ + 'admin-username' => 'admin-username', + + /** + * Tenant admin's password + */ + 'admin-password' => 'admin-password', + + /** + * Identity server domain + */ + 'server' => 'idp.scigap.org', + + /** + * Identity server web services endpoint + */ + 'service-url' => 'https://idp.scigap.org:7443/services/', + + /** + * Gateway domain name + */ + 'gateway-id' => 'default', + + /** + * Path to the server certificate file + */ + 'cafile-path' => app_path() . '/resources/security/idp_scigap_org.pem', + + /** + * Enable HTTPS server verification + */ + 'verify-peer' => true, + + /** + * Allow self signed server certificates + */ + 'allow-self-signed' => false +); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2040a6d4/workbench/airavata/wsis/tests/.gitkeep ---------------------------------------------------------------------- diff --git a/workbench/airavata/wsis/tests/.gitkeep b/workbench/airavata/wsis/tests/.gitkeep new file mode 100755 index 0000000..e69de29