-
Notifications
You must be signed in to change notification settings - Fork 91
feat(runtime-auth): centralized token manager (editor half — fixes upload after token expiry) #903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thiagoralves
merged 4 commits into
development
from
feat/centralized-runtime-token-manager
Jul 2, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c6d455f
feat(runtime-auth): make the editor main process the single token aut…
thiagoralves 43fdd2c
refactor(runtime-auth): drop the now-inert jwtToken from the editor I…
thiagoralves b38a5a3
chore(arch): map middleware/shared/runtime-auth to the utils layer
thiagoralves ae8b53e
Merge remote-tracking branch 'origin/development' into feat/centraliz…
thiagoralves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: Autonomy-Logic/openplc-editor
Length of output: 31981
🏁 Script executed:
grep -n -A 5 -B 5 "deviceContext" src/backend/editor/compiler/editor-compiler-platform-port.ts src/backend/editor/compiler/compiler-module.tsRepository: Autonomy-Logic/openplc-editor
Length of output: 12890
🏁 Script executed:
Repository: Autonomy-Logic/openplc-editor
Length of output: 2393
🏁 Script executed:
grep -n -A 10 "assertEditorHttpsContext" src/middleware/shared/ports/compiler-platform-port.ts src/backend/editor/compiler/editor-compiler-platform-port.tsRepository: Autonomy-Logic/openplc-editor
Length of output: 4975
🏁 Script executed:
grep -n -A 20 "export.*PlatformDeviceContext" src/middleware/shared/ports/compiler-platform-port.tsRepository: Autonomy-Logic/openplc-editor
Length of output: 1023
Remove the
runtimeJwtTokenrequirement to enable token-free runtime uploads.The
deviceContextconstruction at lines 2675-2677 still gates the existence of the context onruntimeJwtToken. Since themakeRuntimeApiUploadbridge implementation in the main process handles token refresh internally and no longer accepts a JWT argument, the upload pipeline is unnecessarily skipped when onlyruntimeIpAddressis available.Update the guard to check
runtimeIpAddressalone (or treatjwtas optional) so the context is passed to the pipeline, allowing the bridge to manage authentication transparently.Current Code
🧰 Tools
🪛 ast-grep (0.44.0)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🤖 Prompt for AI Agents