firezone / wireguardex

Configure WireGuard® interfaces in Elixir using Rust NIFs.
https://hex.pm/packages/wireguardex
Apache License 2.0
71 stars 9 forks source link

`public_key` name collision in DeviceConfigBuilder and PeerConfigBuilder #25

Closed jamilbk closed 2 years ago

jamilbk commented 2 years ago
== Compilation error in file lib/meshed/peer.ex ==
** (CompileError) lib/meshed/peer.ex:85: function public_key/2 imported from both Wireguardex.PeerConfigBuilder and Wireguardex.DeviceConfigBuilder, call is ambiguous
    (elixir 1.13.4) expanding macro: Kernel.|>/2
    lib/meshed/peer.ex:87: Meshed.Peer.peer_to_config/1

Is public_key needed in DeviceConfigBuilder? Is there a situation where someone would want to set the public key on the interface?

akrousset commented 2 years ago

I was exposing the same configuration fields present for wireguard-control's builder DeviceUpdate in Rust. It more than likely isn't needed, because the public key will be generated for us when only setting private_key.

jamilbk commented 2 years ago

Ah I see. In that case we can leave it in 👍🏼