Repository navigation
feat(plugins): add plugin manifest schema and validator - #1725
Open
developerkunal wants to merge 9 commits into
Open
developerkunal wants to merge 9 commits into
developerkunal wants to merge 9 commits into
Conversation
developerkunal
force-pushed
the
DXCDT-2601/manifest-schema
branch
from
October 24, 2026 15:30
f5112f8 to
1e522be
Compare
developerkunal
force-pushed
the
DXCDT-2601/manifest-schema
branch
from
November 2, 2026 11:12
1e522be to
2b8b8dc
Compare
developerkunal
force-pushed
the
DXCDT-2601/manifest-schema
branch
2 times, most recently
from
November 24, 2026 12:02
e9713b0 to
3432b94
Compare
bkiran6398
force-pushed
the
DXCDT-2601/manifest-schema
branch
from
November 27, 2026 06:23
3432b94 to
d95fe92
Compare
Define the plugin.json manifest as an embedded JSON Schema and validate it in Go so the CLI, the plugin catalog and `plugin dev validate` share one contract. - Strict ParseManifest for authors and the catalog, and a runtime ParseInstalledManifest that tolerates unknown fields but fails closed on unknown permission fields and newer API versions. A permissions list that the manifest leaves out counts as empty. - Typed Platform, FlagType and FileAccess, with OS, Arch and Libc helpers for matching release artifacts. - A permissions union and a consent hash covering scopes, hosts, files, env and each command's interactive value. The canonical JSON is written by hand and hashed text cannot contain control characters, so other languages produce the same bytes. Test vectors are published for the catalog pipeline. - Reserved flag, shorthand and environment variable names.
developerkunal
force-pushed
the
DXCDT-2601/manifest-schema
branch
from
November 30, 2026 17:24
d95fe92 to
76ae442
Compare
A permissions.scopes entry is now an object with a name, a required reason and an optional flag instead of a plain string. Scope names must be unique within a command. The union keeps one entry per distinct name, reason and optional value, and the consent hash covers all three keys, so a changed reason or a flipped optional asks for consent again. Free text in the manifest is tightened as well. Control, format, line separator and paragraph separator characters are rejected, which are the characters the CLI replaces when it prints plugin text, and descriptions, team, reasons and file paths have length limits.
A plugin flag can now declare a default, an enum of allowed values and required in plugin.json. They are metadata that the CLI shows in help, completion and the agent schema, and plugin dev validate checks them. Nothing validates user input against them. The manifest checks that a default and every enum value fit the flag type, that a default is one of the enum values, that a bool flag has no enum and is not required, that a stringArray flag has no default, and that a required flag has no default. Flags stay out of the consent hash.
A command can list the exit codes it returns, each with a code from 1 to 255 and a short meaning. The codes must be unique within a command. They are documentation only: they do not decide whether the plugin's exit code is passed on and they are not part of the consent hash.
An engines.auth0-cli comparator can now carry a semver prerelease, such as >=1.41.0-beta.3. A plain comparator such as >=1.41.0 still compares only MAJOR.MINOR.PATCH, so a beta build of 1.41.0 satisfies it. A comparator with a prerelease compares the full version including the prerelease. Build metadata stays rejected.
A command name can now have one to three words separated by a single space, such as "scan secrets". The command list stays flat, so each entry keeps its own flags, permissions and consent settings, and full names stay unique. Adds consent hash vectors for nested names.
…d flag number rules URLs in homepage and owner.bugs now have to be printable ASCII with an https prefix, a host and at most 2048 characters, and $schema gets the same length limit and the free text rules, so none of them can carry terminal escape sequences, bidirectional controls or zero width characters. Free text now needs at least one character that is not a space separator, so a reason cannot be made only of spaces. Int and float flag values must use the plain decimal forms that every language parses the same way, and enum values that are the same number written differently are reported as duplicates. Document that the consent hash sorts by UTF-8 bytes rather than UTF-16 code units and add a vector where the two orders disagree.
A command can list response fields under permissions.secrets, each a secret path with a reason, that the plugin proxy would otherwise remove. The list is experimental, holds up to 10 paths per command and is part of the consent hash only when a command asks for a secret, so the hash of every manifest without secrets stays the same.
A name in a permissions.secrets path holds only ASCII letters, digits, underscores and hyphens, so two paths that look the same on the consent screen are the same path for the proxy.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Adds the new
internal/pluginspackage, which defines theplugin.jsonmanifest that Auth0 CLI plugins ship with. The CLI, the plugin catalog and the futureplugin dev validatecommand share this one contract. This is a library only, with no commands, flags or files on disk yet. Theengines.auth0-cliconstraint is only checked for grammar here, not evaluated.schema/plugin.schema.jsonis a JSON Schema (draft 2020-12) that rejects unknown properties and is embedded in the binary. It is compiled withsanthosh-tekuri/jsonschema/v6, which moves from an indirect to a direct dependency.ParseManifestis for authors and the catalog. It rejects unknown fields and anyapiVersionother than 1, then runs the checks JSON Schema cannot express, such as positive timeouts, unique command and flag names, reserved flag names, and environment variable names that start withAUTH0_PLUGIN_orAUTH0_CLI_. Every problem comes back with its JSON path.ParseInstalledManifestis for a manifest that is already installed. It ignores unknown fields elsewhere so a slightly newer plugin still runs on an older CLI. It fails closed in two places: an unknown field insidepermissionsis rejected, and so is anapiVersiongreater than 1. A permission this CLI does not understand must never be silently ignored, so both errors say the plugin needs a newer CLI.PermissionsHash()returns a SHA-256 over a canonical JSON document of scopes, hosts, files, env and each command'sinteractivevalue. Reasons are part of the hash on purpose, so a changed reason or a flippedinteractivevalue asks for consent again. The canonical JSON is written by hand so the bytes do not depend on the Go version, andtestdata/consent-hash-vectors.jsonholds vectors for the catalog pipeline to reuse.SafeTextreplaces control, format and separator characters with U+FFFD, so text from a plugin can be printed without driving the terminal or hiding content.📚 References
DXCDT-2601. This is the first PR of the plugin framework stack of 11 PRs, so it is the base and builds on no other PR.
🔬 Testing
The new code is covered by unit tests.
📝 Checklist