Skip to content
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

NatsWebSocketOpts improvements #610

Closed
mtmk opened this issue Aug 22, 2024 · 2 comments · Fixed by #623
Closed

NatsWebSocketOpts improvements #610

mtmk opened this issue Aug 22, 2024 · 2 comments · Fixed by #623
Assignees
Milestone

Comments

@mtmk
Copy link
Collaborator

mtmk commented Aug 22, 2024

A couple more ideas, which could be done in a follow-up before releasing:

  1. Do we want to nest this option under NatsWebSocketOpts instead of setting it directly in NatsOpts? This could make it easier to offer a shortcuts for popular options such as adding headers:
public sealed record NatsWebSocketOpts
{
    public Dictionary<string, StringValues>? RequestHeaders { get; init; }

    public Func<Uri, ClientWebSocketOptions, CancellationToken, ValueTask>? ConfigureWebSocketOptions { get; init; }
}
  1. We probably want to invoke NatsTlsOpts.AuthenticateAsClientOptionsAsync and copy both ClientCertificates and RemoteCertificateValidationCallback to ClientWebSocketOptions prior to passing it to the callback

Originally posted by @caleblloyd in #605 (comment)

@Ivandemidov00
Copy link
Contributor

Hi guys.
I can make these changes. Do I understand correctly that we need to wait first #605 ?

@mtmk
Copy link
Collaborator Author

mtmk commented Aug 24, 2024

Hi guys. I can make these changes. Do I understand correctly that we need to wait first #605 ?

thanks @Ivandemidov00 that would be great 👍💯 please tag @caleblloyd in your PR so he can review when he has time ;)

edit: btw #605 is merged in case you missed it.

@mtmk mtmk added this to the 2.4.0 milestone Aug 24, 2024
Ivandemidov00 added a commit to Ivandemidov00/nats.net.v2 that referenced this issue Aug 29, 2024
* Separate model NatsWebSocketOpts
* Сalled NatsTlsOpts.AuthenticateAsClientAsync parameters before passing it to the ConfigureWebSocketOpts
* RequestHeaders overwrite the header specified in ConfigureWebSocketOpts
Ivandemidov00 added a commit to Ivandemidov00/nats.net.v2 that referenced this issue Aug 30, 2024
Ivandemidov00 added a commit to Ivandemidov00/nats.net.v2 that referenced this issue Sep 8, 2024
* Fence added, an occurs exceptions when add headers to blazor
caleblloyd added a commit to Ivandemidov00/nats.net.v2 that referenced this issue Sep 9, 2024
mtmk added a commit that referenced this issue Sep 9, 2024
* NatsWebSocketOpts improvements (#610)

* Separate model NatsWebSocketOpts
* Сalled NatsTlsOpts.AuthenticateAsClientAsync parameters before passing it to the ConfigureWebSocketOpts
* RequestHeaders overwrite the header specified in ConfigureWebSocketOpts

* NatsWebSocketOpts improvements (#610)

* Added test

* Build fixes

* Build fixes

* Build fixes

* dotnet format

* #623 reccomendations

Signed-off-by: Caleb Lloyd <[email protected]>

* NatsWebSocketOpts improvements (#610)

* Fence added, an occurs exceptions when add headers to blazor

* Revert "NatsWebSocketOpts improvements (#610)"

This reverts commit e6b9d1c.

* WebSocketSecure tests

Signed-off-by: Caleb Lloyd <[email protected]>

* fix format

Signed-off-by: Caleb Lloyd <[email protected]>

* simplify WebSocketOptionsTest

Signed-off-by: Caleb Lloyd <[email protected]>

---------

Signed-off-by: Caleb Lloyd <[email protected]>
Co-authored-by: Ziya Suzen <[email protected]>
Co-authored-by: Caleb Lloyd <[email protected]>
@mtmk mtmk closed this as completed in #623 Sep 9, 2024
divyeshio pushed a commit to divyeshio/nats.net that referenced this issue Sep 13, 2024
* NatsWebSocketOpts improvements (nats-io#610)

* Separate model NatsWebSocketOpts
* Сalled NatsTlsOpts.AuthenticateAsClientAsync parameters before passing it to the ConfigureWebSocketOpts
* RequestHeaders overwrite the header specified in ConfigureWebSocketOpts

* NatsWebSocketOpts improvements (nats-io#610)

* Added test

* Build fixes

* Build fixes

* Build fixes

* dotnet format

* nats-io#623 reccomendations

Signed-off-by: Caleb Lloyd <[email protected]>

* NatsWebSocketOpts improvements (nats-io#610)

* Fence added, an occurs exceptions when add headers to blazor

* Revert "NatsWebSocketOpts improvements (nats-io#610)"

This reverts commit e6b9d1c.

* WebSocketSecure tests

Signed-off-by: Caleb Lloyd <[email protected]>

* fix format

Signed-off-by: Caleb Lloyd <[email protected]>

* simplify WebSocketOptionsTest

Signed-off-by: Caleb Lloyd <[email protected]>

---------

Signed-off-by: Caleb Lloyd <[email protected]>
Co-authored-by: Ziya Suzen <[email protected]>
Co-authored-by: Caleb Lloyd <[email protected]>
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 a pull request may close this issue.

2 participants