4930: Specify the cookie file path so we can use the api in AWS Lambda

sgile-onshape

What version are you running?

Python, RBTools 2.0

Describe the enhancement and the motivation for it.

We wan to use the rbtools api inside of a AWS Lambda. However the AWS Lambda doesn't have a fully open file system. There is no user/home directory. The only accessible directory is /tmp. When trying to create the client root we receive the following error.

[WARNING] 2021-06-24T18:35:31.229Z 4782a7ab-5e9f-4a0a-8cc0-2ff3c2234b27 There was an error while creating a cookie file: [Errno 30] Read-only file system: '.rbtools-cookies'

We would like the option to provide a location for this cookie file.

Please provide any additional information below.

http://aws.amazon.com/lambda/faqs

Q: What if I need scratch space on disk for my AWS Lambda function?
A: Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory.

Q: How can I deploy my existing containerized application to AWS Lambda?
The container image must be able to run on a read-only filesystem. Your function code can access a writable /tmp directory storage of 512 MB. If you are using an image that requires a writable root directory, configure it to write to the /tmp directory.

#1 sgile-onshape

There are arguments to the RBClient constructor named 'cookie_file=' and 'save_cookies' that allow chaning the location of the cookie file or saving the credentials in memory instead of a file.