const password_routes = {
    prefix: '/api/v1/password',

    middleware: [
        'auth:APIRoute',
    ],

    get: {
        '/resets': [
            ['middleware::api:Permission', { check: 'v1:password:resets:get' }],
            'controller::api:v1:Password.get_resets',
        ],
        '/app_passwords': [
            ['middleware::api:Permission', { check: 'v1:password:app_passwords:get' }],
            'controller::api:v1:Password.get_app_passwords',
        ],
    },

    post: {
        '/app_passwords': [
            ['middleware::api:Permission', { check: 'v1:password:app_passwords:create' }],
            'controller::api:v1:Password.create_app_password',
        ],
        '/resets': [
            ['middleware::auth:RequireTrust', { scope: 'password.reset' }],
            'controller::api:v1:Password.reset_password',
        ],
    },

    delete: {
        '/app_passwords/:uuid': [
            ['middleware::api:Permission', { check: 'v1:password:app_passwords:delete' }],
            'controller::api:v1:Password.delete_app_password',
        ],
    }
}

module.exports = exports = password_routes
