You've already forked go-ztcentral
mirror of
https://github.com/zerotier/go-ztcentral.git
synced 2026-05-22 16:25:13 -07:00
a17aaa2ceb
This patch is a large patch and should be committed only for v0.3 or up. It changes the API in breaking ways. This leverages https://github.com/deepmap/oapi-codegen to generate a client which we can use to talk to central; the idea here is that this is a future-proofing exercise, as well as a means to have more meaningful conversations with central later. The makefile was tuned to download the spec, and `//go:generate` lines were added to generate it automatically as a part of our release process. Downloading the spec is still a manual step; assuming we will want to stage this with releases of central later. The client was ported to use the inner `pkg/spec` client which does better validation and puts additional burden on the programmer to make sure they are submitting the correct content. Finally, there are a few issues this change exposed: - https://github.com/zerotier/terraform-provider-zerotier/issues/1 is proven as of this client build; I had built a test for this but it was busted, and now we actually need to address this in central. - Lots of optional paramaters (that aren't). This will cause issues for users, and we should make an effort to add `nullable: false` or `required: true` in more spots where necessary. This was most notable in structs containing the network and node ID. - Finally, the notion of a `member ID` has been reverted to use the idioms in the spec, which rewrite it to be called a `node ID`. I have been told that this is antiquated language and we should expect a change. I just wanted to make a note of it for future users. Signed-off-by: Erik Hollensbe <linux@hollensbe.org>