Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a manual peer request review system for DN42 network peering. When a node has the VERIFY flag enabled, new peer requests are queued for manual approval by privileged users instead of being automatically created.
Changes:
- Adds VERIFY configuration flag to agent nodes to enable manual review mode
- Implements a peer request queue system with approval/denial workflow for privileged users
- Adds
/peer_requestcommand for privileged users to manage pending requests - Includes a bug fix for parsing bird protocol output when lines lack colons
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| server/commands/peer/peer_requests.py | New module implementing the peer request queue, approval/denial logic, and command handler |
| server/commands/peer/info_collect.py | Modified to check verification flag and queue requests instead of auto-creating peers when required |
| agent/commands/peer.py | Adds VERIFY flag to pre_peer response and fixes bird output parsing bug |
| agent/base.py | Loads VERIFY configuration from agent config |
| agent/agent_config.example.json | Adds VERIFY field to example configuration |
| server/main.py | Registers peer_request command in command list |
| server/commands/help.py | Adds help text for peer_request command |
| server/commands/init.py | Imports new peer_requests module |
| README.md | Updates TODO to mark peer approval feature as completed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| PORT = raw_config["PORT"] | ||
| SECRET = raw_config["SECRET"] | ||
| OPEN = raw_config["OPEN"] | ||
| VERIFY = raw_config["VERIFY"] |
There was a problem hiding this comment.
The VERIFY configuration field should use the .get() method with a default value for backwards compatibility with existing agent configurations that don't have this field. This prevents a KeyError when loading older config files. For example: VERIFY = raw_config.get("VERIFY", False)
| VERIFY = raw_config["VERIFY"] | |
| VERIFY = raw_config.get("VERIFY", False) |
| import requests | ||
| import tools | ||
| from base import bot, db, db_privilege | ||
| import base |
There was a problem hiding this comment.
Module 'base' is imported with both 'import' and 'import from'.
| from datetime import datetime, timezone | ||
| from uuid import uuid4 | ||
|
|
||
| import base |
There was a problem hiding this comment.
Module 'base' is imported with both 'import' and 'import from'.
| _pending_requests = pickle.load(f) | ||
| if not isinstance(_pending_requests, dict): | ||
| _pending_requests = {} | ||
| except BaseException: |
There was a problem hiding this comment.
Except block directly handles BaseException.
| except BaseException: | |
| except Exception: |
| headers={"X-DN42-Bot-Api-Secret-Token": config.API_TOKEN}, | ||
| timeout=10, | ||
| ) | ||
| except BaseException: |
There was a problem hiding this comment.
Except block directly handles BaseException.
| except BaseException: | |
| except requests.RequestException: |
No description provided.