Skip to content

Commit

Permalink
Add comments and missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jvillafanez committed Apr 25, 2022
1 parent baf7b98 commit 80bff00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files_external/lib/Lib/RSAStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static function getGlobalInstance(): RSAStore {
* Set a new RSAStore instance as a global instance overwriting whatever
* instance was there.
* This shouldn't be needed outside of unit tests
* @param RSAStore|null The RSAStore to be set as global instance, or null
* to destroy the global instance (destroying the global instance will allow
* getting the default one again)
*/
public static function setGlobalInstance(?RSAStore $rsaStore) {
self::$rsaStore = $rsaStore;
Expand Down
2 changes: 2 additions & 0 deletions apps/files_external/lib/Lib/Storage/SFTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function __construct($params) {
$this->user = $params['user'];

if (isset($params['private_key'])) {
// The $params['private_key'] contains the token to get the private key, not the key.
// The actual private key is fetched from the RSAStore using that token.
$rsaStore = RSAStore::getGlobalInstance();
$this->auth = $rsaStore->retrieveData($params['private_key']);
} elseif (isset($params['password'])) {
Expand Down

0 comments on commit 80bff00

Please sign in to comment.