parse-community / parse-community/parse-server-s3-adapter

Wrong options type when set from environment variables

Open
#118 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
80
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Hello.

While I was implementing PR: https://github.com/parse-community/parse-server-s3-adapter/pull/117, I encountered a problem with the environment variables.

As you can see in the image below, the _baseUrlDirect variable has the correct type (boolean), as it was not set via the environment variable. However, the other two _directAccess and _presignedUrl variables that were set as environment variables, are not being converted to the correct type (it should be boolean).

2020-11-17_00-45

This problem causes a check of the form if (_directAccess) { ... }, do not be verified as expected.

I would like to know if I can create a PR using the https://www.npmjs.com/package/boolean lib to do this conversion?

I don't know if you noticed, but the _presignedUrlExpires variable should be an integer, but it is also a string. However, this case can be solved with the standard parseInt() Javascript library.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how _directAccess, _presignedUrl, and _presignedUrlExpires are read from environment variables in the adapter, and compare them with the correctly typed _baseUrlDirect value. Check the proposed boolean library alongside standard integer parsing. Done means boolean environment values control the checks as expected and _presignedUrlExpires is treated as an integer.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.