Skip to content

Shift to node-native authentication #11

@slifty

Description

@slifty

The current node worker does the following in order to load a wiki page:

  1. Invoke get-cookies.sh which (A) makes an API call to get a token and (B) makes a second API call to log in, storing the resulting cookies into a cookies.jar file

  2. Invoke puppeteer, passing the cookies.jar file so that it maintains the session.

I'm concerned that this might result in a race condition in which two users from the same wiki making calls could potentially overwrite the authentication cookie for a given domain. I also think there is value in trying to keep the curl logic inside of node (instead of a separate shell file / process).

Node has libraries like superagent and node-fetch which can make curl-like calls and superagent has built in support for cookies. The question is whether I can pass the superagent cookie store to puppeteer or not.

If it's possible to create a common cookie store used by both superagent (or equivalent) and puppeteer, then I would like to replace get-cookies.sh with pure node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions