import { Router } from 'express';
import { NodeController } from '../controllers/NodeController';
import { requireTraceContext } from '../../core/guards/trace-context.guard';

const router = Router();

router.get('/', NodeController.getAll);

/**
 * [CORE_SEC_03/04] 节点安全下发通道与零信任身份
 */
router.post('/register', NodeController.register); // 公开注册接口 (PENDING 状态)
router.post('/session', requireTraceContext, NodeController.requestSession);
router.get('/credential', requireTraceContext, NodeController.getCredential);

/**
 * [FE_SEC_01] ZKP 隐私声誉证明 API
 */
router.get('/zkp/proof', requireTraceContext, NodeController.getZkpProof);
router.post('/zkp/verify', requireTraceContext, NodeController.verifyZkpProof);

export default router;
