You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(SDK-4543): Support Organizations with Client Grants (#736)
### Changes
This pull request adds functionality associated with Organizations and
Client Grants. It introduces support for:
- Retrieving Organizations associated with a Client Grant.
- Retrieving Client Grants associated with an Organization.
- Associating or disassociating client grants from organizations.
### References
Please review internal ticket SDK-4543.
### Testing
Tests have been added and updated to cover these changes. Coverage
remains at 100%.
### Contributor Checklist
- [x] I agree to adhere to the [Auth0 General Contribution
Guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md).
- [x] I agree to uphold the [Auth0 Code of
Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
* @param string $clientId client ID to receive the grant
17
-
* @param string $audience audience identifier for the API being granted
18
-
* @param null|array<string> $scope Optional. Scopes allowed for this client grant.
19
-
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
16
+
* @param string $clientId client ID to receive the grant
17
+
* @param string $audience audience identifier for the API being granted
18
+
* @param null|array<string> $scope Optional. Scopes allowed for this client grant.
19
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
20
+
* @param null|string $organizationUsage Optional. Defines whether organizations can be used with client credentials exchanges for this grant. Possible values are `deny`, `allow` or `require`.
21
+
* @param null|bool $allowAnyOrganization Optional. If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.
20
22
*
21
23
* @throws \Auth0\SDK\Exception\ArgumentException when an invalid `clientId` or `audience` are provided
22
24
* @throws \Auth0\SDK\Exception\NetworkException when the API request fails due to a network error
@@ -28,6 +30,8 @@ public function create(
28
30
string$audience,
29
31
?array$scope = null,
30
32
?RequestOptions$options = null,
33
+
?string$organizationUsage = null,
34
+
?bool$allowAnyOrganization = null,
31
35
): ResponseInterface;
32
36
33
37
/**
@@ -101,13 +105,31 @@ public function getAllByClientId(
* @param string $grantId Grant (by it's ID) to update
113
+
* @param null|int[]|null[]|string[] $parameters Optional. Additional query parameters to pass with the API request. See @see for supported options.
114
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
115
+
*
116
+
* @throws \Auth0\SDK\Exception\NetworkException when the API request fails due to a network error
117
+
*/
118
+
publicfunctiongetOrganizations(
119
+
string$grantId,
120
+
?array$parameters = null,
121
+
?RequestOptions$options = null,
122
+
): ResponseInterface;
123
+
104
124
/**
105
125
* Update an existing Client Grant.
106
126
* Required scope: `update:client_grants`.
107
127
*
108
-
* @param string $grantId grant (by it's ID) to update
109
-
* @param null|array<string> $scope Optional. Array of scopes to update; will replace existing scopes, not merge.
110
-
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
128
+
* @param string $grantId Grant (by it's ID) to update
129
+
* @param null|array<string> $scope Optional. Array of scopes to update; will replace existing scopes, not merge.
130
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
131
+
* @param null|string $organizationUsage Optional. Defines whether organizations can be used with client credentials exchanges for this grant. Possible values are `deny`, `allow` or `require`.
132
+
* @param null|bool $allowAnyOrganization Optional. If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.
111
133
*
112
134
* @throws \Auth0\SDK\Exception\ArgumentException when an invalid `grantId` is provided
113
135
* @throws \Auth0\SDK\Exception\NetworkException when the API request fails due to a network error
* @param string $id Organization (by ID) to associate the client grant with.
17
+
* @param string $grantId Client Grant (by ID) to associate with the organization.
18
+
* @param null|array<mixed> $parameters Optional. Additional body content to send with the API request.
19
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these.
20
+
*
21
+
* @throws \Auth0\SDK\Exception\ArgumentException When an invalid `id` or `connectionId` are provided
22
+
* @throws \Auth0\SDK\Exception\NetworkException When the API request fails due to a network error
* @param string $id Organization (by ID) that the connection is associated with
233
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these.)
234
+
*
235
+
* @throws \Auth0\SDK\Exception\ArgumentException when an invalid `id` or `connectionId` are provided
236
+
* @throws \Auth0\SDK\Exception\NetworkException when the API request fails due to a network error
237
+
*/
238
+
publicfunctiongetClientGrants(
239
+
string$id,
240
+
?RequestOptions$options = null,
241
+
): ResponseInterface;
242
+
209
243
/**
210
244
* Get a connection (by ID) associated with an organization.
* @param string $id Organization (by ID) to remove client grant from.
356
+
* @param string $grantId Client Grant (by ID) to remove from the organization.
357
+
* @param null|array<mixed> $parameters Optional. Additional body content to send with the API request.
358
+
* @param null|RequestOptions $options Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these.)
0 commit comments