summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/index.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-10 17:42:59 +0100
committerJannik Schönartz2019-03-10 17:42:59 +0100
commit111555c32100b589caef08fb5a6a441a45f15dbf (patch)
tree8ac43b99b91a7408a929bf751b237d37e25b3d6e /server/lib/external-backends/index.js
parent[documentation] Add documentation site (diff)
downloadbas-111555c32100b589caef08fb5a6a441a45f15dbf.tar.gz
bas-111555c32100b589caef08fb5a6a441a45f15dbf.tar.xz
bas-111555c32100b589caef08fb5a6a441a45f15dbf.zip
[external-backends] Passwords are not send to the frontend anymore
Change error responses to the new response scheme Add set password button in the frontend to deal with the no password policy
Diffstat (limited to 'server/lib/external-backends/index.js')
-rw-r--r--server/lib/external-backends/index.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/server/lib/external-backends/index.js b/server/lib/external-backends/index.js
index a0ba25b..92e0f07 100644
--- a/server/lib/external-backends/index.js
+++ b/server/lib/external-backends/index.js
@@ -22,8 +22,7 @@ class ExternalBackends {
* { type: 'select', id: 4, name: '<NAME>', icon: '<ICON_NAME>' }, ...]
*/
getCredentials () {
- console.log('If this method gets called the backend class has NOT IMPLEMENTED the getCredentials method!')
- return null
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a getCredentials method' }
}
/*
@@ -62,7 +61,7 @@ class ExternalBackends {
* return:
*/
async getClient (credentials, client) {
- return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a getClient method' }
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a getClient method' }
}
/*
@@ -71,7 +70,7 @@ class ExternalBackends {
* Returns a list of all objects in the backend.
*/
async getObjects (credendtials) {
- return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a getObjects method' }
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a getObjects method' }
}
/*
@@ -81,7 +80,7 @@ class ExternalBackends {
* Call the API of the backend and returns the information to the object including a list of childs.
*/
async getObject (credentials, oid) {
- return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a getObject method' }
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a getObject method' }
}
/*
@@ -91,7 +90,7 @@ class ExternalBackends {
* Deletes the objecs from the backend.
*/
async deleteObjects (credentials, objectIds) {
- return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a deleteObject method' }
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a deleteObject method' }
}
/*
@@ -102,7 +101,7 @@ class ExternalBackends {
* return: [{ gid: <GROUP_ID>, childs: [{ id: <EXTERNAL_ID>, }, ...]}, ...]
*/
async getDataTree (credendtials, objects) {
- return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a getDataTree method' }
+ return { error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a getDataTree method' }
}
/*
@@ -111,7 +110,7 @@ class ExternalBackends {
* return: { success: <boolean>, status: '<STATUS_CODE_IF_ERROR>', error: '<ERROR_MESSAGE>' }
*/
async checkConnection (backend) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a checkConnection method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have a checkConnection method' }
}
/* Returns an empty array [] if the backends doesn't have such a function.
@@ -133,7 +132,7 @@ class ExternalBackends {
* }
*/
async addClient (credentials, client) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an addClient method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have an addClient method' }
}
/*
@@ -151,18 +150,18 @@ class ExternalBackends {
* }
*/
async updateClient (credentials, client) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an updateClient method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have an updateClient method' }
}
async uploadFiles (credentials, externalId, files) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an uploadFiles method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have an uploadFiles method' }
}
async getFileList (credentials, externalId) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an getFileList method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have an getFileList method' }
}
async getFile (credentials, externalId, filename) {
- return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an getFile method' }
+ return { success: false, error: 'NOT_IMPLEMENTED_EXCEPTION', message: 'The provided backend does not have an getFile method' }
}
}