Skip to content

Commit 222a14f

Browse files
committed
update application configuration, enhance Dockerfile, and expand README documentation
1 parent 39264cc commit 222a14f

File tree

4 files changed

+73
-16
lines changed

4 files changed

+73
-16
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM alpine
22

33
LABEL authors="lwnmengjing"
44

5+
WORKDIR /app
6+
57
COPY ./application /app/application
68

79
ENTRYPOINT ["/app/application"]

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# nsqauthd
2-
mss-boot http service example
1+
# NSQ Auth Server
2+
`nsqauthd` is a lightweight HTTP service that provides authentication and authorization for NSQ clusters. By configuring the -auth-http-address parameter in nsqd, you can delegate authentication logic to nsqauthd, enabling fine-grained control over publish and subscribe operations. This project is built on mss-boot-http and developed in Go, offering high performance and extensibility.
3+
4+
## 📌 Project Overview
5+
`nsqauthd` aims to provide authorization support for NSQ's nsqd instances. By configuring the -auth-http-address parameter in nsqd, you can delegate authentication logic to nsqauthd, enabling fine-grained control over publish and subscribe operations. This project is built on mss-boot-http and developed in Go, offering high performance and extensibility.
6+
7+
## ⚙️ Features
8+
- **Authentication**: Supports client identity verification via HTTP requests.
9+
- **Authorization**: Defines client access permissions for specific topics and channels based on identity information.
10+
- **Flexible Configuration**: Allows parameter settings through configuration files or environment variables.
11+
- **High Performance**: Developed in Go, capable of handling high concurrency.
12+
- **Easy Integration**: Seamlessly integrates with NSQ clusters, simplifying authorization management.
13+
14+
## 🚀 Quick Start
15+
1. Clone the Project
16+
```shell
17+
git clone https://github.com/mss-boot-io/nsqauthd.git
18+
cd nsqauthd
19+
```
20+
2. Build the Project
21+
```shell
22+
make build
23+
```
24+
3. Start the Project
25+
```shell
26+
./nsqauthd --http-address=:4181
27+
```
28+
4. Configure NSQ
29+
```shell
30+
--auth-http-address=127.0.0.1:4181
31+
```
32+
33+
## 📄 Configuration Details
34+
35+
## 🔧 Build & Development
36+

README.zh-CN.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# NSQ 授权服务器
2+
`nsqauthd`是一个轻量级的 HTTP 服务,用于为 NSQ 集群提供身份验证和权限控制功能。通过配置 nsqd 的 -auth-http-address 参数,您可以将身份验证逻辑委托给 nsqauthd,从而实现对发布和订阅操作的精细控制。该项目基于 mss-boot-http 构建,采用 Go 语言开发,具备高性能和易于扩展的特点。
3+
4+
## 📌 项目简介
5+
`nsqauthd`旨在为 NSQ 的 nsqd 实例提供授权支持。通过配置 nsqd 的 -auth-http-address 参数,您可以将身份验证逻辑委托给 nsqauthd,从而实现对发布和订阅操作的精细控制。该项目基于 mss-boot-http 构建,采用 Go 语言开发,具备高性能和易于扩展的特点。
6+
7+
## ⚙️ 功能特性
8+
- **身份验证 / Authentication**:支持通过 HTTP 请求验证客户端身份。 / Supports client identity verification via HTTP requests.
9+
- **权限控制 / Authorization**:基于身份信息,定义客户端对特定主题和频道的访问权限。 / Defines client access permissions for specific topics and channels based on identity information.
10+
- **灵活配置 / Flexible Configuration**:支持通过配置文件或环境变量进行参数设置。 / Allows parameter settings through configuration files or environment variables.
11+
- **高性能 / High Performance**:采用 Go 语言开发,具备高并发处理能力。 / Developed in Go, capable of handling high concurrency.
12+
- **易于集成 / Easy Integration**:与 NSQ 集群无缝对接,简化授权管理。 / Seamlessly integrates with NSQ clusters, simplifying authorization management.
13+
14+
## 🚀 快速开始
15+
1. 克隆项目
16+
```shell
17+
git clone https://github.com/mss-boot-io/nsqauthd.git
18+
cd nsqauthd
19+
```
20+
2. 构建项目
21+
```shell
22+
make build
23+
```
24+
3. 启动服务
25+
```shell
26+
./nsqauthd --http-address=:4181
27+
```
28+
4. 配置 NSQ
29+
```shell
30+
--auth-http-address=127.0.0.1:4181
31+
```
32+
33+
## 📄 配置说明
34+
35+
## 🔧 构建与开发

config/application.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,5 @@ database:
1717
driver: sqlite
1818
source: 'nsqauthd.db'
1919
name: nsqauthd
20-
config:
21-
disableForeignKeyConstraintWhenMigrating: true
22-
casbinModel: |
23-
[request_definition]
24-
r = sub, tp, obj, act
25-
26-
[policy_definition]
27-
p = sub, tp, obj, act
28-
29-
[policy_effect]
30-
e = some(where (p.eft == allow))
31-
32-
[matchers]
33-
m = r.sub == p.sub && r.tp == p.tp && keyMatch(r.obj, p.obj) && regexMatch(r.act, p.act)
3420
timeout: 10s
3521
ttl: 3600

0 commit comments

Comments
 (0)