【原创】RabbitMQ 之 SASL Authentication(翻译)

简介:

SASL Authentication


RabbitMQ has pluggable support for various SASL authentication mechanisms. There are three such mechanisms built into the server: PLAIN, AMQPLAIN, and RABBIT-CR-DEMO, and one - EXTERNAL - available as a 
plugin. You can also implement your own authentication mechanism by implementing the rabbit_auth_mechanism behaviour in a plugin. See the plugin development guide for more information on general plugin development.
RabbitMQ 以插件的形式支持各种 SASL 鉴权机制。目前在 RabbitMQ 中存在 3 种内建的机制:PLAIN、AMQPLAIN、RABBIT-CR-DEMO 以及 一种 EXTERNAL 机制。你同样可以按照 rabbit_auth_mechanism 行为模式来实现自定义鉴权机制插件。具体可以参考 插件开发指南 获取更多通用插件开发的信息。

Built-in mechanisms

The three built-in mechanisms are:
3 中内置的机制如下:

PLAIN
SASL PLAIN authentication. This is enabled by default in the RabbitMQ server and clients, and is the default for most other clients.
SASL PLAIN 鉴权机制。默认被 RabbitMQ 服务器和客户端使能,并且也是大多数客户端的默认选择。

AMQPLAIN
Non-standard version of PLAIN as defined by the AMQP 0-8 specification. This is enabled by default in the RabbitMQ server, and is the default for QPid's Python client.
由 AMQP 0-8 标准文档定义的非标准版本 PLAIN 鉴权机制。该机制默认被 RabbitMQ 服务器使能,并且是 Python 客户端 QPid 的默认选择。

RABBIT-CR-DEMO
Non-standard mechanism which demonstrates challenge-response authentication. This mechanism has security equivalent to PLAIN, and is 
not   enabled by default in the RabbitMQ server.
采用 challenge-response 鉴权机制的非标准机制。该机制在安全性上等价于 PLAIN 机制,但默认不被 RabbitMQ 服务器使能。


Server configuration

The configuration variable auth_mechanisms in the rabbit application determines which of the installed mechanisms are offered to connecting clients. This variable should be a list of atoms corresponding to mechanism names, for example ['PLAIN', 'AMQPLAIN'] by default. The server-side list is not considered to be in any particular order. See the configuration file documentation.
在 rabbit 应用中的配置变量 auth_mechanisms 决定了哪些鉴权机制可以提供给连接上来的 client 使用。该配置变量由 erlang 中的 atom 列表构成,内容对应了鉴权机制的名字。例如默认为 ['PLAIN', 'AMQPLAIN'] 。位于服务器端的这个列表中的内容无优先级顺序可言。具体参考 配置文件文档。

Client configuration

Java

The Java client does not use the javax.security.sasl package by default since this can be unpredictable on non-Oracle JDKs and is missing entirely on Android. There is a RabbitMQ-specific SASL implementation, configured by the SaslConfig interface. A class DefaultSaslConfig is provided to make SASL configuration more convenient in the common case. A class JDKSaslConfig is provided to act as a bridge tojavax.security.sasl.

See ConnectionFactory.getSaslConfig() and ConnectionFactory.setSaslConfig(SaslConfig)

Erlang

The Erlang client provides its own SASL mechanism implementations in the amqp_auth_mechanisms module. The #amqp_params{} record can be provided with a list of authentication functions in preference order for network connections.
Erlang 客户端在模块 amqp_auth_mechanisms 中给出了其自身 SASL 鉴权机制实现。记录 #amqp_params{} 可被用于一系列就安全函数中,且记录中内容的顺寻决定了网络连接使用的鉴权机制的顺序。

.Net

The .Net client provides its own SASL mechanism implementations based on the AuthMechanism andAuthMechanismFactory interfaces. The ConnectionFactory.AuthMechanisms property is a list of authentication mechanism factories in preference order.



相关实践学习
快速体验阿里云云消息队列RocketMQ版
本实验将带您快速体验使用云消息队列RocketMQ版Serverless系列实例进行获取接入点、创建Topic、创建订阅组、收发消息、查看消息轨迹和仪表盘。
消息队列 MNS 入门课程
1、消息队列MNS简介 本节课介绍消息队列的MNS的基础概念 2、消息队列MNS特性 本节课介绍消息队列的MNS的主要特性 3、MNS的最佳实践及场景应用 本节课介绍消息队列的MNS的最佳实践及场景应用案例 4、手把手系列:消息队列MNS实操讲 本节课介绍消息队列的MNS的实际操作演示 5、动手实验:基于MNS,0基础轻松构建 Web Client 本节课带您一起基于MNS,0基础轻松构建 Web Client
目录
相关文章
|
Kubernetes 负载均衡 网络协议
k8s学习-Service(概念、模板、创建、外部代理、删除等)
k8s学习-Service(概念、模板、创建、外部代理、删除等)
896 0
|
6月前
|
存储 搜索推荐 物联网
RFID在汽车生产工艺环节的深度应用与价值体现
RFID技术凭借非接触识别、抗干扰强等优势,深度融入汽车制造四大工艺,实现生产全流程数字化追溯与精细化管理,助力车企提升效率、保障质量、降低成本,推动智能制造转型。
|
Prometheus Kubernetes 监控
prometheus学习笔记之集群内服务发现环境准备
本文介绍了在Kubernetes集群中部署Prometheus监控系统的详细步骤。首先创建用于监控的命名空间,并配置Docker以顺利下载镜像。接着,通过DaemonSet方式在集群中部署Node Exporter,确保每个节点上的指标都能被收集。然后,安装并配置NFS存储类别,以便为Prometheus提供持久化存储。最后,详细展示了如何在Kubernetes中部署Prometheus服务器,包括创建相关的配置文件、部署服务、设置角色权限以及暴露服务等
|
11月前
|
存储 编解码 Prometheus
大模型推理加速实战:vLLM 部署 Llama3 的量化与批处理优化指南
本文详解如何通过量化与批处理优化,在vLLM中高效部署Llama3大模型。涵盖内存管理、推理加速及混合策略,提升吞吐量并降低延迟,适用于大规模语言模型部署实践。
2482 10
|
SQL 前端开发 关系型数据库
现在啥软件都有开源,BI 呢?
一直以来国内的同学想找一个方便好用的开源 BI 都不是一件易事,国外的页面不好修改,国内的基本都收费,现在有了润乾开源 BI 了,同学们可以去试一下了,润乾是做报表起家,是报表行业的领头羊,报表功能好,BI 功能也不差,还天然弥补了 BI 缺少报表能力的短板
|
机器学习/深度学习 算法 开发工具
Python Web开发工具
Python Web开发工具
406 4
|
算法 定位技术 图形学
unity2d实现一个全方位的无限随机地图
unity2d实现一个全方位的无限随机地图
1235 0
|
消息中间件 存储 负载均衡
一篇文章讲透彻了AMQP协议
一篇文章讲透彻了AMQP协议
9498 0
一篇文章讲透彻了AMQP协议