You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/11/15 16:28:10 UTC
airavata-php-gateway git commit: AIRAVATA-2226 Remove trailing space
from public key
Repository: airavata-php-gateway
Updated Branches:
refs/heads/develop 424e82758 -> 1811d7632
AIRAVATA-2226 Remove trailing space from public key
Public key entry in authorized_keys file must not have a trailing space.
If there is a trailing space, public key auth fails.
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/1811d763
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/1811d763
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/1811d763
Branch: refs/heads/develop
Commit: 1811d763284605b7ae6618e48733d0c999811aab
Parents: 424e827
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Nov 15 11:25:10 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Nov 15 11:25:10 2016 -0500
----------------------------------------------------------------------
app/libraries/URPUtilities.php | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1811d763/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index c01da2b..be62b5c 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -57,8 +57,13 @@ class URPUtilities
$userId = Session::get('username');
$gatewayId = Session::get('gateway_id');
- return URPUtilities::create_credential_summary_map(
- Airavata::getAllSSHPubKeysSummaryForUserInGateway(Session::get('authz-token'), $gatewayId, $userId));
+ $all_ssh_pub_key_summaries = Airavata::getAllSSHPubKeysSummaryForUserInGateway(Session::get('authz-token'), $gatewayId, $userId);
+ foreach ($all_ssh_pub_key_summaries as $ssh_pub_key_summary) {
+ # strip whitespace from public key: there can't be trailing
+ # whitespace in a public key entry in the authorized_keys file
+ $ssh_pub_key_summary->publicKey = trim($ssh_pub_key_summary->publicKey);
+ }
+ return URPUtilities::create_credential_summary_map($all_ssh_pub_key_summaries);
}
// Create array of CredentialSummary objects where the token is the key