Skip to content

Commit

Permalink
Extend IdP sync API docs with user/group filters (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
surik authored Jan 15, 2024
1 parent ba2d7c7 commit e6ee8ec
Showing 1 changed file with 50 additions and 22 deletions.
72 changes: 50 additions & 22 deletions misc/idp-sync/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ By default, for new integration synchronization is enabled.

Request:
- `service_account_key`: A Base64 encoded string derived from a service account key JSON. For the creation of the service account key JSON, refer to the provided [IdP guideline](https://docs.netbird.io/how-to/idp-sync#google-work-space).
Encode service account JSON to base64 by using the command:
Encode service account JSON to base64 by using the command:
```shell
base64 -i <SERVICE_ACCOUNT_KEY_PATH>
```

- `sync_interval`: Optional. The default value is 300 seconds.
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.

```shell
curl --request POST \
Expand All @@ -27,18 +28,22 @@ curl --request POST \
--header 'Authorization: Token <PAT>' \
--header 'Content-Type: application/json' \
--data '{
"service_account_key": "<SERVICE_ACCOUNT_KEY>",
"customerID": "<CUSTOMER_ID>"
"service_account_key": "<SERVICE_ACCOUNT_KEY>",
"customerID": "<CUSTOMER_ID>",
"group_prefixes": [],
"user_group_prefixes": []
}'
```

Response
```json
{
"id": <ID>,
"customer_id": "<CUSTOMER_ID",
"sync_interval": 300,
"enabled": true
"id": <ID>,
"customer_id": "<CUSTOMER_ID",
"sync_interval": 300,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
```

Expand All @@ -57,7 +62,9 @@ Response
"id": <ID>,
"customer_id": "<CUSTOMER_ID",
"sync_interval": 300,
"enabled": true
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
```

Expand All @@ -77,7 +84,9 @@ Response
"id": <ID>,
"customer_id": "<CUSTOMER_ID>",
"sync_interval": 300,
"enabled": true
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
]
```
Expand Down Expand Up @@ -108,7 +117,9 @@ Request
base64 -i <SERVICE_ACCOUNT_KEY_PATH>
```
- `sync_interval`: Optional. Should not be less than 300 seconds.
- `enabled`: Optional. Used to disable/enable the integration.
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.
- `enabled`: Optional. Used to disable/enable the integration.

```shell
curl --request PUT \
Expand All @@ -117,9 +128,11 @@ curl --request PUT \
--header 'Authorization: Token <PAT>' \
--header 'Content-Type: application/json' \
--data '{
"service_account_key": "<SERVICE_ACCOUNT_KEY>",
"sync_interval": 300,
"enabled": false
"service_account_key": "<SERVICE_ACCOUNT_KEY>",
"sync_interval": 300,
"enabled": false,
"group_prefixes": [],
"user_group_prefixes": []
}'
```

Expand All @@ -129,7 +142,9 @@ Response
"id": <ID>,
"customer_id": "<CUSTOMER_ID>",
"sync_interval": 300,
"enabled": false
"enabled": false,
"group_prefixes": [],
"user_group_prefixes": []
}
```

Expand Down Expand Up @@ -182,6 +197,9 @@ Request:
- `client_id`: Azure Directory application client Id.
- `tenant_id`: Azure Directory ID.
- `sync_interval`: Optional. The default value is 300 seconds.
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.
- `enabled`: Optional. Used to disable/enable the integration.

```shell
curl --request POST \
Expand All @@ -190,9 +208,11 @@ curl --request POST \
--header 'Authorization: Token <PAT>' \
--header 'Content-Type: application/json' \
--data '{
"client_secret": "<CLIENT_SECRET>",
"client_id": "<CLIENT_ID>",
"tenant_id": "<TENANT_ID>"
"client_secret": "<CLIENT_SECRET>",
"client_id": "<CLIENT_ID>",
"tenant_id": "<TENANT_ID>",
"group_prefixes": [],
"user_group_prefixes": []
}'
```

Expand Down Expand Up @@ -223,7 +243,9 @@ Response
"client_id": "<CLIENT_ID>",
"tenant_id": "<TENANT_ID>",
"sync_interval": 300,
"enabled": true
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
```

Expand All @@ -244,7 +266,9 @@ Response
"client_id": "<CLIENT_ID>",
"tenant_id": "<TENANT_ID>",
"sync_interval": 300,
"enabled": true
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
]
```
Expand Down Expand Up @@ -275,7 +299,9 @@ Request
echo -n <CLIENT_SECRET> | base64
```
- `sync_interval`: Optional. Should not be less than 300 seconds.
- `enabled`: Optional. Used to disable/enable the integration.
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.
- `enabled`: Optional. Used to disable/enable the integration.

```shell
curl --request PUT \
Expand All @@ -297,7 +323,9 @@ Response
"client_id": "<CLIENT_ID>",
"tenant_id": "<TENANT_ID>",
"sync_interval": 300,
"enabled": true
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}
```

Expand Down

0 comments on commit e6ee8ec

Please sign in to comment.