update deps (#9)

* ci: basic build github action

* chore: update zerotier-one api spec

* chore: update zerotier-central api spec
This commit is contained in:
Travis LaDuke
2024-11-06 19:12:27 -05:00
committed by GitHub
parent 8407b45052
commit 26205d8ea6
11 changed files with 2661 additions and 2261 deletions
+11
View File
@@ -0,0 +1,11 @@
name: test suite
on: [push, pull_request]
jobs:
test:
name: make
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: make
+2 -2
View File
@@ -1,9 +1,9 @@
central:
bash generate.sh central zerotier-central-api
curl -sSL https://docs.zerotier.com/openapi/centralv1.json > zerotier-central-api/openapi.json
cd zerotier-central-api && cargo build && cargo clean
service:
bash generate.sh service zerotier-one-api
curl -sSL https://github.com/zerotier/zerotier-one-api-spec/releases/latest/download/openapi.yaml > zerotier-one-api/openapi.yaml
cd zerotier-one-api && cargo build && cargo clean
.PHONY: central service
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
set -eo pipefail
if [ "x$1" = "x" -o "x$2" = "x" ]
then
echo "Please read this script before executing it"
exit 1
fi
PACKAGE=$1
PREFIX=$2
HOST=${HOST:-docs.zerotier.com}
curl -sSL http://${HOST}/openapi/${PACKAGE}v1.json > ${PREFIX}/openapi.json
+625 -585
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -6,17 +6,19 @@ description = "ZeroTier Central API for Rust"
authors = ["Erik Hollensbe <erik.hollensbe@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]
license = "BSD-3-Clause"
[dependencies]
progenitor-client = "0.5.0"
reqwest = { version = "0.11", features = ["json", "stream"] }
progenitor-client = "0.8.0"
reqwest = { version = "0.12", features = ["json", "stream"] }
serde = { version = "1.0", features = [ "derive" ] }
chrono = { version = "0.4", features = [ "serde" ] }
uuid = { version = "1.7", features = [ "serde", "v4" ] }
futures = "0.3"
serde_json = "1.0"
regress = "0.4.1"
[build-dependencies]
prettyplease = "0.1.25"
progenitor = "0.5.0"
prettyplease = "0.2"
progenitor = "0.8.0"
serde_json = "1.0"
syn = "1.0"
syn = "2.0"
+8 -1
View File
@@ -1,7 +1,7 @@
{
"openapi": "3.0.0",
"info": {
"description": "ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: token xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: token xxxxx\" https://api.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/openapi/centralv1.json</code></p>",
"description": "ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: token xxxxx</code> format. You can generate your API key by logging into <a href=\"https://my.zerotier.com\">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H \"Authorization: token xxxxx\" https://api.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/api/central/ref-v1.json</code></p>",
"version": "v1",
"title": "ZeroTier Central API",
"contact": {
@@ -1379,6 +1379,13 @@
"example": 123,
"nullable": true
},
"ssoExempt": {
"type": "boolean",
"readOnly": false,
"description": "Allow the member to be authorized without OIDC/SSO",
"example": false,
"nullable": true
},
"tags": {
"type": "array",
"items": {
+630 -610
View File
File diff suppressed because it is too large Load Diff
+8 -6
View File
@@ -7,16 +7,18 @@ authors = ["Erik Hollensbe <erik.hollensbe@zerotier.com>", "Adam Ierymenko <adam
license = "BSD-3-Clause"
[dependencies]
progenitor-client = "0.5.0"
reqwest = { version = "0.11", features = ["json", "stream"] }
progenitor-client = "0.8.0"
reqwest = { version = "0.12", features = ["json", "stream"] }
serde = { version = "1.0", features = [ "derive" ] }
chrono = { version = "0.4", features = [ "serde" ] }
uuid = { version = "1.7", features = [ "serde", "v4" ] }
futures = "0.3"
serde_json = "1.0"
serde_yaml = "0.9"
regress = "0.4.1"
[build-dependencies]
prettyplease = "0.1.25"
progenitor = "0.5.0"
serde_json = "1.0"
syn = "1.0"
prettyplease = "0.2"
progenitor = "0.8.0"
serde_yaml = "0.9"
syn = "2.0"
+3 -2
View File
@@ -1,8 +1,9 @@
fn main() {
let src = "openapi.json";
let src = "openapi.yaml";
println!("cargo:rerun-if-changed={}", src);
let file = std::fs::File::open(src).unwrap();
let spec = serde_json::from_reader(file).unwrap();
println!("file:{:?}", file);
let spec = serde_yaml::from_reader(file).unwrap();
let mut generator = progenitor::Generator::default();
let tokens = generator.generate_tokens(&spec).unwrap();
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff