Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Disallow unknown keys in verify #3769

Closed
2 of 11 tasks
akx opened this issue Nov 14, 2023 · 1 comment
Closed
2 of 11 tasks

[Feature Request] Disallow unknown keys in verify #3769

akx opened this issue Nov 14, 2023 · 1 comment

Comments

@akx
Copy link
Contributor

akx commented Nov 14, 2023

Describe the feature request

Related to #3757 (validating the configuration against a strict schema).

frpc verify doesn't validate the presence of extraneous/unknown keys in the document given, so typos are easily uncaught. Can you spot at least 4 in the document below? 😁

$ cat > config.json
{
  "serverAddr": "localhost",
  "serverPort": 7000,
  "auth": {
    "metho": "oidc"
  },
  "log": {
    "leverl": "trace"
  },
  "proxies": [
    {
      "name": "xxx",
      "type": "http",
      "localPort": 8888,
      "customDomains": [
        "xxx"
      ],
      "transpor": {
        "useEncrypion": true,
        "useCompression": true
      }
    }
  ]
}
$ ./frpc verify -c a.json
frpc: the configuration file a.json syntax is ok
$

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
@fatedier
Copy link
Owner

fatedier commented Nov 15, 2023

I think it is ok to add a --strict-mode option to enable this feature, with schema validation disabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants