argo-events icon indicating copy to clipboard operation
argo-events copied to clipboard

Allow authentication with username and password in mqtt eventsource

Open felix-dpg opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. I was exploring the docs of mqtt eventsource, and at least in the docs appear that is not possible to specify auth in this eventsource. amqp event source has this options, but not mqtt.

Describe the solution you'd like Add mqtt eventsource authentication like in amqp


Message from the maintainers:

felix-dpg avatar Apr 20 '22 11:04 felix-dpg

Well, is not implemented looking at the code of the event source.

https://github.com/argoproj/argo-events/blob/f43468f45124786c6cc9e82a65565a096ed79724/eventsources/sources/mqtt/start.go#L107

Only implemented for TLS :-(

https://github.com/argoproj/argo-events/blob/f43468f45124786c6cc9e82a65565a096ed79724/eventsources/sources/mqtt/start.go#L108-L114

Is not hard at all, something like this could add the feature

	if mqttEventSource.username != nil {
		opts.SetUsername(mqttEventSource.username)
		if mqttEventSource.password != nil {
		 opts.SetPassword(mqttEventSource.password)
		}
	}

felix-dpg avatar Apr 20 '22 12:04 felix-dpg

@felix-dpg - would you like to submit a PR?

whynowy avatar Apr 21 '22 07:04 whynowy

@whynowy thanks, but dont have enought time to submit a PR. Open to whatever that could make this.

felix-dpg avatar Apr 21 '22 07:04 felix-dpg

This is done https://github.com/argoproj/argo-events/pull/2324/files. Can we close the issue?

premadk avatar Dec 02 '22 19:12 premadk

Thanks @premadk !

Closed by https://github.com/argoproj/argo-events/pull/2324.

whynowy avatar Dec 02 '22 23:12 whynowy