dyn-art / monorepo-v1

dyn.art monorepo
https://physicaldotart.vercel.app
GNU General Public License v3.0
0 stars 0 forks source link

[PHY-29] Create basic `etsy` package #7

Closed bennobuilder closed 1 year ago

bennobuilder commented 1 year ago

DoD

From SyncLinear.com | PHY-29

bennobuilder commented 1 year ago

Options

Option 1: Puppeteer Login

A browser automation like Puppeteer will be used to complete the Etsy OAuth2 Flow automatically by logging in with the user data in a stripped down Chrome browser. However, this method requires deactivating 2FA, which is not recommended for security reasons.

Disadvantages

Advantages

Option 2: Manual Login

The refresh token will be set as an environment variable with its expiration timestamp. The refresh token has to be manually and locally fetched by calling http://localhost:9000/v1/auth/etsy/oauth/challenge (this route is only accessible on StageLOCAL) and completing the OAuth2 Flow manually with 2FA. Once the refresh token is received, it has to be added to the environment variable with the expiration timestamp wherever the @pda/etsy package is in use (backend services only). To avoid forgetting to renew the refresh token, an alert will be set up. Additionally, the returned expiration timestamp has a five-day buffer.

Disadvantages

Decision