Fix: use domain_name (FQDN) in cell invite and conflict checks
Unit Tests / test (push) Successful in 7m39s
Unit Tests / test (push) Successful in 7m39s
The GET /api/cells/invite endpoint was returning domain='pic.ngo' instead of the full FQDN 'test5.pic.ngo' because it read _identity.domain rather than _identity.domain_name. Apply the same domain_name preference (domain_name || domain) to: - routes/cells.py get_cell_invite() — the invite shown to connecting cells - routes/cells.py update_cell_permissions() — Corefile DNS regeneration - cell_link_manager.py _check_invite_conflicts() — incoming domain collision check - cell_link_manager.py exchange_invites() — own invite construction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -426,7 +426,7 @@ class CellLinkManager:
|
||||
try:
|
||||
from app import config_manager
|
||||
identity = config_manager.configs.get('_identity', {})
|
||||
own_domain = identity.get('domain', os.environ.get('CELL_DOMAIN', ''))
|
||||
own_domain = identity.get('domain_name') or identity.get('domain', os.environ.get('CELL_DOMAIN', ''))
|
||||
if own_domain and remote_domain == own_domain:
|
||||
raise ValueError(
|
||||
f"Domain {remote_domain!r} is the same as this cell's own domain — "
|
||||
@@ -466,7 +466,7 @@ class CellLinkManager:
|
||||
identity = self._local_identity()
|
||||
from app import config_manager
|
||||
id_cfg = config_manager.configs.get('_identity', {})
|
||||
own_domain = id_cfg.get('domain', os.environ.get('CELL_DOMAIN', 'cell'))
|
||||
own_domain = id_cfg.get('domain_name') or id_cfg.get('domain', os.environ.get('CELL_DOMAIN', 'cell'))
|
||||
own_invite = self.generate_invite(identity['cell_name'], own_domain)
|
||||
except Exception as e:
|
||||
return {'ok': False, 'error': f'could not build own invite: {e}'}
|
||||
|
||||
Reference in New Issue
Block a user