Skip to content

Fix/devtools fixex#1418

Merged
ndorin merged 6 commits into
mainfrom
fix/devtools-fixex
May 11, 2026
Merged

Fix/devtools fixex#1418
ndorin merged 6 commits into
mainfrom
fix/devtools-fixex

Conversation

@ndorin
Copy link
Copy Markdown
Contributor

@ndorin ndorin commented May 11, 2026

This pull request introduces two main changes: it updates the login response structure to include more detailed user information, and it simplifies the process of loading PKCS#12 certificates for the debug WebSocket sink to improve compatibility and reliability.

Closes PepperDash/essentials-devtools#29 as verified by @jonnyarndt

Login Response Enhancements:

  • The login POST handler now returns a detailed LoginResponse object, including fields such as UserName, Password, Access, State, Groups, ADConnect, and Valid, instead of just a token string. This provides clients with more comprehensive authentication data.
  • A new internal LoginResponse class is introduced to encapsulate all relevant authentication response fields.

Certificate Loading Improvements:

  • The LoadCertFromBouncyCastle method in DebugWebsocketSink has been refactored to re-encode the PKCS#12 archive using BouncyCastle and pass the raw bytes directly to X509Certificate2. This removes the need for RSACryptoServiceProvider and avoids issues with the EphemeralKeySet flag, improving compatibility with the Crestron/Mono runtime. [1] [2]
  • Unused or unnecessary using directives related to cryptography have been removed for code cleanliness.

Copilot AI review requested due to automatic review settings May 11, 2026 15:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Essentials web API login response payload and refactors debug WebSocket TLS certificate loading to improve PKCS#12 compatibility on the Crestron/Mono runtime.

Changes:

  • Updated /login POST handler to return a structured LoginResponse object instead of the prior { Token = ... } wrapper.
  • Introduced an internal LoginResponse DTO to control which authentication fields are serialized.
  • Simplified DebugWebsocketSink PKCS#12 loading by re-encoding the archive with BouncyCastle and importing via X509Certificate2 from raw bytes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/PepperDash.Essentials.Core/Web/RequestHandlers/LoginRequestHandler.cs Changes the login response contract and adds a LoginResponse DTO.
src/PepperDash.Core/Logging/DebugWebsocketSink.cs Refactors PKCS#12 import path for the debug WSS certificate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PepperDash.Essentials.Core/Web/RequestHandlers/LoginRequestHandler.cs Outdated
Comment thread src/PepperDash.Essentials.Core/Web/RequestHandlers/LoginRequestHandler.cs Outdated
Comment thread src/PepperDash.Essentials.Core/Web/RequestHandlers/LoginRequestHandler.cs Outdated
Comment thread src/PepperDash.Core/Logging/DebugWebsocketSink.cs
@ndorin ndorin requested a review from andrew-welker May 11, 2026 16:04
@ndorin ndorin merged commit beb77ec into main May 11, 2026
2 checks passed
@ndorin ndorin deleted the fix/devtools-fixex branch May 11, 2026 17:00
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.

[BUG] [Start Debug Session] Exception: WebSocket Failed to start Operation is not supported on this platform

3 participants