GWP Minimal API and Razor Pages hosting samples#172
Open
alafleur-genetec wants to merge 6 commits intomainfrom
Open
GWP Minimal API and Razor Pages hosting samples#172alafleur-genetec wants to merge 6 commits intomainfrom
alafleur-genetec wants to merge 6 commits intomainfrom
Conversation
Two ASP.NET Core samples demonstrating server-side token proxy patterns for hosting the Genetec Web Player: - GwpMinimalApiSample: single Program.cs with static HTML page - GwpRazorPagesSample: Razor Pages with per-request CSP nonces and server-rendered configuration via JsonSerializer.Serialize Both samples include proper player lifecycle cleanup on failed start and cancellable startup with generation tracking.
The limitation is that the application itself has no user authentication, not just the token endpoint.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds two new ASP.NET Core hosting samples for Genetec Web Player (GWP): a Minimal API static-site sample and a Razor Pages sample that demonstrates per-request CSP nonces while proxying Media Gateway token requests server-side.
Changes:
- Introduces GwpMinimalApiSample (static
index.html+/api/configand/api/token/{cameraId}endpoints). - Introduces GwpRazorPagesSample (Razor page with server-rendered config + CSP nonce middleware +
/api/token/{cameraId}endpoint). - Adds sample documentation and local debug profiles (
launchSettings.json) for both.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Samples/Genetec Web Player/GwpRazorPagesSample/README.md | Documents the Razor Pages hosting approach, CSP nonce flow, and environment requirements. |
| Samples/Genetec Web Player/GwpRazorPagesSample/Properties/launchSettings.json | Adds local debug profile and ports for the Razor Pages sample. |
| Samples/Genetec Web Player/GwpRazorPagesSample/Program.cs | Implements CSP nonce middleware, Media Gateway HttpClient, Razor Pages hosting, and token proxy endpoint. |
| Samples/Genetec Web Player/GwpRazorPagesSample/Pages/Index.cshtml.cs | Supplies server-rendered config and CSP nonce to the Razor page. |
| Samples/Genetec Web Player/GwpRazorPagesSample/Pages/Index.cshtml | Provides the GWP UI and client logic (including dynamic gwp.js loading). |
| Samples/Genetec Web Player/GwpRazorPagesSample/GwpRazorPagesSample.csproj | Adds new net8.0 Razor Pages sample project. |
| Samples/Genetec Web Player/GwpRazorPagesSample/appsettings.json | Adds Media Gateway configuration for the Razor Pages sample. |
| Samples/Genetec Web Player/GwpMinimalApiSample/wwwroot/index.html | Provides the Minimal API sample UI and client logic, including CSP via meta tag. |
| Samples/Genetec Web Player/GwpMinimalApiSample/README.md | Documents the Minimal API hosting approach and environment requirements. |
| Samples/Genetec Web Player/GwpMinimalApiSample/Properties/launchSettings.json | Adds local debug profile and ports for the Minimal API sample. |
| Samples/Genetec Web Player/GwpMinimalApiSample/Program.cs | Implements Minimal API hosting, Media Gateway HttpClient, config endpoint, and token proxy endpoint. |
| Samples/Genetec Web Player/GwpMinimalApiSample/GwpMinimalApiSample.csproj | Adds new net8.0 Minimal API sample project. |
| Samples/Genetec Web Player/GwpMinimalApiSample/appsettings.json | Adds Media Gateway configuration for the Minimal API sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.