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

Add Connection() method to the Client interface #21

Merged
merged 1 commit into from
Feb 20, 2020
Merged

Add Connection() method to the Client interface #21

merged 1 commit into from
Feb 20, 2020

Conversation

matthias-relabs
Copy link
Contributor

Connection() returns raw net.Conn network connection. This makes it possible for plugins to access TLS credentials of a Client (by casting to a *tls.Conn), or to associate clients with the a connection from an OnAccept callback (which does not have a Client yet).

The use-case is like this: I'm using mutual tls (tls.RequireAndVerifyClientCert). Additionally I've implemented a plugin which uses information from the client certificate to chose a client policy (i.e. the topics a client is permitted to subscribe and/or publish to).

Connection() returns raw net.Conn network connection.
This makes it possible for plugins to access TLS
credentials of a Client (by casting to a *tls.Conn), or
to associate clients with the a connection from an OnAccept
callback (which does not have a Client yet).
@codecov-io
Copy link

Codecov Report

Merging #21 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   70.07%   70.06%   -0.02%     
==========================================
  Files          26       26              
  Lines        2697     2699       +2     
==========================================
+ Hits         1890     1891       +1     
- Misses        642      644       +2     
+ Partials      165      164       -1
Impacted Files Coverage Δ
client.go 82.26% <0%> (+0.07%) ⬆️
server.go 48.23% <0%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60091b5...6edbd6e. Read the comment docs.

@DrmagicE DrmagicE merged commit d25375e into DrmagicE:master Feb 20, 2020
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.

3 participants