ChilliCream / ChilliCream/graphql-platform
Strawberry Shake WebSocket configuration doesn't have Options field to configure authorization header
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Is there an existing issue for this?
- I have searched the existing issues
Product
Strawberry Shake
Describe the bug
In the Authentication section of the documentation si described that, in order to configure the authentication header for WebSockets, I can use the SetRequestHeader() method under Options
services
.AddConferenceClient()
.ConfigureWebSocketClient(client =>
{
client.Uri = new Uri("ws://localhost:" + port + "/graphql");
client.Socket.Options.SetRequestHeader("Authorization", "Bearer ...");
});
But under client.Socket there is no Options field.
Steps to reproduce
- Create a sample .NET 7 Console project.
- Import the
StrawberryShake.Serverand theMicrosoft.Extensions.HostingNuGet packages. - Follow the get started guide until
ConferenceClientis created - Try to setup the headers in
Program.cs
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) => {
services.AddConferenceClient()
.ConfigureWebSocketClient(client => {
client.Socket.Options.SetRequestHeader("Authorization", "Bearer ...");
});
})
.Build();
host.Run();
Relevant log output
No response
Additional Context?
No response
Version
13.0.5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Strawberry Shake Authentication documentation and the ConfigureWebSocketClient example in Program.cs. Inspect the client.Socket API for the missing Options member and compare it with the documented SetRequestHeader() usage. Done means the documented authorization-header configuration works for WebSocket clients in version 13.0.5.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100