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 a7af9c9 commit 578676e
Showing 1 changed file with 84 additions and 1 deletion.
85 changes: 84 additions & 1 deletion src/main/python/fusionauth/fusionauth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,24 @@ def create_messenger(self, request, messenger_id=None):
.post() \
.go()

def create_o_auth_scope(self, application_id, request, scope_id=None):
"""
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.
Attributes:
application_id: The Id of the application to create the OAuth scope on.
scope_id: (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
request: The request object that contains all the information used to create the OAuth OAuth scope.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("scope") \
.url_segment(scope_id) \
.body_handler(JSONBodyHandler(request)) \
.post() \
.go()

def create_tenant(self, request, tenant_id=None):
"""
Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
Expand Down Expand Up @@ -773,7 +791,7 @@ def delete_application_role(self, application_id, role_id):
permanently removes the given role from all users that had it.
Attributes:
application_id: The Id of the application to deactivate.
application_id: The Id of the application that the role belongs to.
role_id: The Id of the role to delete.
"""
return self.start().uri('/api/application') \
Expand Down Expand Up @@ -996,6 +1014,22 @@ def delete_messenger(self, messenger_id):
.delete() \
.go()

def delete_o_auth_scope(self, application_id, scope_id):
"""
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.
Attributes:
application_id: The Id of the application that the OAuth scope belongs to.
scope_id: The Id of the OAuth scope to delete.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("scope") \
.url_segment(scope_id) \
.delete() \
.go()

def delete_registration(self, user_id, application_id):
"""
Deletes the user registration for the given user and application.
Expand Down Expand Up @@ -1897,6 +1931,23 @@ def patch_messenger(self, messenger_id, request):
.patch() \
.go()

def patch_o_auth_scope(self, application_id, scope_id, request):
"""
Updates, via PATCH, the custom OAuth scope with the given Id for the application.
Attributes:
application_id: The Id of the application that the OAuth scope belongs to.
scope_id: The Id of the OAuth scope to update.
request: The request that contains just the new OAuth scope information.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("scope") \
.url_segment(scope_id) \
.body_handler(JSONBodyHandler(request)) \
.patch() \
.go()

def patch_registration(self, user_id, request):
"""
Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
Expand Down Expand Up @@ -2815,6 +2866,21 @@ def retrieve_monthly_active_report(self, start, end, application_id=None):
.get() \
.go()

def retrieve_o_auth_scope(self, application_id, scope_id):
"""
Retrieves a custom OAuth scope.
Attributes:
application_id: The Id of the application that the OAuth scope belongs to.
scope_id: The Id of the OAuth scope to retrieve.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("scope") \
.url_segment(scope_id) \
.get() \
.go()

def retrieve_oauth_configuration(self, application_id):
"""
Retrieves the Oauth2 configuration for the application for the given Application Id.
Expand Down Expand Up @@ -4317,6 +4383,23 @@ def update_messenger(self, messenger_id, request):
.put() \
.go()

def update_o_auth_scope(self, application_id, scope_id, request):
"""
Updates the OAuth scope with the given Id for the application.
Attributes:
application_id: The Id of the application that the OAuth scope belongs to.
scope_id: The Id of the OAuth scope to update.
request: The request that contains all the new OAuth scope information.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("scope") \
.url_segment(scope_id) \
.body_handler(JSONBodyHandler(request)) \
.put() \
.go()

def update_registration(self, user_id, request):
"""
Updates the registration for the user with the given Id and the application defined in the request.
Expand Down

0 comments on commit 578676e

Please sign in to comment.