[PR #3773] [MERGED] Strict configuration parsing #4828

Closed
opened 2026-05-05 14:49:29 -06:00 by gitea-mirror · 0 comments
Owner

📋 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: devHead: strict-config-parsing


📝 Commits (2)

  • f269f83 Test configuration loading more precisely
  • 41ef9b7 Add 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_config and modifies various config loading and service starting functions to use the flag. It also adds new test cases and imports a new yaml package to implement the feature. The affected files are client/service.go, client/admin_api.go, cmd/frpc/sub/*.go, cmd/frps/root.go, and cmd/frps/verify.go in the fatedier/frp repository.

WHY

See #3769.

This PR adds a new --strict_config option that makes all configuration parsing stricter, for all modes of operation (not just verify). 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.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/3773 **Author:** [@akx](https://github.com/akx) **Created:** 11/15/2023 **Status:** ✅ Merged **Merged:** 11/16/2023 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `strict-config-parsing` --- ### 📝 Commits (2) - [`f269f83`](https://github.com/fatedier/frp/commit/f269f83130d93ed6798818b8cf29ff782fbdd3b2) Test configuration loading more precisely - [`41ef9b7`](https://github.com/fatedier/frp/commit/41ef9b75526c7aac0d41e20c0590ec397852ae73) Add strict configuration parsing ### 📊 Changes **11 files changed** (+119 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 Description ### Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 70600fb</samp> 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_config` and modifies various config loading and service starting functions to use the flag. It also adds new test cases and imports a new `yaml` package to implement the feature. The affected files are `client/service.go`, `client/admin_api.go`, `cmd/frpc/sub/*.go`, `cmd/frps/root.go`, and `cmd/frps/verify.go` in the `fatedier/frp` repository. ### WHY See #3769. This PR adds a new `--strict_config` option that makes all configuration parsing stricter, for all modes of operation (not just `verify`). Right now it means that extraneous keys are not allowed, making it easier to catch e.g. typos in configuration. This is opt-in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:49:29 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4828
No description provided.