summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/backends/idoit-backend.js
blob: 2520b076e2e71de0c5440d3cda1e37503a0e9c56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var ExternalBackends = require('../external-backends.js')

class IdoitBackend extends ExternalBackends {
  getCredentials () {
    // I do it only needs the API-key.
    return [
      { type: 'text', id: 1, name: 'API url', icon: 'link' },
      { type: 'password', id: 2, name: 'API token', icon: 'vpn_key', show: false },
      { type: 'switch',
        id: 3,
        name: 'Login',
        icon: 'lock_open',
        elements: [
          { type: 'text', id: 4, name: 'username', icon: 'person_outline' },
          { type: 'password', id: 5, name: 'password', icon: 'lock', show: false }
        ]
      }
    ]
  }

  async checkConnection () {
    // Make a simple login and check if the connection works.
    return { success: false, msg: 'TODO: IMPLEMENT' }
  }
}

module.exports = IdoitBackend