Repository navigation
Conversation
A product whose engine ships as its own executable can add a command group: norcube <command> runs nrc-<command> from the plugin directory or PATH. Only plugins named in the service registry run, an executable or directory other users can write is refused, and a protocol handshake (__plugin-info) comes first. The plugin's exit code passes through; plugins get tokens from norcube auth token and never receive stored credentials. Contract in docs/PLUGINS.md. Signed-off-by: Jan Švábík <jansvabik@jansvabik.cz>
Signed-off-by: Jan Švábík <jansvabik@jansvabik.cz>
Signed-off-by: Jan Švábík <jansvabik@jansvabik.cz>
Signed-off-by: Jan Švábík <jansvabik@jansvabik.cz>
The --audience names were a hand-kept second copy of the registry's audiences. They are now derived from it (command, key and aliases), so the Pentest plugin can get tokens and a new service is one registry entry. nrc api and doctor consider only services with an endpoint. Signed-off-by: Jan Švábík <jansvabik@jansvabik.cz>
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.
Lets a product whose engine ships as its own executable add a command group:
norcube <command> …runsnrc-<command> …with the arguments that follow.Safety
services.yaml, new fieldplugin) ever run; nothing is discovered by a name prefix. The registry refuses a plugin not namednrc-<command>.<plugin> __plugin-info→{name, version, protocol}, 5 s limit) comes first; a name or protocol mismatch is refused with a hint about which side to update."$NRC_BIN" auth token --audience …for a short-lived token, which works with every sign-in kind and honours profile, org and scopes.Behaviour
NORCUBE_PLUGIN_DIR, else<config dir>/norcube/plugins, thenPATH.clierr.PassthroughExit); the CLI prints nothing extra. Ctrl-C cancels the plugin, killed after 5 s.NRC_PLUGIN_PROTOCOL,NRC_BIN,NRC_PROFILE,NRC_ORG,NRC_OUTPUT,NRC_DEBUG.--endpoint-url, environments).Contract:
docs/PLUGINS.md. No registry entry uses a plugin yet; the first follows in a separate change.Tests:
internal/plugin(lookup, handshake refusals, writable-by-others refusal, not installed, exit codes),internal/cli(argument and env passthrough, exit code passthrough, not-installed hint), registry validation; full suite passes.