2.9.1
Some technical talk on #145 that proved out there was an issue with production batch background job usage where multiple threads were stomping on each others global configuration of the gem.
Description
This PR addresses the global nature to any of the sensitive fields and creates testable, instances of a XeroRuby Client that won't ever overwrite another thread's previous configuration..
In essence it clones the default configuration for each instance, rather than inherit from the object/class.
Changes
- fixes proper optionality of the config in #151 (cc @carlospeix)
- clones the default config and applies any user init changes
- Makes each configuration option editable, strictly to the instance of the client
- allows for the setting of an
id_token
on the xero_client - infers the base url programmatically based on the method scope
- some fixes for the docs
- a few odds and ends based on recent open api spec
Release Notes
- production bug
- background process / thread safety vulnerability patch
Types of Changes
- Bug fix
cc: @nikz // @CyberFerret // @armstrjare thank you all for the discourse in figuring this one out. Dm me @ w/ your address i'd like to send you some Xero swag as thanks.
small breaking change to the upload_file
api
This:
@folder = xero_client.files_api.get_folders(current_user.active_tenant_id).last
file_name = "xero-api.png"
file = File.new(Rails.root.join('app/assets/images/xero-api.png'))
opts = {
folder_id: @folder.id,
body: file,
name: file_name,
filename: file_name,
mime_type: 'image/png'
}
@file = xero_client.files_api.upload_file(current_user.active_tenant_id, opts)
Changed to this
@folder = xero_client.files_api.get_folders(current_user.active_tenant_id).last
file_name = "xero-api.png"
file = File.new(Rails.root.join('app/assets/images/xero-api.png'))
opts = {
folder_id: @folder.id,
mime_type: 'image/png'
}
@file = xero_client.files_api.upload_file(current_user.active_tenant_id, file, file_name, file_name, opts)