Skip to content

0.11 A3: network approvals keyed on host + protocol + port, with "Don't allow this host" #6484

Description

@Hmbown

Today: network grants are keyed as net:{host} only (approval_cache.rs:~81-125, parse_host :~390). Scheme and port are dropped, so an approval for one port or protocol covers every other one on that host. NetworkSessionCache is a third, separate store, and its approve and deny methods have no production callers.

Change

  1. Parse the full target. parse_net_target returns a NetKey:

    • host: lowercase, normalized to IDNA
    • protocol: http, https, ws or wss
    • port: the explicit port, or the scheme default

    The grouping key becomes net:{proto}://{host}:{port}. An unparseable URL gets its own digest.

  2. One store. Conversation-scope grants and denies go into A1's GrantStore. Delete NetworkSessionCache and its unused methods. NetworkPolicyDecider::evaluate checks GrantStore first; a deny still wins.

  3. Repo scope and "Don't allow this host". Persist these as existing-schema rules: ToolAskRule{tool:"network", command:"https://host:443", workspace, action}. Older binaries parse them and treat them as inert. Relax the Deny bail in persist_rules_from_approval for tool=="network" only.

  4. Card choices. Use the four §19 choices. "Don't allow" offers two versions: this time, or always for this host in this repo.

Tests

  • net_grant_keyed_by_protocol_and_port
  • network_repo_deny_beats_conversation_allow
  • network_rule_toml_parses_with_old_schema
  • a compile-time guard that NetworkSessionCache is removed
  • oauth tests moved onto GrantStore

Size: M. Blocked by: A1. Spec: codewhale-ops approvals/specs/A-grants-authority-0.11.md (A3).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions