lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.7.4 vs lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.8.0.pre.RC.1
- old
+ new
@@ -295,10 +295,25 @@
.post()
.go()
end
#
+ # Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
+ #
+ # @param theme_id [string] (Optional) The Id for the theme. If not provided a secure random UUID will be generated.
+ # @param request [OpenStruct, Hash] The request object that contains all of the information used to create the theme.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def create_theme(theme_id, request)
+ start.uri('/api/theme')
+ .url_segment(theme_id)
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
+ .post()
+ .go()
+ end
+
+ #
# Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
#
# @param user_id [string] (Optional) The Id for the user. If not provided a secure random UUID will be generated.
# @param request [OpenStruct, Hash] The request object that contains all of the information used to create the user.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -577,10 +592,23 @@
.delete()
.go()
end
#
+ # Deletes the theme for the given Id.
+ #
+ # @param theme_id [string] The Id of the theme to delete.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def delete_theme(theme_id)
+ start.uri('/api/theme')
+ .url_segment(theme_id)
+ .delete()
+ .go()
+ end
+
+ #
# Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
# with the user.
#
# @param user_id [string] The Id of the user to delete.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -711,11 +739,11 @@
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def generate_email_verification_id(email)
start.uri('/api/user/verify-email')
.url_parameter('email', email)
- .url_parameter('sendVerifyPasswordEmail', false)
+ .url_parameter('sendVerifyEmail', false)
.put()
.go()
end
#
@@ -841,11 +869,13 @@
.get()
.go()
end
#
- # Logs a user in.
+ # Authenticates a user to FusionAuth.
+ #
+ # This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
#
# @param request [OpenStruct, Hash] The login request that contains the user credentials used to log them in.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def login(request)
@@ -992,10 +1022,24 @@
.post()
.go()
end
#
+ # Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a
+ # reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
+ # if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to
+ # ensure the index immediately current before making a query request to the search index.
+ #
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def refresh_user_search_index()
+ start.uri('/api/user/search')
+ .put()
+ .go()
+ end
+
+ #
# Registers a user for an application. If you provide the User and the UserRegistration object on this request, it
# will create the user as well as register them for the application. This is called a Full Registration. However, if
# you only provide the UserRegistration object, then the user must already exist and they will be registered for the
# application. The user id can also be provided and it will either be used to look up an existing user or it will be
# used for the newly created User.
@@ -1365,25 +1409,36 @@
.get()
.go()
end
#
- # Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id. If the key Id is provided a
- # single public key will be returned if one is found by that id. If the optional parameter key Id is not provided all
- # public keys will be returned.
+ # Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
#
- # @param key_id [string] (Optional) The Id of the public key.
+ # @param key_id [string] The Id of the public key (kid).
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def retrieve_jwt_public_key(key_id)
start.uri('/api/jwt/public-key')
- .url_segment(key_id)
+ .url_parameter('kid', key_id)
.get()
.go()
end
#
+ # Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
+ #
+ # @param application_id [string] The Id of the Application for which this key is used.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def retrieve_jwt_public_key_by_application_id(application_id)
+ start.uri('/api/jwt/public-key')
+ .url_parameter('applicationId', application_id)
+ .get()
+ .go()
+ end
+
+ #
# Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).
#
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def retrieve_jwt_public_keys()
@@ -1502,21 +1557,39 @@
.get()
.go()
end
#
- # Retrieves the password validation rules.
+ # Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided
+ # through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.
+ #
+ # This API does not require an API key.
#
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def retrieve_password_validation_rules()
- start.uri('/api/system-configuration/password-validation-rules')
+ start.uri('/api/tenant/password-validation-rules')
.get()
.go()
end
#
+ # Retrieves the password validation rules for a specific tenant.
+ #
+ # This API does not require an API key.
+ #
+ # @param tenant_id [string] The Id of the tenant.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def retrieve_password_validation_rules_with_tenant_id(tenant_id)
+ start.uri('/api/tenant/password-validation-rules')
+ .url_segment(tenant_id)
+ .get()
+ .go()
+ end
+
+ #
# Retrieves all of the children for the given parent email address.
#
# @param parent_email [string] The email of the parent.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
@@ -1622,10 +1695,34 @@
.get()
.go()
end
#
+ # Retrieves the theme for the given Id.
+ #
+ # @param theme_id [string] The Id of the theme.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def retrieve_theme(theme_id)
+ start.uri('/api/theme')
+ .url_segment(theme_id)
+ .get()
+ .go()
+ end
+
+ #
+ # Retrieves all of the themes.
+ #
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def retrieve_themes()
+ start.uri('/api/theme')
+ .get()
+ .go()
+ end
+
+ #
# Retrieves the totals report. This contains all of the total counts for each application and the global registration
# count.
#
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
@@ -2248,9 +2345,24 @@
# @return [FusionAuth::ClientResponse] The ClientResponse object.
#
def update_tenant(tenant_id, request)
start.uri('/api/tenant')
.url_segment(tenant_id)
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
+ .put()
+ .go()
+ end
+
+ #
+ # Updates the theme with the given Id.
+ #
+ # @param theme_id [string] The Id of the theme to update.
+ # @param request [OpenStruct, Hash] The request that contains all of the new theme information.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ #
+ def update_theme(theme_id, request)
+ start.uri('/api/theme')
+ .url_segment(theme_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.put()
.go()
end