streadway / amqp

Go client for AMQP 0.9.1
http://godoc.org/github.com/streadway/amqp
BSD 2-Clause "Simplified" License
4.88k stars 621 forks source link

ExternalAuth type and interface definition #355

Closed damianjaniszewski closed 5 years ago

damianjaniszewski commented 6 years ago

This is more like a feature request than issue. I would like to suggest to define ExternalAuth type similar to already defined PlainAuth. When using TLS and client certificate it is required to return authentication mechanism EXTERNAL so the username will be taken from certificate. Defining the type and providing example in godoc.org reference will help users who try to authenticate with client certificate.

It could be something similar to:

type ExternalAuth struct {
}

func (auth *ExternalAuth) Mechanism() string {
  return "EXTERNAL"
}

func (auth *ExternalAuth) Response() string {
  return ""
}
michaelklishin commented 5 years ago

I believe this was addressed in master.

treksler commented 5 years ago

does not appear to be implemented in https://github.com/streadway/amqp/blob/master/auth.go

and does not appear to be documented in https://godoc.org/github.com/streadway/amqp

lukebakken commented 5 years ago

@treksler this project's maintainers (who do so on a volunteer basis) would happily review a pull request that implements this feature. Even better if the PR includes tests.

treksler commented 5 years ago

see #121

lukebakken commented 5 years ago

@treksler thanks for pointing that out. That PR is stale as the original submitter did not make the requested changes in the discussion. You could take the work in that branch and submit your own pull request that implements what was requested in these comments: