Skip to content

Commit

Permalink
client library sync
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Apr 19, 2024
1 parent 12853c2 commit 4423028
Showing 1 changed file with 104 additions and 1 deletion.
105 changes: 104 additions & 1 deletion src/FusionAuth/FusionAuthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,28 @@ public function createMessenger($messengerId, $request)
->go();
}

/**
* Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
* You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
*
* @param string $applicationId The Id of the application to create the OAuth scope on.
* @param string $scopeId (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
* @param array $request The request object that contains all the information used to create the OAuth OAuth scope.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function createOAuthScope($applicationId, $scopeId, $request)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("scope")
->urlSegment($scopeId)
->bodyHandler(new JSONBodyHandler($request))
->post()
->go();
}

/**
* Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
*
Expand Down Expand Up @@ -1006,7 +1028,7 @@ public function deleteApplication($applicationId)
* Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
* permanently removes the given role from all users that had it.
*
* @param string $applicationId The Id of the application to deactivate.
* @param string $applicationId The Id of the application that the role belongs to.
* @param string $roleId The Id of the role to delete.
*
* @return ClientResponse The ClientResponse.
Expand Down Expand Up @@ -1303,6 +1325,26 @@ public function deleteMessenger($messengerId)
->go();
}

/**
* Hard deletes a custom OAuth scope.
* OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
*
* @param string $applicationId The Id of the application that the OAuth scope belongs to.
* @param string $scopeId The Id of the OAuth scope to delete.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function deleteOAuthScope($applicationId, $scopeId)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("scope")
->urlSegment($scopeId)
->delete()
->go();
}

/**
* Deletes the user registration for the given user and application.
*
Expand Down Expand Up @@ -2440,6 +2482,27 @@ public function patchMessenger($messengerId, $request)
->go();
}

/**
* Updates, via PATCH, the custom OAuth scope with the given Id for the application.
*
* @param string $applicationId The Id of the application that the OAuth scope belongs to.
* @param string $scopeId The Id of the OAuth scope to update.
* @param array $request The request that contains just the new OAuth scope information.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function patchOAuthScope($applicationId, $scopeId, $request)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("scope")
->urlSegment($scopeId)
->bodyHandler(new JSONBodyHandler($request))
->patch()
->go();
}

/**
* Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
*
Expand Down Expand Up @@ -3654,6 +3717,25 @@ public function retrieveMonthlyActiveReport($applicationId, $start, $end)
->go();
}

/**
* Retrieves a custom OAuth scope.
*
* @param string $applicationId The Id of the application that the OAuth scope belongs to.
* @param string $scopeId The Id of the OAuth scope to retrieve.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function retrieveOAuthScope($applicationId, $scopeId)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("scope")
->urlSegment($scopeId)
->get()
->go();
}

/**
* Retrieves the Oauth2 configuration for the application for the given Application Id.
*
Expand Down Expand Up @@ -5612,6 +5694,27 @@ public function updateMessenger($messengerId, $request)
->go();
}

/**
* Updates the OAuth scope with the given Id for the application.
*
* @param string $applicationId The Id of the application that the OAuth scope belongs to.
* @param string $scopeId The Id of the OAuth scope to update.
* @param array $request The request that contains all the new OAuth scope information.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function updateOAuthScope($applicationId, $scopeId, $request)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("scope")
->urlSegment($scopeId)
->bodyHandler(new JSONBodyHandler($request))
->put()
->go();
}

/**
* Updates the registration for the user with the given Id and the application defined in the request.
*
Expand Down

0 comments on commit 4423028

Please sign in to comment.