Update api generation workflow (#190)

This commit is contained in:
pascal-fischer
2024-05-15 21:47:49 +02:00
committed by GitHub
parent 94780de0f2
commit 503696de09
14 changed files with 143 additions and 96 deletions

View File

@@ -19,42 +19,48 @@ jobs:
input_string: ${{ github.event.inputs.tag }} input_string: ${{ github.event.inputs.tag }}
version_extractor_regex: '\/v(.*)$' version_extractor_regex: '\/v(.*)$'
# - uses: actions/checkout@v2 - uses: actions/checkout@v2
# with: with:
# token: ${{ secrets.DEV_GITHUB_TOKEN }} token: ${{ secrets.DEV_GITHUB_TOKEN }}
#
# - name: Install swagger-codegen - name: Create directory
# run: brew install swagger-codegen run: mkdir -p generator/openapi
#
# - name: Set up JDK 11 - name: Download openapi.yml
# uses: actions/setup-java@v2 run: curl -L -o generator/openapi/openapi.yml "https://raw.githubusercontent.com/netbirdio/netbird/v${{ steps.semver_parser.outputs.fullversion }}/management/server/http/api/openapi.yml"
# with:
# java-version: '11' - name: Install Go
# distribution: 'adopt' uses: actions/setup-go@v3
# with:
# - name: Npm install go-version: '1.21.1'
# run: npm install
# - name: Build Go project
# - name: Generate api pages for netbird main openapi definition run: (cd ./generator && go build -o expandOpenAPIRef)
# run: |
# swagger-codegen generate -i https://raw.githubusercontent.com/netbirdio/netbird/v${{ steps.semver_parser.outputs.fullversion }}/management/server/http/api/openapi.yml -l openapi -o generator/openapi - name: Expand openapi.yml
# npx ts-node generator/index.ts gen --input generator/openapi/openapi.json --output src/pages/ipa/resources run: (cd ./generator && ./expandOpenAPIRef)
#
# - name: Check git diff and send to output - name: Npm install
# id: git_diff run: npm install
# run: |
# if git --no-pager diff --exit-code; then - name: Generate api pages for netbird main openapi definition
# echo "changed=false" >> "$GITHUB_OUTPUT" run: npx ts-node generator/index.ts gen --input generator/openapi/expanded.yml --output src/pages/ipa/resources
# else
# echo "changed=true" >> "$GITHUB_OUTPUT" - name: Check git diff and send to output
# fi id: git_diff
# run: |
# - name: Commit and push changes if git --no-pager diff --exit-code; then
# if: steps.git_diff.outputs.changed == 'true' echo "changed=false" >> "$GITHUB_OUTPUT"
# run: | else
# git config --global user.email "dev@netbird.io" echo "changed=true" >> "$GITHUB_OUTPUT"
# git config --global user.name "netbirddev" fi
#
# git add -A - name: Commit and push changes
# git commit -m "Update API pages with v${{ steps.semver_parser.outputs.fullversion }}" if: steps.git_diff.outputs.changed == 'true'
# git push run: |
git config --global user.email "dev@netbird.io"
git config --global user.name "netbirddev"
git add -A
git commit -m "Update API pages with v${{ steps.semver_parser.outputs.fullversion }}"
git push

1
.gitignore vendored
View File

@@ -26,3 +26,4 @@ package-lock.json
/yarn.lock /yarn.lock
/generator/openapi/ /generator/openapi/
/generator/openapi.yml /generator/openapi.yml
/generator/expandOpenAPIRef

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/accounts" url = "https://api.netbird.io/api/accounts"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -166,6 +166,7 @@ echo $response;
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -186,6 +187,7 @@ echo $response;
"settings": { "settings": {
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer", "peer_login_expiration": "integer",
"regular_users_view_blocked": "boolean",
"groups_propagation_enabled": "boolean", "groups_propagation_enabled": "boolean",
"jwt_groups_enabled": "boolean", "jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string", "jwt_groups_claim_name": "string",
@@ -212,7 +214,7 @@ echo $response;
<Row> <Row>
<Col> <Col>
Deletes an account and all its resources. Only administrators and account owners can delete accounts. Deletes an account and all its resources. Only account owners can delete accounts.
#### Path Parameters #### Path Parameters
<Properties> <Properties>
@@ -257,7 +259,7 @@ import json
url = "https://api.netbird.io/api/accounts/{accountId}" url = "https://api.netbird.io/api/accounts/{accountId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -403,6 +405,11 @@ echo $response;
Period of time after which peer login expires (seconds). Period of time after which peer login expires (seconds).
</Property>
<Property name="regular_users_view_blocked" type="boolean" required={true}>
Allows blocking regular users from viewing parts of the system.
</Property> </Property>
<Property name="groups_propagation_enabled" type="boolean" required={false}> <Property name="groups_propagation_enabled" type="boolean" required={false}>
@@ -463,6 +470,7 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -482,6 +490,7 @@ let data = JSON.stringify({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -523,6 +532,7 @@ payload = json.dumps({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -534,7 +544,7 @@ payload = json.dumps({
} }
} }
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -564,6 +574,7 @@ func main() {
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -623,6 +634,7 @@ request.body = JSON.dump({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -646,6 +658,7 @@ RequestBody body = RequestBody.create(mediaType, '{
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -685,6 +698,7 @@ curl_setopt_array($curl, array(
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -719,6 +733,7 @@ echo $response;
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200, "peer_login_expiration": 43200,
"regular_users_view_blocked": true,
"groups_propagation_enabled": true, "groups_propagation_enabled": true,
"jwt_groups_enabled": true, "jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles", "jwt_groups_claim_name": "roles",
@@ -737,6 +752,7 @@ echo $response;
"settings": { "settings": {
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer", "peer_login_expiration": "integer",
"regular_users_view_blocked": "boolean",
"groups_propagation_enabled": "boolean", "groups_propagation_enabled": "boolean",
"jwt_groups_enabled": "boolean", "jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string", "jwt_groups_claim_name": "string",

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/dns/nameservers" url = "https://api.netbird.io/api/dns/nameservers"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -390,7 +390,7 @@ payload = json.dumps({
], ],
"search_domains_enabled": true "search_domains_enabled": true
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -695,7 +695,7 @@ import json
url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}" url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1044,7 +1044,7 @@ payload = json.dumps({
], ],
"search_domains_enabled": true "search_domains_enabled": true
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -1347,7 +1347,7 @@ import json
url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}" url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1505,7 +1505,7 @@ import json
url = "https://api.netbird.io/api/dns/settings" url = "https://api.netbird.io/api/dns/settings"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1716,7 +1716,7 @@ payload = json.dumps({
"ch8i4ug6lnn4g9hqv7m0" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/events" url = "https://api.netbird.io/api/events"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/locations/countries" url = "https://api.netbird.io/api/locations/countries"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -229,7 +229,7 @@ import json
url = "https://api.netbird.io/api/locations/countries/{country}/cities" url = "https://api.netbird.io/api/locations/countries/{country}/cities"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/groups" url = "https://api.netbird.io/api/groups"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -278,7 +278,7 @@ payload = json.dumps({
"ch8i4ug6lnn4g9hqv7m1" "ch8i4ug6lnn4g9hqv7m1"
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -509,7 +509,7 @@ import json
url = "https://api.netbird.io/api/groups/{groupId}" url = "https://api.netbird.io/api/groups/{groupId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -746,7 +746,7 @@ payload = json.dumps({
"ch8i4ug6lnn4g9hqv7m1" "ch8i4ug6lnn4g9hqv7m1"
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -975,7 +975,7 @@ import json
url = "https://api.netbird.io/api/groups/{groupId}" url = "https://api.netbird.io/api/groups/{groupId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/peers" url = "https://api.netbird.io/api/peers"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -191,6 +191,7 @@ echo $response;
"approval_required": true, "approval_required": true,
"country_code": "DE", "country_code": "DE",
"city_name": "Berlin", "city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"accessible_peers_count": 5 "accessible_peers_count": 5
} }
] ]
@@ -227,6 +228,7 @@ echo $response;
"approval_required": "boolean", "approval_required": "boolean",
"country_code": "string", "country_code": "string",
"city_name": "string", "city_name": "string",
"serial_number": "string",
"accessible_peers_count": "integer" "accessible_peers_count": "integer"
} }
] ]
@@ -291,7 +293,7 @@ import json
url = "https://api.netbird.io/api/peers/{peerId}" url = "https://api.netbird.io/api/peers/{peerId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -436,6 +438,7 @@ echo $response;
"approval_required": true, "approval_required": true,
"country_code": "DE", "country_code": "DE",
"city_name": "Berlin", "city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"accessible_peers": [ "accessible_peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -478,6 +481,7 @@ echo $response;
"approval_required": "boolean", "approval_required": "boolean",
"country_code": "string", "country_code": "string",
"city_name": "string", "city_name": "string",
"serial_number": "string",
"accessible_peers": [ "accessible_peers": [
{ {
"id": "string", "id": "string",
@@ -594,7 +598,7 @@ payload = json.dumps({
"login_expiration_enabled": false, "login_expiration_enabled": false,
"approval_required": true "approval_required": true
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -768,6 +772,7 @@ echo $response;
"approval_required": true, "approval_required": true,
"country_code": "DE", "country_code": "DE",
"city_name": "Berlin", "city_name": "Berlin",
"serial_number": "C02XJ0J0JGH7",
"accessible_peers": [ "accessible_peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -810,6 +815,7 @@ echo $response;
"approval_required": "boolean", "approval_required": "boolean",
"country_code": "string", "country_code": "string",
"city_name": "string", "city_name": "string",
"serial_number": "string",
"accessible_peers": [ "accessible_peers": [
{ {
"id": "string", "id": "string",
@@ -879,7 +885,7 @@ import json
url = "https://api.netbird.io/api/peers/{peerId}" url = "https://api.netbird.io/api/peers/{peerId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/policies" url = "https://api.netbird.io/api/policies"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -478,7 +478,7 @@ payload = json.dumps({
} }
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -855,7 +855,7 @@ import json
url = "https://api.netbird.io/api/policies/{policyId}" url = "https://api.netbird.io/api/policies/{policyId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1292,7 +1292,7 @@ payload = json.dumps({
} }
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -1667,7 +1667,7 @@ import json
url = "https://api.netbird.io/api/policies/{policyId}" url = "https://api.netbird.io/api/policies/{policyId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/posture-checks" url = "https://api.netbird.io/api/posture-checks"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -646,7 +646,7 @@ payload = json.dumps({
} }
} }
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -1097,7 +1097,7 @@ import json
url = "https://api.netbird.io/api/posture-checks/{postureCheckId}" url = "https://api.netbird.io/api/posture-checks/{postureCheckId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1702,7 +1702,7 @@ payload = json.dumps({
} }
} }
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -2151,7 +2151,7 @@ import json
url = "https://api.netbird.io/api/posture-checks/{postureCheckId}" url = "https://api.netbird.io/api/posture-checks/{postureCheckId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/routes" url = "https://api.netbird.io/api/routes"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -350,7 +350,7 @@ payload = json.dumps({
"chacdk86lnnboviihd70" "chacdk86lnnboviihd70"
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -627,7 +627,7 @@ import json
url = "https://api.netbird.io/api/routes/{routeId}" url = "https://api.netbird.io/api/routes/{routeId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -936,7 +936,7 @@ payload = json.dumps({
"chacdk86lnnboviihd70" "chacdk86lnnboviihd70"
] ]
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -1211,7 +1211,7 @@ import json
url = "https://api.netbird.io/api/routes/{routeId}" url = "https://api.netbird.io/api/routes/{routeId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -45,7 +45,7 @@ import json
url = "https://api.netbird.io/api/setup-keys" url = "https://api.netbird.io/api/setup-keys"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -330,7 +330,7 @@ payload = json.dumps({
"usage_limit": 0, "usage_limit": 0,
"ephemeral": true "ephemeral": true
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -593,7 +593,7 @@ import json
url = "https://api.netbird.io/api/setup-keys/{keyId}" url = "https://api.netbird.io/api/setup-keys/{keyId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -882,7 +882,7 @@ payload = json.dumps({
"usage_limit": 0, "usage_limit": 0,
"ephemeral": true "ephemeral": true
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'

View File

@@ -53,7 +53,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}/tokens" url = "https://api.netbird.io/api/users/{userId}/tokens"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -280,7 +280,7 @@ payload = json.dumps({
"name": "My first token", "name": "My first token",
"expires_in": 30 "expires_in": 30
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -505,7 +505,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}/tokens/{tokenId}" url = "https://api.netbird.io/api/users/{userId}/tokens/{tokenId}"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -701,7 +701,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}/tokens/{tokenId}" url = "https://api.netbird.io/api/users/{userId}/tokens/{tokenId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }

View File

@@ -53,7 +53,7 @@ import json
url = "https://api.netbird.io/api/users" url = "https://api.netbird.io/api/users"
headers: { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -182,7 +182,10 @@ echo $response;
"is_current": true, "is_current": true,
"is_service_user": false, "is_service_user": false,
"is_blocked": false, "is_blocked": false,
"issued": "api" "issued": "api",
"permissions": {
"dashboard_view": "limited"
}
} }
] ]
``` ```
@@ -201,7 +204,10 @@ echo $response;
"is_current": "boolean", "is_current": "boolean",
"is_service_user": "boolean", "is_service_user": "boolean",
"is_blocked": "boolean", "is_blocked": "boolean",
"issued": "string" "issued": "string",
"permissions": {
"dashboard_view": "string"
}
} }
] ]
``` ```
@@ -316,7 +322,7 @@ payload = json.dumps({
], ],
"is_service_user": false "is_service_user": false
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -485,7 +491,10 @@ echo $response;
"is_current": true, "is_current": true,
"is_service_user": false, "is_service_user": false,
"is_blocked": false, "is_blocked": false,
"issued": "api" "issued": "api",
"permissions": {
"dashboard_view": "limited"
}
} }
``` ```
```json {{ title: 'Schema' }} ```json {{ title: 'Schema' }}
@@ -502,7 +511,10 @@ echo $response;
"is_current": "boolean", "is_current": "boolean",
"is_service_user": "boolean", "is_service_user": "boolean",
"is_blocked": "boolean", "is_blocked": "boolean",
"issued": "string" "issued": "string",
"permissions": {
"dashboard_view": "string"
}
} }
``` ```
</CodeGroup> </CodeGroup>
@@ -608,7 +620,7 @@ payload = json.dumps({
], ],
"is_blocked": false "is_blocked": false
}) })
headers: { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
@@ -769,7 +781,10 @@ echo $response;
"is_current": true, "is_current": true,
"is_service_user": false, "is_service_user": false,
"is_blocked": false, "is_blocked": false,
"issued": "api" "issued": "api",
"permissions": {
"dashboard_view": "limited"
}
} }
``` ```
```json {{ title: 'Schema' }} ```json {{ title: 'Schema' }}
@@ -786,7 +801,10 @@ echo $response;
"is_current": "boolean", "is_current": "boolean",
"is_service_user": "boolean", "is_service_user": "boolean",
"is_blocked": "boolean", "is_blocked": "boolean",
"issued": "string" "issued": "string",
"permissions": {
"dashboard_view": "string"
}
} }
``` ```
</CodeGroup> </CodeGroup>
@@ -847,7 +865,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}" url = "https://api.netbird.io/api/users/{userId}"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }
@@ -1011,7 +1029,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}/invite" url = "https://api.netbird.io/api/users/{userId}/invite"
headers: { headers = {
'Authorization': 'Token <TOKEN>' 'Authorization': 'Token <TOKEN>'
} }