You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement OAuth-based authentication with NodeSource Accounts API, including token storage, validation, and the auth manager orchestrator.
Tasks
Task 5: Implement token storage module — Create token-storage.ts to read/write credentials to ~/.agents/.nodesource-auth.json. Implement secure file permissions (0600). Handle missing file, invalid JSON, and expired tokens. Note: on Windows, chmod 0600 has minimal effect; credential protection relies on directory ACLs.
Depends on: Task 4
Files: packages/core/src/auth/token-storage.ts
Testing: Unit tests for save/load credentials. Test file permissions. Test handling of corrupted file.
Task 6: Implement token validator module — Create token-validator.ts to validate service tokens with Accounts API at /accounts/org/access-token. Handle network errors, 401/403 responses, and timeouts. Return validation result with permissions list.
Depends on: Task 5
Files: packages/core/src/auth/token-validator.ts
Testing: Unit tests with mocked HTTP responses. Test success, 401, 500, and timeout scenarios.
Task 7: Implement OAuth callback server — Create oauth-server.ts to start local HTTP server on port 8765 (with fallback to 8766-8770). Listen for OAuth callback with token and orgId. Implement 5-minute timeout. Return received credentials.
Depends on: Task 4
Files: packages/core/src/auth/oauth-server.ts
Testing: Unit tests for server startup, callback handling, timeout, and port conflicts.
Task 8: Implement auth manager orchestrator — Create auth-manager.ts with ensureAuthenticated() function. Check for existing valid credentials first. If missing/expired, initiate OAuth flow (open browser, start callback server). Validate token with Accounts API. Store credentials. Return Credentials object.
nodesource/nsolid-console-ng#4596 - N|Solid API - Implement comprehensive token validation middleware [merged]
nodesource/nsentinel-vscode-extension#18 - feat: implement OAuth authentication flow with settings and logout co… [merged]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Jun 9, 2026
🔗 Related PRs
nodesource/nsolid-console-ng#4596 - N|Solid API - Implement comprehensive token validation middleware [merged]
nodesource/nsentinel-vscode-extension#18 - feat: implement OAuth authentication flow with settings and logout co… [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!