2020-05-12 01:26:09 +00:00
|
|
|
const ldap_routes = {
|
|
|
|
prefix: '/api/v1/ldap',
|
|
|
|
|
|
|
|
middleware: [
|
2020-05-17 04:55:08 +00:00
|
|
|
'auth:APIRoute',
|
2020-05-12 01:26:09 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
get: {
|
|
|
|
'/clients': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:clients:list' }],
|
|
|
|
'controller::api:v1:LDAP.get_clients',
|
|
|
|
],
|
|
|
|
'/clients/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:clients:get' }],
|
|
|
|
'controller::api:v1:LDAP.get_client',
|
|
|
|
],
|
|
|
|
'/groups': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:groups:list' }],
|
|
|
|
'controller::api:v1:LDAP.get_groups',
|
|
|
|
],
|
|
|
|
'/groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:groups:get' }],
|
|
|
|
'controller::api:v1:LDAP.get_group',
|
|
|
|
],
|
2021-03-15 21:10:23 +00:00
|
|
|
'/machines': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machines:list' }],
|
|
|
|
'controller::api:v1:LDAP.get_machines',
|
|
|
|
],
|
|
|
|
'/machines/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machines:get' }],
|
|
|
|
'controller::api:v1:LDAP.get_machine',
|
|
|
|
],
|
|
|
|
'/machine-groups': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machine_groups:list' }],
|
|
|
|
'controller::api:v1:LDAP.get_machine_groups',
|
|
|
|
],
|
|
|
|
'/machine-groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machine_groups:get' }],
|
|
|
|
'controller::api:v1:LDAP.get_machine_group',
|
|
|
|
],
|
2020-05-22 03:56:48 +00:00
|
|
|
'/config': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:config:get' }],
|
|
|
|
'controller::api:v1:LDAP.get_config',
|
|
|
|
],
|
2020-05-12 01:26:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
'/clients': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:clients:create' }],
|
|
|
|
'controller::api:v1:LDAP.create_client',
|
|
|
|
],
|
|
|
|
'/groups': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:groups:create' }],
|
|
|
|
'controller::api:v1:LDAP.create_group',
|
|
|
|
],
|
2021-03-15 21:10:23 +00:00
|
|
|
'/machines': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machines:create' }],
|
|
|
|
'controller::api:v1:LDAP.create_machine',
|
|
|
|
],
|
|
|
|
'/machine-groups': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machine_groups:create' }],
|
|
|
|
'controller::api:v1:LDAP.create_machine_group',
|
|
|
|
],
|
2020-05-12 01:26:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
patch: {
|
|
|
|
'/clients/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:clients:update' }],
|
|
|
|
'controller::api:v1:LDAP.update_client',
|
|
|
|
],
|
|
|
|
'/groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:groups:update' }],
|
|
|
|
'controller::api:v1:LDAP.update_group',
|
|
|
|
],
|
2021-03-15 21:10:23 +00:00
|
|
|
'/machines/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machines:update' }],
|
|
|
|
'controller::api:v1:LDAP.update_machine',
|
|
|
|
],
|
|
|
|
'/machine-groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machine_groups:update' }],
|
|
|
|
'controller::api:v1:LDAP.update_machine_group',
|
|
|
|
],
|
2020-05-12 01:26:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
delete: {
|
|
|
|
'/clients/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:clients:delete' }],
|
|
|
|
'controller::api:v1:LDAP.delete_client',
|
|
|
|
],
|
|
|
|
'/groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:groups:delete' }],
|
|
|
|
'controller::api:v1:LDAP.delete_group',
|
|
|
|
],
|
2021-03-15 21:10:23 +00:00
|
|
|
'/machines/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machines:delete' }],
|
|
|
|
'controller::api:v1:LDAP.delete_machine',
|
|
|
|
],
|
|
|
|
'/machine-groups/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:ldap:machine_groups:delete' }],
|
|
|
|
'controller::api:v1:LDAP.delete_machine_group',
|
|
|
|
],
|
2020-05-12 01:26:09 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = ldap_routes
|