const iam_routes = {
    prefix: '/api/v1/vault',

    middleware: [
        'auth:APIRoute'
    ],

    get: {
        '/vaults': [
            ['middleware::api:Permission', { check: 'v1:vault:vaults:list' }],
            'controller::api:v1:Vault.get_vaults',
        ],
        '/vaults/:id': [
            ['middleware::api:Permission', { check: 'v1:vault:vaults:get' }],
            'controller::api:v1:Vault.get_vault',
        ],
    },

    post: {
        '/vaults': [
            ['middleware::api:Permission', { check: 'v1:vault:vaults:create' }],
            'controller::api:v1:Vault.create_vault',
        ],
    },

    patch: {
        '/vaults/:id': [
            ['middleware::api:Permission', { check: 'v1:vault:vaults:update' }],
            'controller::api:v1:Vault.update_vault',
        ],
    },

    delete: {
        '/vaults/:id': [
            ['middleware::api:Permission', { check: 'v1:vault:vaults:delete' }],
            'controller::api:v1:Vault.delete_vault',
        ],
    },
}

module.exports = exports = iam_routes
