diff --git a/src/pages/ipa/resources/accounts.mdx b/src/pages/ipa/resources/accounts.mdx index be0f519e..6ba65c38 100644 --- a/src/pages/ipa/resources/accounts.mdx +++ b/src/pages/ipa/resources/accounts.mdx @@ -166,7 +166,9 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7l0", "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } } ] @@ -177,7 +179,9 @@ echo $response; "id": "string", "settings": { "peer_login_expiration_enabled": "boolean", - "peer_login_expiration": "integer" + "peer_login_expiration": "integer", + "jwt_groups_enabled": "boolean", + "jwt_groups_claim_name": "string" } } ] @@ -223,6 +227,20 @@ echo $response; > Period of time after which peer login expires (seconds). + + + + Allows extract groups from JWT claim and add it to account groups. + + + + Name of the claim from which we extract groups names to add it to account groups. @@ -237,7 +255,9 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ --data-raw '{ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }' ``` @@ -247,7 +267,9 @@ const axios = require('axios'); let data = JSON.stringify({ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }); let config = { @@ -279,7 +301,9 @@ url = "https://api.netbird.io/api/accounts/{accountId}" payload = json.dumps({ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }) headers: { @@ -311,7 +335,9 @@ func main() { payload := strings.NewReader(`{ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }`) client := &http.Client { @@ -361,7 +387,9 @@ request["Authorization"] = "Token " request.body = JSON.dump({ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }) response = https.request(request) @@ -375,7 +403,9 @@ MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, '{ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }'); Request request = new Request.Builder() @@ -405,7 +435,9 @@ curl_setopt_array($curl, array( CURLOPT_POSTFIELDS => '{ "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } }', CURLOPT_HTTPHEADER => array( @@ -431,7 +463,9 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7l0", "settings": { "peer_login_expiration_enabled": true, - "peer_login_expiration": 43200 + "peer_login_expiration": 43200, + "jwt_groups_enabled": true, + "jwt_groups_claim_name": "roles" } } ``` @@ -440,7 +474,9 @@ echo $response; "id": "string", "settings": { "peer_login_expiration_enabled": "boolean", - "peer_login_expiration": "integer" + "peer_login_expiration": "integer", + "jwt_groups_enabled": "boolean", + "jwt_groups_claim_name": "string" } } ``` diff --git a/src/pages/ipa/resources/groups.mdx b/src/pages/ipa/resources/groups.mdx index 6f9e5f2c..5bdb7893 100644 --- a/src/pages/ipa/resources/groups.mdx +++ b/src/pages/ipa/resources/groups.mdx @@ -166,6 +166,7 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", "peers_count": 2, + "issued": "api", "peers": [ { "id": "chacbco6lnnbn6cg5s90", @@ -181,6 +182,7 @@ echo $response; "id": "string", "name": "string", "peers_count": "integer", + "issued": "string", "peers": [ { "id": "string", @@ -431,6 +433,7 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", "peers_count": 2, + "issued": "api", "peers": [ { "id": "chacbco6lnnbn6cg5s90", @@ -444,6 +447,7 @@ echo $response; "id": "string", "name": "string", "peers_count": "integer", + "issued": "string", "peers": [ { "id": "string", @@ -635,6 +639,7 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", "peers_count": 2, + "issued": "api", "peers": [ { "id": "chacbco6lnnbn6cg5s90", @@ -648,6 +653,7 @@ echo $response; "id": "string", "name": "string", "peers_count": "integer", + "issued": "string", "peers": [ { "id": "string", @@ -905,6 +911,7 @@ echo $response; "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", "peers_count": 2, + "issued": "api", "peers": [ { "id": "chacbco6lnnbn6cg5s90", @@ -918,6 +925,7 @@ echo $response; "id": "string", "name": "string", "peers_count": "integer", + "issued": "string", "peers": [ { "id": "string", diff --git a/src/pages/ipa/resources/peers.mdx b/src/pages/ipa/resources/peers.mdx index 4e3458e9..2553060b 100644 --- a/src/pages/ipa/resources/peers.mdx +++ b/src/pages/ipa/resources/peers.mdx @@ -174,7 +174,8 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "ssh_enabled": true, @@ -202,7 +203,8 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "ssh_enabled": "boolean", @@ -407,7 +409,8 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "ssh_enabled": true, @@ -433,7 +436,8 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "ssh_enabled": "boolean", @@ -703,7 +707,8 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "ssh_enabled": true, @@ -729,7 +734,8 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "ssh_enabled": "boolean", diff --git a/src/pages/ipa/resources/policies.mdx b/src/pages/ipa/resources/policies.mdx index 3471c268..24e6cfab 100644 --- a/src/pages/ipa/resources/policies.mdx +++ b/src/pages/ipa/resources/policies.mdx @@ -184,14 +184,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -223,14 +225,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -672,14 +676,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -709,14 +715,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -920,14 +928,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -957,14 +967,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -1413,14 +1425,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -1450,14 +1464,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } diff --git a/src/pages/ipa/resources/rules.mdx b/src/pages/ipa/resources/rules.mdx index 4896e594..e3db97e5 100644 --- a/src/pages/ipa/resources/rules.mdx +++ b/src/pages/ipa/resources/rules.mdx @@ -172,14 +172,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -197,14 +199,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -527,14 +531,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -550,14 +556,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -747,14 +755,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -770,14 +780,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } @@ -1107,14 +1119,16 @@ echo $response; { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ], "destinations": [ { "id": "ch8i4ug6lnn4g9hqv7m0", "name": "devs", - "peers_count": 2 + "peers_count": 2, + "issued": "api" } ] } @@ -1130,14 +1144,16 @@ echo $response; { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ], "destinations": [ { "id": "string", "name": "string", - "peers_count": "integer" + "peers_count": "integer", + "issued": "string" } ] } diff --git a/src/pages/ipa/resources/users.mdx b/src/pages/ipa/resources/users.mdx index 87a837b2..b6337704 100644 --- a/src/pages/ipa/resources/users.mdx +++ b/src/pages/ipa/resources/users.mdx @@ -970,6 +970,172 @@ echo $response; + + + +--- + + +## Resend user invitation {{ tag: 'POST' , label: '/api/users/{userId}/invite' }} + + + + Resend user invitation + + #### Path Parameters + + + + The unique identifier of a user + + + + + + +```bash {{ title: 'cURL' }} +curl -X POST https://api.netbird.io/api/users/{userId}/invite \ +-H 'Authorization: Token ' +``` + +```js +const axios = require('axios'); + +let config = { + method: 'post', + maxBodyLength: Infinity, + url: '/api/users/{userId}/invite', + headers: { + 'Authorization': 'Token ' + } +}; + +axios(config) +.then((response) => { + console.log(JSON.stringify(response.data)); +}) +.catch((error) => { + console.log(error); +}); +``` + +```python +import requests +import json + +url = "https://api.netbird.io/api/users/{userId}/invite" + +headers: { + 'Authorization': 'Token ' +} + +response = requests.request("POST", url, headers=headers) + +print(response.text) +``` + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io/ioutil" +) + +func main() { + + url := "https://api.netbird.io/api/users/{userId}/invite" + method := "POST" + + client := &http.Client { + } + req, err := http.NewRequest(method, url, nil) + + if err != nil { + fmt.Println(err) + return + { + + req.Header.Add("Authorization", "Token ") + + res, err := client.Do(req) + if err != nil { + fmt.Println(err) + return + } + defer res.Body.Close() + + body, err := ioutil.ReadAll(res.Body) + if err != nil { + fmt.Println(err) + return + } + fmt.Println(string(body)) +} +``` + +```ruby +require "uri" +require "json" +require "net/http" + +url = URI("https://api.netbird.io/api/users/{userId}/invite") + +https = Net::HTTP.new(url.host, url.port) +https.use_ssl = true + +request = Net::HTTP::Post.new(url) +request["Authorization"] = "Token " + +response = https.request(request) +puts response.read_body +``` + +```java +OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + +Request request = new Request.Builder() + .url("https://api.netbird.io/api/users/{userId}/invite") + .method("POST") + .addHeader("Authorization: Token ") + .build(); +Response response = client.newCall(request).execute(); +``` + +```php + 'https://api.netbird.io/api/users/{userId}/invite', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Authorization: Token ' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + + + + + + +