Skip to content

Ability to use API client instances instead of globally configured instance #140

@alxgsv

Description

@alxgsv

I am using uploadcare-ruby in my webservice that works with different Uploadcare projects. In order to switch between project I use this code: https://github.com/alxgsv/uc/blob/main/app/services/uploadcare_service.rb#L5-L14

However, without inspecting sources, I'm not sure that code is thread-safe, and I'm extremely worried about race conditions that could lead to reads or writes to wrong project, violating security and privacy.

It would be great to have an ability to initialize API client and to have guarantee that everything will work as expected:

client = Uploadcare::Api.new(credentials)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions