Skip to content

fix: Recheck accepted HTTP bearer tokens after 60 seconds instead of 5 minutes - #778

Open
cstns wants to merge 1 commit into
mainfrom
8705-shorter-http-token-cache
Open

cstns wants to merge 1 commit into
mainfrom
8705-shorter-http-token-cache

Conversation

@cstns

@cstns cstns commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #777

Part of FlowFuse/flowfuse#8705. The FlowFuse auth plugin's HTTP middleware caches bearer tokens the platform accepted and skipped rechecking them for 300 seconds, so a deleted or expired token kept working against the remote instance's protected endpoints for up to 5 minutes. As decided on the parent issue, the window is now 60 seconds, as a named constant instead of the inline 300, matching the same change in FlowFuse/nr-launcher.

There were no tests for the plugin's middleware, so this adds one: it runs requests through the middleware against a fake platform endpoint counting token checks, and a token is trusted at 59 seconds and checked again at 61, failing before the change. It calls the middleware directly rather than through an Express app since the agent doesn't install Express itself. The rest of the lib suite passes, apart from the two MQTT Comms tests that fail the same way on main on my machine.

…utes

Accepted bearer tokens were trusted for 300 seconds before the platform was asked again, so a deleted or expired token kept working for up to 5 minutes. The window is now 60 seconds.
@cstns cstns self-assigned this Oct 16, 2026
@cstns
cstns requested a review from hardillb October 16, 2026 10:35

@hardillb hardillb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix the topic lint please

@cstns cstns changed the title Recheck accepted HTTP bearer tokens after 60 seconds instead of 5 minutes fix: Recheck accepted HTTP bearer tokens after 60 seconds instead of 5 minutes Oct 16, 2026
@cstns

cstns commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Done! Didn't realize this repo was using release please

@cstns
cstns requested a review from hardillb October 16, 2026 10:58
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.

A deleted HTTP token keeps working on a remote instance for up to 5 minutes

2 participants