mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5169] [CLOSED] feat: add etcd-based multi-tenant token management with traffic reporting #5155
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5155
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5169
Author: @u-wlkjyy
Created: 2/8/2026
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (5)
09baf7ffeat: add etcd-based multi-tenant token management with traffic reportingc06a9dedocs: add etcd multi-tenant authentication section to READMEfeab6d5test: add unit tests for etcd config and traffic reporterfceb0e0fix: resolve lint errors for CI58f3610fix: format files with gci for proper alignment📊 Changes
22 files changed (+2128 additions, -100 deletions)
View changed files
📝
README.md(+64 -0)➕
descript.md(+77 -0)➕
doc/build.md(+184 -0)➕
doc/etcd_multi_tenant.md(+252 -0)➕
frpc(+0 -0)➕
frpc_test.toml(+12 -0)➕
frps(+0 -0)➕
frps_test.toml(+7 -0)📝
go.mod(+27 -13)📝
go.sum(+93 -30)📝
pkg/auth/auth.go(+12 -0)➕
pkg/auth/etcd/store.go(+287 -0)➕
pkg/auth/etcd/verifier.go(+119 -0)➕
pkg/config/v1/etcd.go(+75 -0)➕
pkg/config/v1/etcd_test.go(+127 -0)📝
pkg/config/v1/server.go(+3 -0)➕
pkg/traffic/conn.go(+99 -0)➕
pkg/traffic/reporter.go(+222 -0)➕
pkg/traffic/reporter_test.go(+205 -0)📝
server/control.go(+134 -27)...and 2 more files
📄 Description
Summary
This PR adds etcd-based multi-tenant token management for frps, enabling dynamic token configuration with per-token settings.
Features
allowPorts)maxPortsPerClient)Configuration
Server (frps.toml)
Token in etcd
Client (frpc.toml)
No changes required - uses standard token authentication.
Traffic Report Format
POST to configured URL:
Backward Compatibility
[etcd]is not configured, frps works as before with single token authenticationNew Files
pkg/config/v1/etcd.go- EtcdConfig and TokenConfig structurespkg/auth/etcd/store.go- TokenStore with etcd client, caching, and watchpkg/auth/etcd/verifier.go- MultiTokenVerifier for authenticationpkg/traffic/reporter.go- TrafficManager and TokenTrafficCounterpkg/traffic/conn.go- CountedConn wrapper for traffic countingdoc/etcd_multi_tenant.md- DocumentationTests
pkg/config/v1/etcd_test.gopkg/traffic/reporter_test.go🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.