Skip to content

Header Based Authentication & Healthcheck#35

Open
latetedemelon wants to merge 17 commits into
jhonderson:mainfrom
latetedemelon:main
Open

Header Based Authentication & Healthcheck#35
latetedemelon wants to merge 17 commits into
jhonderson:mainfrom
latetedemelon:main

Conversation

@latetedemelon

Copy link
Copy Markdown

Please take a look; I could use someone else to test as well if possible.

@latetedemelon

Copy link
Copy Markdown
Author

Please let me know if any changes are required.

@jhonderson jhonderson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks for your PR, left few comments

Comment thread .env Outdated
Comment thread .env
Comment thread server.js Outdated
});
(async () => {
const token = await getToken();
await init({ serverURL: ACTUAL_SERVER_URL });

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual api is initialized in actual-client-provider.js

@latetedemelon latetedemelon requested a review from jhonderson June 10, 2025 07:58

@jhonderson jhonderson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few more comments, thanks!

Comment thread docker-compose.yml Outdated
Comment thread src/v1/actual-client-provider.js Outdated
Comment thread src/v1/actual-client-provider.js Outdated
@latetedemelon latetedemelon requested a review from jhonderson June 20, 2025 21:06
@jhonderson

Copy link
Copy Markdown
Owner

Hey @latetedemelon, I am ready to merge this. One last question, once existing users upgrade to this new version of actual-http-api, everything will continue working out of the box right? i.e no need for them to add new environment variables to their actual-server nor actual-http-api containers.

@jhonderson

Copy link
Copy Markdown
Owner

While testing locally, I found few issues and I was able to fix them except the last one:

Fatal start-up error: TypeError: setToken is not a function
    at initializeActualClient ...\actual-http-api\src\v1\actual-client-provider.js:45:3)
    at process.processTi cksAndRejections (node:internal/process/task_queues:105:5)
    at async getActualClient (...\actual-http-api\src\v1\actual-client-provider.js:67:5)
    at async ...\actual-http-api\server.js:9:3

Is the new setToken function already in the nodejs api?

@latetedemelon

Copy link
Copy Markdown
Author

Is the new setToken function already in the nodejs api?

My bad, it is in the actual api package

@latetedemelon latetedemelon requested a review from jhonderson July 20, 2025 00:20
@jhonderson

Copy link
Copy Markdown
Owner

Hello Rob 🙂, I pushed a commit to simplify this PR a bit — I focused only on the changes needed for the feature to work. That way it’s easier to review and reduces the chance of regressions.

I tested both approaches and they’re working for me. The only caveat with the header approach is that I had to set ACTUAL_TRUSTED_AUTH_PROXIES=0.0.0.0/0 in my actual server, since I wasn’t sure how to allow-list just my proxy.

Hope the updates look good to you! This is still your PR, so please let me know what do you think.

Thanks,
Jhon

cc @latetedemelon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants