You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by is...@apache.org on 2020/08/17 19:11:18 UTC
[airavata-php-gateway] branch custos-integration updated: Adding
logs
This is an automated email from the ASF dual-hosted git repository.
isjarana pushed a commit to branch custos-integration
in repository https://gitbox.apache.org/repos/asf/airavata-php-gateway.git
The following commit(s) were added to refs/heads/custos-integration by this push:
new 1dcb50e Adding logs
1dcb50e is described below
commit 1dcb50ee487d93b6b7e9540b1ef6a355fb0b7f4f
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Mon Aug 17 15:10:57 2020 -0400
Adding logs
---
app/libraries/AdminUtilities.php | 67 +++++++++++++++++++++++++++-------------
1 file changed, 46 insertions(+), 21 deletions(-)
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 3c11266..c9a4e2a 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -39,8 +39,16 @@ class AdminUtilities
$gateway->requesterUsername = Session::get('username');
$gateway->gatewayApprovalStatus = GatewayApprovalStatus::APPROVED;
+
+
+ $logoutURI = $gateway->gatewayURL;
+ $redirectURI = $logoutURI."auth/callback*";
+ $gateway->redirectURLs = array($logoutURI,$redirectURI);
+ $gateway->scope = "openid profile email org.cilogon.userinfo" ;
+
try {
- TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
+ Log::info("Gateway #####".$gateway);
+ // TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
return 1;
}
catch (Exception $ex) {
@@ -71,13 +79,15 @@ class AdminUtilities
$gateway->gatewayPublicAbstract = $inputs["public-project-description"];
$gateway->requesterUsername = Session::get('username');
- try {
- TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
+
+ Log::info("Check request #####".$gateway);
+ // try {
+ // TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
return 1;
- }
- catch (Exception $ex) {
- return -1;
- }
+ // }
+ // catch (Exception $ex) {
+ // return -1;
+ // }
}
public static function request_gateway( $inputs)
@@ -105,7 +115,18 @@ class AdminUtilities
$gateway->gatewayPublicAbstract = $inputs["public-project-description"];
$gateway->requesterUsername = Session::get('username');
- return TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
+
+ $logoutURI = $gateway->gatewayURL;
+ $redirectURI = $logoutURI."auth/callback*";
+ $gateway->redirectURLs = array($logoutURI,$redirectURI);
+ $gateway->scope = "openid profile email org.cilogon.userinfo" ;
+
+
+ Log::info ("Request_Gateway ".$gateway);
+
+ return 1;
+
+ // return TenantProfileService::addGateway(Session::get('authz-token'), $gateway);
}
public static function get_gateway_approval_statuses()
@@ -129,14 +150,17 @@ class AdminUtilities
$gateway->gatewayURL = $gatewayData["gateway-url"];
$gateway->reviewProposalDescription = $gatewayData["project-details"];
$gateway->gatewayPublicAbstract = $gatewayData["public-project-description"];
- if( TenantProfileService::updateGateway( Session::get('authz-token'), $gateway) ){
+
+ Log::info("user_update_gateway ".$gateway);
+
+ // if( TenantProfileService::updateGateway( Session::get('authz-token'), $gateway) ){
return 1;
- }
- else{
+ // }
+ // else{
//Need to find a better way for this.
// retun echo "Tenant Name is already in use";
- return -1;
- }
+ // return -1;
+ // }
}
public static function update_gateway( $gatewayId, $gatewayData){
@@ -166,7 +190,7 @@ class AdminUtilities
return -1;
}
}
- $gateway = IamAdminServices::setUpGateway( Session::get('authz-token'), $gateway);
+ // $gateway = IamAdminServices::setUpGateway( Session::get('authz-token'), $gateway);
$gateway->gatewayApprovalStatus = GatewayApprovalStatus::CREATED;
}
elseif( isset( $gatewayData["approveRequest"])){
@@ -217,14 +241,15 @@ class AdminUtilities
$gateway->gatewayApprovalStatus = GatewayApprovalStatus::DEACTIVATED;
}
- if( TenantProfileService::updateGateway( Session::get('authz-token'), $gateway) ){
+ Log.info("Calling update gateway".$gateway);
+ // if( TenantProfileService::updateGateway( Session::get('authz-token'), $gateway) ){
return 1;
- }
- else{
- //Need to find a better way for this.
- // retun echo "Tenant Name is already in use";
- return -1;
- }
+// }
+// else{
+// //Need to find a better way for this.
+// // retun echo "Tenant Name is already in use";
+// return -1;
+// }
}
public static function add_tenant( $gateway){