rabbitmq / rabbitmq-auth-backend-http

HTTP-based authorisation and authentication for RabbitMQ
Other
199 stars 72 forks source link

Django Rest Framework + auth backend+ RabbitMQ #50

Closed folt closed 7 years ago

folt commented 7 years ago

I build my application using the django rest framework. How can I customize the data format that RabbitMQ expects? The fact is that the django rest framework defines json and the Content-Type: application / json header. RabbitMQ does not understand the body of the answer. What do i do?

michaelklishin commented 7 years ago

Thank you for your time.

Team RabbitMQ uses GitHub issues for specific actionable items engineers can work on. This assumes we have a certain amount of information to work with. Questions, investigations, root cause analysis, discussions for potential features are all considered to be mailing list material by our team. When/if we have enough details and evidence we'd be happy to file a new issue.

Please post this to rabbitmq-users. Thank you.

michaelklishin commented 7 years ago

You can't customise what RabbitMQ expects. It is definitely possible to respond with a content type and payload in any other format. Heck, we've had a Django-based example for years — have you seen it?

folt commented 7 years ago

https://github.com/rabbitmq/rabbitmq-auth-backend-http/blob/master/src/rabbit_auth_backend_http.erl#L141

As you can see here is the process of parsing the response string. https://github.com/rabbitmq/rabbitmq-auth-backend-http/blob/master/src/rabbit_auth_backend_http.erl#L159

Django Rest Framework returns json It would be more logical in the case of the header of the response "Content-Type: application / json header" to expect not a string but json

Such as {"Permission": "allow administrator"}

michaelklishin commented 7 years ago

@folt or you could just add a regular Django view since you are using Django to begin with.

michaelklishin commented 7 years ago

I've filed #51 but it's not a priority for our team.

folt commented 7 years ago

Thank you

folt commented 7 years ago

Jwt support is planned ?