Adding the allowlist example we chatted about! It is basically timeserve with an allowlist controlling what peer can actually make a connection and be served the time. I use a simple string (-allow <endpointid>) as an allowlist of size one since that is easier for trying things out, but the same logic can trivially be expanded to a list greater than 1.
It's both simple (just checking one string, EndpointId.String(), against a set of allowlisted strings, -allow <string> in the current example) while also having a little bit of intricacy around when we can detect the remote endpoint id (is it being relayed? is it a direct connection?) as well as what type of errors are sent when. Having worked through this example I've at least convinced myself that the existing iroh functionality is good enough for implementing an allowlist in me own iroh-go-using app!
Lemme know if you have any Q's or thoughts 🙇
p.s. also contains a bonus of demonstrating how to setup static identities (-secret <str> + setting opts.SecretKey) and how to work with iroh's tickets (needed tickets to try out non-relayed direct connections with PresetN0DisableRelay, as they encode a peer's IP)
Adding the allowlist example we chatted about! It is basically `timeserve` with an allowlist controlling what peer can actually make a connection and be served the time. I use a simple string (`-allow <endpointid>`) as an allowlist of size one since that is easier for trying things out, but the same logic can trivially be expanded to a list greater than 1.
It's both simple (just checking one string, `EndpointId.String()`, against a set of allowlisted strings, `-allow <string>` in the current example) while also having a little bit of intricacy around when we can detect the remote endpoint id (is it being relayed? is it a direct connection?) as well as what type of errors are sent when. Having worked through this example I've at least convinced myself that the existing iroh functionality is good enough for implementing an allowlist in me own `iroh-go`-using app!
Lemme know if you have any Q's or thoughts 🙇
p.s. also contains a bonus of demonstrating how to setup static identities (`-secret <str>` + setting `opts.SecretKey`) and how to work with iroh's tickets (needed tickets to try out non-relayed direct connections with `PresetN0DisableRelay`, as they encode a peer's IP)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adding the allowlist example we chatted about! It is basically
timeservewith an allowlist controlling what peer can actually make a connection and be served the time. I use a simple string (-allow <endpointid>) as an allowlist of size one since that is easier for trying things out, but the same logic can trivially be expanded to a list greater than 1.It's both simple (just checking one string,
EndpointId.String(), against a set of allowlisted strings,-allow <string>in the current example) while also having a little bit of intricacy around when we can detect the remote endpoint id (is it being relayed? is it a direct connection?) as well as what type of errors are sent when. Having worked through this example I've at least convinced myself that the existing iroh functionality is good enough for implementing an allowlist in me owniroh-go-using app!Lemme know if you have any Q's or thoughts 🙇
p.s. also contains a bonus of demonstrating how to setup static identities (
-secret <str>+ settingopts.SecretKey) and how to work with iroh's tickets (needed tickets to try out non-relayed direct connections withPresetN0DisableRelay, as they encode a peer's IP)9a620897d3to0d4253b271SO cool 🌟