mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #3773] [MERGED] Strict configuration parsing #4828
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#4828
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/3773
Author: @akx
Created: 11/15/2023
Status: ✅ Merged
Merged: 11/16/2023
Merged by: @fatedier
Base:
dev← Head:strict-config-parsing📝 Commits (2)
f269f83Test configuration loading more precisely41ef9b7Add strict configuration parsing📊 Changes
11 files changed (+119 additions, -47 deletions)
View changed files
📝
client/admin_api.go(+1 -1)📝
client/service.go(+11 -6)📝
cmd/frpc/sub/admin.go(+1 -1)📝
cmd/frpc/sub/nathole.go(+1 -1)📝
cmd/frpc/sub/proxy.go(+2 -2)📝
cmd/frpc/sub/root.go(+12 -6)📝
cmd/frpc/sub/verify.go(+1 -1)📝
cmd/frps/root.go(+5 -3)📝
cmd/frps/verify.go(+1 -1)📝
pkg/config/load.go(+26 -13)📝
pkg/config/load_test.go(+58 -12)📄 Description
Summary
🤖 Generated by Copilot at 70600fb
This pull request adds a new feature to enable strict configuration parsing mode for both frpc and frps, which will reject any config file with unknown fields. It introduces a new command line flag
--strict_configand modifies various config loading and service starting functions to use the flag. It also adds new test cases and imports a newyamlpackage to implement the feature. The affected files areclient/service.go,client/admin_api.go,cmd/frpc/sub/*.go,cmd/frps/root.go, andcmd/frps/verify.goin thefatedier/frprepository.WHY
See #3769.
This PR adds a new
--strict_configoption that makes all configuration parsing stricter, for all modes of operation (not justverify). Right now it means that extraneous keys are not allowed, making it easier to catch e.g. typos in configuration.This is opt-in.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.