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

Adds the ability to deny certain trigger subjects for functions #285

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

autodidaddict
Copy link
Contributor

  1. Always rejects a certain set of subject spaces for functions: $SYS.>, $JS.>, and $NEX.>.
  2. You can add more trigger subject restrictions in the node config using the deny_trigger_subjects field

This is what it looks like to try and devrun a function with a denied trigger subject:

❯ ./nex devrun ../examples/v8/echofunction/src/echofunction.js --trigger_subject='$NEX.events.>' --type=v8
Reusing existing issuer account key: /home/kevin/.nex/issuer.nk
Reusing existing publisher xkey: /home/kevin/.nex/publisher.xk
[ERR] 2024-06-18 14:21:56 - failed to devrun workload err=The trigger subject $NEX.events.> overlaps with subject(s) in this node's deny list

internal/node/node.go Outdated Show resolved Hide resolved
kthomas
kthomas previously approved these changes Jun 20, 2024
Copy link
Contributor

@kthomas kthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple enough-- one comment about the deny_trigger_subjects being logged in what feels like an unexpected place. Otherwise LGTM.

@autodidaddict autodidaddict merged commit 848ec31 into main Jun 20, 2024
5 checks passed
@autodidaddict autodidaddict deleted the feat/deny_trigger_funcs branch June 20, 2024 13:15
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

Successfully merging this pull request may close these issues.

Block certain subjects from function trigger subjects
2 participants