Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.mdns.eu/nextcloud/passwords-client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius David Wieschollek <passwords.public@mdns.eu>2020-12-23 13:43:20 +0300
committerMarius David Wieschollek <passwords.public@mdns.eu>2020-12-23 13:43:20 +0300
commit6d6ed84908c2f95ce981d813bab405d43b4f1e5a (patch)
treeceab2320466e01042fec3eee4abf745f42189a12
parent72e4bd842e755ef565351aa1f5d5a8475c931ec5 (diff)
Use exceptions in noencryption
Signed-off-by: Marius David Wieschollek <passwords.public@mdns.eu>
-rw-r--r--src/Encryption/CSEv1Encryption.js1
-rw-r--r--src/Encryption/NoEncryption.js13
2 files changed, 9 insertions, 5 deletions
diff --git a/src/Encryption/CSEv1Encryption.js b/src/Encryption/CSEv1Encryption.js
index efe772b..06e5891 100644
--- a/src/Encryption/CSEv1Encryption.js
+++ b/src/Encryption/CSEv1Encryption.js
@@ -29,7 +29,6 @@ export default class CSEv1Encryption {
}
/**
- *
* @returns {Boolean}
*/
enabled() {
diff --git a/src/Encryption/NoEncryption.js b/src/Encryption/NoEncryption.js
index 42077d1..37d7780 100644
--- a/src/Encryption/NoEncryption.js
+++ b/src/Encryption/NoEncryption.js
@@ -1,7 +1,13 @@
export default class NoEncryption {
/**
- *
+ * @param {BasicClassLoader} classLoader
+ */
+ constructor(classLoader) {
+ this._classLoader = classLoader;
+ }
+
+ /**
* @returns {Promise<Boolean>}
*/
async ready() {
@@ -9,10 +15,9 @@ export default class NoEncryption {
}
/**
- *
* @returns {Boolean}
*/
- async enabled() {
+ enabled() {
return true;
}
@@ -37,7 +42,7 @@ export default class NoEncryption {
* @returns {Object}
*/
async decrypt(object, type) {
- if(object.cseType !== 'none') throw new Error('Unsupported encryption type');
+ if(object.cseType !== 'none') throw this._classLoader.getClass('exception.encryption.unsupported', object, 'none');
return object;
}
} \ No newline at end of file