Axon 参考指南
  • 介绍
  • 架构概览
    • DDD & CQRS 概念
    • 事件溯源
    • 事件驱动的微服务
  • Axon Server
  • 发行说明
    • Axon Framework
      • Major Releases
      • Minor Releases
    • Axon Server
      • Major Releases
      • Minor Releases Standard Edition
      • Minor Releases Enterprise Edition
    • Axon Framework Extensions
      • AMQP
        • Major Releases
      • CDI
        • Major Releases
      • JGroups
        • Major Releases
      • Kafka
        • Major Releases
        • Minor Releases
      • Kotlin
        • Experimental Releases
      • Mongo
        • Major Releases
        • Minor Releases
      • Reactor
        • Major Releases
        • Minor Releases
      • Spring Cloud
        • Major Releases
        • Minor Releases
      • Tracing
        • Major Releases
        • Minor Releases
  • Getting Started
    • 快速开始
  • Axon Framework
    • 介绍
    • 消息传递概念
      • 消息剖析
      • 消息关联
      • 消息拦截
      • 支持带注解的处理程序
      • 异常处理
      • 工作单元
    • 命令
      • 建模
        • 聚合
        • 多实体聚合
        • 聚合状态存储
        • 从另一个聚合创建聚合
        • 聚合多态性
        • 解决冲突
      • 命令调度器
      • 命令处理程序
      • 基础设施
      • 配置
    • 事件
      • 事件调度器
      • 事件处理程序
      • 事件处理器
        • 订阅事件处理器
        • 流式事件处理器
      • 事件总线和事件存储
      • 事件版本控制
    • 查询
      • 查询处理
      • 查询调度器
      • 查询处理程序
      • 实现
      • 配置
    • 长时处理过程(Sagas)
      • 实现
      • 关联
      • 基础设施
    • Deadlines
      • Deadline Managers
      • Event Schedulers
    • 测试
      • 命令 / 事件
      • 长时处理过程(Sagas)
    • 序列化
    • 调整
      • 事件快照
      • 事件处理
      • 命令处理
    • 监控和指标
    • Spring Boot 集成
    • 模块
  • Axon Server
    • 介绍
    • 安装
      • 本地安装
        • Axon Server SE
        • Axon Server EE
      • Docker / K8s
        • Axon Server SE
        • Axon Server EE
    • 管理
      • 配置
        • System Properties
        • Command Line Interface
        • REST API
        • GRPC API
      • Monitoring
        • Actuator Endpoints
        • gRPC Metrics
        • Heartbeat Monitoring
      • Clusters
      • Replication Groups
      • Multi-Context
      • Tagging
      • Backup and Messaging-only Nodes
      • Backups
      • Recovery
      • Plugins
      • Error Codes
    • 安全
      • SSL
      • 访问控制
      • 访问控制 - 标准版
      • 访问控制 - 企业版
      • 访问控制 - 客户端应用程序
      • 访问控制 - 命令行
      • 访问控制 - REST API
      • 访问控制 - LDAP
      • 访问控制 - OAuth 2.0
    • 性能
      • 事件段
      • 流量控制
    • 迁移
      • Standard to Enterprise Edition
      • Non-Axon Server to Axon Server
  • Extensions
    • Spring AMQP
    • JGroups
    • Kafka
    • Kotlin
    • Mongo
    • Reactor
      • Reactor Gateways
    • Spring Cloud
    • Tracing
  • Appendices
    • A. RDBMS Tuning
    • B. Message Handler Tuning
      • 参数解析器
      • 处理程序增强
    • C. 元数据注解
    • D. 标识符生成
    • E. Axon Server Query Language
由 GitBook 提供支持
在本页
  • Tokens in Axon Server EE
  • User Accounts in Axon Server EE
  • Assigning roles
  • Accounts without a password
  1. Axon Server
  2. 安全

访问控制 - 企业版

Access Control - Enterprise Edition

When you set the "axoniq.axonserver.accesscontrol.enabled" property to "true", Axon Server will require a token or user account for access to its APIs.

Tokens in Axon Server EE

In Axon Server EE, there are three types of tokens that can be defined:

Type
Property
Purpose

Internal

axoniq.axonserver.accesscontrol.internal-token

Define a token for nodes in the cluster to authenticate each other.

System

axoniq.axonserver.accesscontrol.systemtokenfile

Define a file for a token with administrative rights. Default value is "./security/.token".

Application

(Through the UI or CLI)

Applications are registered using the UI or CLI and assigned roles. See below for more details.

Axon Server will generate the system token for the CLI if none is found, and the CLI (if started in the Axon Server working directory) will know the default location.

Axon Framework based applications should only need the non-admin token. If you whish to use tools to access the REST API directly, you must add an HTTP header named "AxonIQ-Access-Token", as in the following example:

$ curl -H 'AxonIQ-Access-Token: system-token' -s http://localhost:8024/v1/public/context | jq '.[] | select(.context=="default")'
{
  "context": "default",
  "replicationGroup": "default",
  "metaData": {
    "event.index-format": "JUMP_SKIP_INDEX",
    "snapshot.index-format": "JUMP_SKIP_INDEX"
  },
  "changePending": false,
  "pendingSince": 0,
  "leader": "e32c48ab5047",
  "roles": [
    {
      "node": "e32c48ab5047",
      "role": "PRIMARY"
    }
  ]
}

User Accounts in Axon Server EE

When you create a user account, you assign roles, which will determine the user's access rights. The user accounts are generally only used for the UI, although they are also valid for access to the REST API, using Basic Authentication. In contrast to SE, where you could only choose between "normal" and "admin" accounts, you can now assign several roles from a long list, and each per context using "role@context". You can also assign a role for context "*", which means that the user gets that role for any context existing now, or created in the future.

Assigning roles

In Axon Server EE we can grant specific roles to applications and users that will allow specific operations. Apart from just assigning the roles, you must also indicate for which context the role is granted, so that an application/user that has rights on only one context is not able to access data from other contexts.‌

A summary of the various roles is depicted below

Role Name
Description

ADMIN

Administer the cluster, manage contexts, users and applications

VIEW_CONFIGURATION

View cluster configuration with contexts, users, applications, replication groups, and plugins (only for _admin context)

CONTEXT_ADMIN

Manage event processors within a specific context

DISPATCH_COMMANDS

Dispatch commands

DISPATCH_QUERY

Dispatch queries and subscription queries

MONITOR

View context information

PUBLISH_EVENTS

Publish events and snapshots

READ_EVENTS

Read events and snapshots from the event store

SUBSCRIBE_COMMAND_HANDLER

Register command handlers

SUBSCRIBE_QUERY_HANDLER

Register query handlers

USE_CONTEXT

Perform all operations on a context

READ (Deprecated)

Read events and perform queries

WRITE (Deprecated)

Publish events and perform commands

Accounts without a password

Using the CLI it is possible to create an account without a password. This does not mean that the account requires no password to login, but rather that the account is only used to assign roles to, while the password needs to be checked using an external tool. To create such an account, use the "--no-password" option:

$ java -jar axonserver-cli.jar register-user -u username -r roles --no-password

See the section on OAuth2 integration for an example.

上一页访问控制 - 标准版下一页访问控制 - 客户端应用程序

最后更新于2年前