Passed
Push — master ( 41d2e2...e93478 )
by Roeland
20:11 queued 09:24
created
lib/private/App/CodeChecker/LanguageParseChecker.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -25,36 +25,36 @@
 block discarded – undo
25 25
 
26 26
 class LanguageParseChecker {
27 27
 
28
-	/**
29
-	 * @param string $appId
30
-	 * @return array
31
-	 */
32
-	public function analyse($appId) {
33
-		$appPath = \OC_App::getAppPath($appId);
34
-		if ($appPath === false) {
35
-			throw new \RuntimeException("No app with given id <$appId> known.");
36
-		}
37
-
38
-		if (!is_dir($appPath . '/l10n/')) {
39
-			return [];
40
-		}
41
-
42
-		$errors = [];
43
-		$directory = new \DirectoryIterator($appPath . '/l10n/');
44
-
45
-		foreach ($directory as $file) {
46
-			if ($file->getExtension() !== 'json') {
47
-				continue;
48
-			}
49
-
50
-			$content = file_get_contents($file->getPathname());
51
-			json_decode($content, true);
52
-
53
-			if (json_last_error() !== JSON_ERROR_NONE) {
54
-				$errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg();
55
-			}
56
-		}
57
-
58
-		return $errors;
59
-	}
28
+    /**
29
+     * @param string $appId
30
+     * @return array
31
+     */
32
+    public function analyse($appId) {
33
+        $appPath = \OC_App::getAppPath($appId);
34
+        if ($appPath === false) {
35
+            throw new \RuntimeException("No app with given id <$appId> known.");
36
+        }
37
+
38
+        if (!is_dir($appPath . '/l10n/')) {
39
+            return [];
40
+        }
41
+
42
+        $errors = [];
43
+        $directory = new \DirectoryIterator($appPath . '/l10n/');
44
+
45
+        foreach ($directory as $file) {
46
+            if ($file->getExtension() !== 'json') {
47
+                continue;
48
+            }
49
+
50
+            $content = file_get_contents($file->getPathname());
51
+            json_decode($content, true);
52
+
53
+            if (json_last_error() !== JSON_ERROR_NONE) {
54
+                $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg();
55
+            }
56
+        }
57
+
58
+        return $errors;
59
+    }
60 60
 }
Please login to merge, or discard this patch.
apps/files/ajax/download.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $files_list = json_decode($files);
38 38
 // in case we get only a single file
39 39
 if (!is_array($files_list)) {
40
-	$files_list = array($files);
40
+    $files_list = array($files);
41 41
 }
42 42
 
43 43
 /**
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
  * alphanumeric characters
47 47
  */
48 48
 if(isset($_GET['downloadStartSecret'])
49
-	&& !isset($_GET['downloadStartSecret'][32])
50
-	&& preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) {
51
-	setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
49
+    && !isset($_GET['downloadStartSecret'][32])
50
+    && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) {
51
+    setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
52 52
 }
53 53
 
54 54
 $server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' );
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * Http range requests support
58 58
  */
59 59
 if (isset($_SERVER['HTTP_RANGE'])) {
60
-	$server_params['range'] = \OC::$server->getRequest()->getHeader('Range');
60
+    $server_params['range'] = \OC::$server->getRequest()->getHeader('Range');
61 61
 }
62 62
 
63 63
 OC_Files::get($dir, $files_list, $server_params);
Please login to merge, or discard this patch.
apps/files_sharing/lib/Migration/SetPasswordColumn.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -36,62 +36,62 @@
 block discarded – undo
36 36
  */
37 37
 class SetPasswordColumn implements IRepairStep {
38 38
 
39
-	/** @var IDBConnection */
40
-	private $connection;
41
-
42
-	/** @var  IConfig */
43
-	private $config;
44
-
45
-
46
-	public function __construct(IDBConnection $connection, IConfig $config) {
47
-		$this->connection = $connection;
48
-		$this->config = $config;
49
-	}
50
-
51
-	/**
52
-	 * Returns the step's name
53
-	 *
54
-	 * @return string
55
-	 * @since 9.1.0
56
-	 */
57
-	public function getName() {
58
-		return 'Copy the share password into the dedicated column';
59
-	}
60
-
61
-	/**
62
-	 * @param IOutput $output
63
-	 */
64
-	public function run(IOutput $output) {
65
-		if (!$this->shouldRun()) {
66
-			return;
67
-		}
68
-
69
-		$query = $this->connection->getQueryBuilder();
70
-		$query
71
-			->update('share')
72
-			->set('password', 'share_with')
73
-			->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK)))
74
-			->andWhere($query->expr()->isNotNull('share_with'));
75
-		$result = $query->execute();
76
-
77
-		if ($result === 0) {
78
-			// No link updated, no need to run the second query
79
-			return;
80
-		}
81
-
82
-		$clearQuery = $this->connection->getQueryBuilder();
83
-		$clearQuery
84
-			->update('share')
85
-			->set('share_with', $clearQuery->createNamedParameter(null))
86
-			->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK)));
87
-
88
-		$clearQuery->execute();
89
-
90
-	}
91
-
92
-	protected function shouldRun() {
93
-		$appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0');
94
-		return version_compare($appVersion, '1.4.0', '<');
95
-	}
39
+    /** @var IDBConnection */
40
+    private $connection;
41
+
42
+    /** @var  IConfig */
43
+    private $config;
44
+
45
+
46
+    public function __construct(IDBConnection $connection, IConfig $config) {
47
+        $this->connection = $connection;
48
+        $this->config = $config;
49
+    }
50
+
51
+    /**
52
+     * Returns the step's name
53
+     *
54
+     * @return string
55
+     * @since 9.1.0
56
+     */
57
+    public function getName() {
58
+        return 'Copy the share password into the dedicated column';
59
+    }
60
+
61
+    /**
62
+     * @param IOutput $output
63
+     */
64
+    public function run(IOutput $output) {
65
+        if (!$this->shouldRun()) {
66
+            return;
67
+        }
68
+
69
+        $query = $this->connection->getQueryBuilder();
70
+        $query
71
+            ->update('share')
72
+            ->set('password', 'share_with')
73
+            ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK)))
74
+            ->andWhere($query->expr()->isNotNull('share_with'));
75
+        $result = $query->execute();
76
+
77
+        if ($result === 0) {
78
+            // No link updated, no need to run the second query
79
+            return;
80
+        }
81
+
82
+        $clearQuery = $this->connection->getQueryBuilder();
83
+        $clearQuery
84
+            ->update('share')
85
+            ->set('share_with', $clearQuery->createNamedParameter(null))
86
+            ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK)));
87
+
88
+        $clearQuery->execute();
89
+
90
+    }
91
+
92
+    protected function shouldRun() {
93
+        $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0');
94
+        return version_compare($appVersion, '1.4.0', '<');
95
+    }
96 96
 
97 97
 }
Please login to merge, or discard this patch.
apps/oauth2/lib/Db/Client.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,20 +34,20 @@
 block discarded – undo
34 34
  * @method void setName(string $name)
35 35
  */
36 36
 class Client extends Entity {
37
-	/** @var string */
38
-	protected $name;
39
-	/** @var string */
40
-	protected $redirectUri;
41
-	/** @var string */
42
-	protected $clientIdentifier;
43
-	/** @var string */
44
-	protected $secret;
37
+    /** @var string */
38
+    protected $name;
39
+    /** @var string */
40
+    protected $redirectUri;
41
+    /** @var string */
42
+    protected $clientIdentifier;
43
+    /** @var string */
44
+    protected $secret;
45 45
 
46
-	public function __construct() {
47
-		$this->addType('id', 'int');
48
-		$this->addType('name', 'string');
49
-		$this->addType('redirect_uri', 'string');
50
-		$this->addType('client_identifier', 'string');
51
-		$this->addType('secret', 'string');
52
-	}
46
+    public function __construct() {
47
+        $this->addType('id', 'int');
48
+        $this->addType('name', 'string');
49
+        $this->addType('redirect_uri', 'string');
50
+        $this->addType('client_identifier', 'string');
51
+        $this->addType('secret', 'string');
52
+    }
53 53
 }
Please login to merge, or discard this patch.
lib/public/Authentication/LoginCredentials/ICredentials.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -31,31 +31,31 @@
 block discarded – undo
31 31
  */
32 32
 interface ICredentials {
33 33
 
34
-	/**
35
-	 * Get the user UID
36
-	 *
37
-	 * @since 12
38
-	 *
39
-	 * @return string
40
-	 */
41
-	public function getUID();
34
+    /**
35
+     * Get the user UID
36
+     *
37
+     * @since 12
38
+     *
39
+     * @return string
40
+     */
41
+    public function getUID();
42 42
 
43
-	/**
44
-	 * Get the login name the users used to login
45
-	 *
46
-	 * @since 12
47
-	 *
48
-	 * @return string
49
-	 */
50
-	public function getLoginName();
43
+    /**
44
+     * Get the login name the users used to login
45
+     *
46
+     * @since 12
47
+     *
48
+     * @return string
49
+     */
50
+    public function getLoginName();
51 51
 
52
-	/**
53
-	 * Get the password
54
-	 *
55
-	 * @since 12
56
-	 *
57
-	 * @return string
58
-	 * @throws PasswordUnavailableException
59
-	 */
60
-	public function getPassword();
52
+    /**
53
+     * Get the password
54
+     *
55
+     * @since 12
56
+     *
57
+     * @return string
58
+     * @throws PasswordUnavailableException
59
+     */
60
+    public function getPassword();
61 61
 }
Please login to merge, or discard this patch.
lib/private/Files/Cache/Wrapper/CachePermissionsMask.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -24,25 +24,25 @@
 block discarded – undo
24 24
 namespace OC\Files\Cache\Wrapper;
25 25
 
26 26
 class CachePermissionsMask extends CacheWrapper {
27
-	/**
28
-	 * @var int
29
-	 */
30
-	protected $mask;
27
+    /**
28
+     * @var int
29
+     */
30
+    protected $mask;
31 31
 
32
-	/**
33
-	 * @param \OCP\Files\Cache\ICache $cache
34
-	 * @param int $mask
35
-	 */
36
-	public function __construct($cache, $mask) {
37
-		parent::__construct($cache);
38
-		$this->mask = $mask;
39
-	}
32
+    /**
33
+     * @param \OCP\Files\Cache\ICache $cache
34
+     * @param int $mask
35
+     */
36
+    public function __construct($cache, $mask) {
37
+        parent::__construct($cache);
38
+        $this->mask = $mask;
39
+    }
40 40
 
41
-	protected function formatCacheEntry($entry) {
42
-		if (isset($entry['permissions'])) {
43
-			$entry['scan_permissions'] = $entry['permissions'];
44
-			$entry['permissions'] &= $this->mask;
45
-		}
46
-		return $entry;
47
-	}
41
+    protected function formatCacheEntry($entry) {
42
+        if (isset($entry['permissions'])) {
43
+            $entry['scan_permissions'] = $entry['permissions'];
44
+            $entry['permissions'] &= $this->mask;
45
+        }
46
+        return $entry;
47
+    }
48 48
 }
Please login to merge, or discard this patch.
lib/private/GlobalScale/Config.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -27,45 +27,45 @@
 block discarded – undo
27 27
 
28 28
 class Config implements \OCP\GlobalScale\IConfig {
29 29
 
30
-	/** @var IConfig */
31
-	private $config;
30
+    /** @var IConfig */
31
+    private $config;
32 32
 
33
-	/**
34
-	 * Config constructor.
35
-	 *
36
-	 * @param IConfig $config
37
-	 */
38
-	public function __construct(IConfig $config) {
39
-		$this->config = $config;
40
-	}
33
+    /**
34
+     * Config constructor.
35
+     *
36
+     * @param IConfig $config
37
+     */
38
+    public function __construct(IConfig $config) {
39
+        $this->config = $config;
40
+    }
41 41
 
42
-	/**
43
-	 * check if global scale is enabled
44
-	 *
45
-	 * @since 12.0.1
46
-	 * @return bool
47
-	 */
48
-	public function isGlobalScaleEnabled() {
49
-		$enabled = $this->config->getSystemValue('gs.enabled', false);
50
-		return $enabled !== false;
51
-	}
42
+    /**
43
+     * check if global scale is enabled
44
+     *
45
+     * @since 12.0.1
46
+     * @return bool
47
+     */
48
+    public function isGlobalScaleEnabled() {
49
+        $enabled = $this->config->getSystemValue('gs.enabled', false);
50
+        return $enabled !== false;
51
+    }
52 52
 
53
-	/**
54
-	 * check if federation should only be used internally in a global scale setup
55
-	 *
56
-	 * @since 12.0.1
57
-	 * @return bool
58
-	 */
59
-	public function onlyInternalFederation() {
60
-		// if global scale is disabled federation works always globally
61
-		$gsEnabled = $this->isGlobalScaleEnabled();
62
-		if ($gsEnabled === false) {
63
-			return false;
64
-		}
53
+    /**
54
+     * check if federation should only be used internally in a global scale setup
55
+     *
56
+     * @since 12.0.1
57
+     * @return bool
58
+     */
59
+    public function onlyInternalFederation() {
60
+        // if global scale is disabled federation works always globally
61
+        $gsEnabled = $this->isGlobalScaleEnabled();
62
+        if ($gsEnabled === false) {
63
+            return false;
64
+        }
65 65
 
66
-		$enabled = $this->config->getSystemValue('gs.federation', 'internal');
66
+        $enabled = $this->config->getSystemValue('gs.federation', 'internal');
67 67
 
68
-		return $enabled === 'internal';
69
-	}
68
+        return $enabled === 'internal';
69
+    }
70 70
 
71 71
 }
Please login to merge, or discard this patch.
lib/public/GlobalScale/IConfig.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -32,20 +32,20 @@
 block discarded – undo
32 32
  */
33 33
 interface IConfig {
34 34
 
35
-	/**
36
-	 * check if global scale is enabled
37
-	 *
38
-	 * @since 12.0.1
39
-	 * @return bool
40
-	 */
41
-	public function isGlobalScaleEnabled();
35
+    /**
36
+     * check if global scale is enabled
37
+     *
38
+     * @since 12.0.1
39
+     * @return bool
40
+     */
41
+    public function isGlobalScaleEnabled();
42 42
 
43
-	/**
44
-	 * check if federation should only be used internally in a global scale setup
45
-	 *
46
-	 * @since 12.0.1
47
-	 * @return bool
48
-	 */
49
-	public function onlyInternalFederation();
43
+    /**
44
+     * check if federation should only be used internally in a global scale setup
45
+     *
46
+     * @since 12.0.1
47
+     * @return bool
48
+     */
49
+    public function onlyInternalFederation();
50 50
 
51 51
 }
Please login to merge, or discard this patch.
lib/public/Encryption/IEncryptionModule.php 1 patch
Indentation   +156 added lines, -156 removed lines patch added patch discarded remove patch
@@ -35,161 +35,161 @@
 block discarded – undo
35 35
  */
36 36
 interface IEncryptionModule {
37 37
 
38
-	/**
39
-	 * @return string defining the technical unique id
40
-	 * @since 8.1.0
41
-	 */
42
-	public function getId();
43
-
44
-	/**
45
-	 * In comparison to getKey() this function returns a human readable (maybe translated) name
46
-	 *
47
-	 * @return string
48
-	 * @since 8.1.0
49
-	 */
50
-	public function getDisplayName();
51
-
52
-	/**
53
-	 * start receiving chunks from a file. This is the place where you can
54
-	 * perform some initial step before starting encrypting/decrypting the
55
-	 * chunks
56
-	 *
57
-	 * @param string $path to the file
58
-	 * @param string $user who read/write the file (null for public access)
59
-	 * @param string $mode php stream open mode
60
-	 * @param array $header contains the header data read from the file
61
-	 * @param array $accessList who has access to the file contains the key 'users' and 'public'
62
-	 *
63
-	 * $return array $header contain data as key-value pairs which should be
64
-	 *                       written to the header, in case of a write operation
65
-	 *                       or if no additional data is needed return a empty array
66
-	 * @since 8.1.0
67
-	 */
68
-	public function begin($path, $user, $mode, array $header, array $accessList);
69
-
70
-	/**
71
-	 * last chunk received. This is the place where you can perform some final
72
-	 * operation and return some remaining data if something is left in your
73
-	 * buffer.
74
-	 *
75
-	 * @param string $path to the file
76
-	 * @param string $position id of the last block (looks like "<Number>end")
77
-	 *
78
-	 * @return string remained data which should be written to the file in case
79
-	 *                of a write operation
80
-	 *
81
-	 * @since 8.1.0
82
-	 * @since 9.0.0 parameter $position added
83
-	 */
84
-	public function end($path, $position);
85
-
86
-	/**
87
-	 * encrypt data
88
-	 *
89
-	 * @param string $data you want to encrypt
90
-	 * @param string $position position of the block we want to encrypt (starts with '0')
91
-	 *
92
-	 * @return mixed encrypted data
93
-	 *
94
-	 * @since 8.1.0
95
-	 * @since 9.0.0 parameter $position added
96
-	 */
97
-	public function encrypt($data, $position);
98
-
99
-	/**
100
-	 * decrypt data
101
-	 *
102
-	 * @param string $data you want to decrypt
103
-	 * @param string $position position of the block we want to decrypt
104
-	 *
105
-	 * @return mixed decrypted data
106
-	 *
107
-	 * @since 8.1.0
108
-	 * @since 9.0.0 parameter $position added
109
-	 */
110
-	public function decrypt($data, $position);
111
-
112
-	/**
113
-	 * update encrypted file, e.g. give additional users access to the file
114
-	 *
115
-	 * @param string $path path to the file which should be updated
116
-	 * @param string $uid of the user who performs the operation
117
-	 * @param array $accessList who has access to the file contains the key 'users' and 'public'
118
-	 * @return boolean
119
-	 * @since 8.1.0
120
-	 */
121
-	public function update($path, $uid, array $accessList);
122
-
123
-	/**
124
-	 * should the file be encrypted or not
125
-	 *
126
-	 * @param string $path
127
-	 * @return boolean
128
-	 * @since 8.1.0
129
-	 */
130
-	public function shouldEncrypt($path);
131
-
132
-	/**
133
-	 * get size of the unencrypted payload per block.
134
-	 * ownCloud read/write files with a block size of 8192 byte
135
-	 *
136
-	 * @param bool $signed
137
-	 * @return int
138
-	 * @since 8.1.0 optional parameter $signed was added in 9.0.0
139
-	 */
140
-	public function getUnencryptedBlockSize($signed = false);
141
-
142
-	/**
143
-	 * check if the encryption module is able to read the file,
144
-	 * e.g. if all encryption keys exists
145
-	 *
146
-	 * @param string $path
147
-	 * @param string $uid user for whom we want to check if he can read the file
148
-	 * @return boolean
149
-	 * @since 8.1.0
150
-	 */
151
-	public function isReadable($path, $uid);
152
-
153
-	/**
154
-	 * Initial encryption of all files
155
-	 *
156
-	 * @param InputInterface $input
157
-	 * @param OutputInterface $output write some status information to the terminal during encryption
158
-	 * @since 8.2.0
159
-	 */
160
-	public function encryptAll(InputInterface $input, OutputInterface $output);
161
-
162
-	/**
163
-	 * prepare encryption module to decrypt all files
164
-	 *
165
-	 * @param InputInterface $input
166
-	 * @param OutputInterface $output write some status information to the terminal during encryption
167
-	 * @param $user (optional) for which the files should be decrypted, default = all users
168
-	 * @return bool return false on failure or if it isn't supported by the module
169
-	 * @since 8.2.0
170
-	 */
171
-	public function prepareDecryptAll(InputInterface $input, OutputInterface $output, $user = '');
172
-
173
-	/**
174
-	 * Check if the module is ready to be used by that specific user.
175
-	 * In case a module is not ready - because e.g. key pairs have not been generated
176
-	 * upon login this method can return false before any operation starts and might
177
-	 * cause issues during operations.
178
-	 *
179
-	 * @param string $user
180
-	 * @return boolean
181
-	 * @since 9.1.0
182
-	 */
183
-	public function isReadyForUser($user);
184
-
185
-	/**
186
-	 * Does the encryption module needs a detailed list of users with access to the file?
187
-	 * For example if the encryption module uses per-user encryption keys and needs to know
188
-	 * the users with access to the file to encrypt/decrypt it.
189
-	 *
190
-	 * @since 13.0.0
191
-	 * @return bool
192
-	 */
193
-	public function needDetailedAccessList();
38
+    /**
39
+     * @return string defining the technical unique id
40
+     * @since 8.1.0
41
+     */
42
+    public function getId();
43
+
44
+    /**
45
+     * In comparison to getKey() this function returns a human readable (maybe translated) name
46
+     *
47
+     * @return string
48
+     * @since 8.1.0
49
+     */
50
+    public function getDisplayName();
51
+
52
+    /**
53
+     * start receiving chunks from a file. This is the place where you can
54
+     * perform some initial step before starting encrypting/decrypting the
55
+     * chunks
56
+     *
57
+     * @param string $path to the file
58
+     * @param string $user who read/write the file (null for public access)
59
+     * @param string $mode php stream open mode
60
+     * @param array $header contains the header data read from the file
61
+     * @param array $accessList who has access to the file contains the key 'users' and 'public'
62
+     *
63
+     * $return array $header contain data as key-value pairs which should be
64
+     *                       written to the header, in case of a write operation
65
+     *                       or if no additional data is needed return a empty array
66
+     * @since 8.1.0
67
+     */
68
+    public function begin($path, $user, $mode, array $header, array $accessList);
69
+
70
+    /**
71
+     * last chunk received. This is the place where you can perform some final
72
+     * operation and return some remaining data if something is left in your
73
+     * buffer.
74
+     *
75
+     * @param string $path to the file
76
+     * @param string $position id of the last block (looks like "<Number>end")
77
+     *
78
+     * @return string remained data which should be written to the file in case
79
+     *                of a write operation
80
+     *
81
+     * @since 8.1.0
82
+     * @since 9.0.0 parameter $position added
83
+     */
84
+    public function end($path, $position);
85
+
86
+    /**
87
+     * encrypt data
88
+     *
89
+     * @param string $data you want to encrypt
90
+     * @param string $position position of the block we want to encrypt (starts with '0')
91
+     *
92
+     * @return mixed encrypted data
93
+     *
94
+     * @since 8.1.0
95
+     * @since 9.0.0 parameter $position added
96
+     */
97
+    public function encrypt($data, $position);
98
+
99
+    /**
100
+     * decrypt data
101
+     *
102
+     * @param string $data you want to decrypt
103
+     * @param string $position position of the block we want to decrypt
104
+     *
105
+     * @return mixed decrypted data
106
+     *
107
+     * @since 8.1.0
108
+     * @since 9.0.0 parameter $position added
109
+     */
110
+    public function decrypt($data, $position);
111
+
112
+    /**
113
+     * update encrypted file, e.g. give additional users access to the file
114
+     *
115
+     * @param string $path path to the file which should be updated
116
+     * @param string $uid of the user who performs the operation
117
+     * @param array $accessList who has access to the file contains the key 'users' and 'public'
118
+     * @return boolean
119
+     * @since 8.1.0
120
+     */
121
+    public function update($path, $uid, array $accessList);
122
+
123
+    /**
124
+     * should the file be encrypted or not
125
+     *
126
+     * @param string $path
127
+     * @return boolean
128
+     * @since 8.1.0
129
+     */
130
+    public function shouldEncrypt($path);
131
+
132
+    /**
133
+     * get size of the unencrypted payload per block.
134
+     * ownCloud read/write files with a block size of 8192 byte
135
+     *
136
+     * @param bool $signed
137
+     * @return int
138
+     * @since 8.1.0 optional parameter $signed was added in 9.0.0
139
+     */
140
+    public function getUnencryptedBlockSize($signed = false);
141
+
142
+    /**
143
+     * check if the encryption module is able to read the file,
144
+     * e.g. if all encryption keys exists
145
+     *
146
+     * @param string $path
147
+     * @param string $uid user for whom we want to check if he can read the file
148
+     * @return boolean
149
+     * @since 8.1.0
150
+     */
151
+    public function isReadable($path, $uid);
152
+
153
+    /**
154
+     * Initial encryption of all files
155
+     *
156
+     * @param InputInterface $input
157
+     * @param OutputInterface $output write some status information to the terminal during encryption
158
+     * @since 8.2.0
159
+     */
160
+    public function encryptAll(InputInterface $input, OutputInterface $output);
161
+
162
+    /**
163
+     * prepare encryption module to decrypt all files
164
+     *
165
+     * @param InputInterface $input
166
+     * @param OutputInterface $output write some status information to the terminal during encryption
167
+     * @param $user (optional) for which the files should be decrypted, default = all users
168
+     * @return bool return false on failure or if it isn't supported by the module
169
+     * @since 8.2.0
170
+     */
171
+    public function prepareDecryptAll(InputInterface $input, OutputInterface $output, $user = '');
172
+
173
+    /**
174
+     * Check if the module is ready to be used by that specific user.
175
+     * In case a module is not ready - because e.g. key pairs have not been generated
176
+     * upon login this method can return false before any operation starts and might
177
+     * cause issues during operations.
178
+     *
179
+     * @param string $user
180
+     * @return boolean
181
+     * @since 9.1.0
182
+     */
183
+    public function isReadyForUser($user);
184
+
185
+    /**
186
+     * Does the encryption module needs a detailed list of users with access to the file?
187
+     * For example if the encryption module uses per-user encryption keys and needs to know
188
+     * the users with access to the file to encrypt/decrypt it.
189
+     *
190
+     * @since 13.0.0
191
+     * @return bool
192
+     */
193
+    public function needDetailedAccessList();
194 194
 
195 195
 }
Please login to merge, or discard this patch.