Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Byron Ruth <b@devel.io>
  • Loading branch information
bruth committed Nov 17, 2022
1 parent 1bd7499 commit 837fdd1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions examples/auth/jwt-perms/cli/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ sleep 1
# Push the account up to the server.
nsc push -a APP

# The next two users emulate consumers of the service. They can publish
# on their own prefixed subject as well as publish to services scoped the
# their respective name.
# Create two users with pub/sub permissions for their own subject.
nsc add user --account APP joe \
--allow-pub 'joe' \
--allow-sub 'joe' \
Expand All @@ -50,10 +48,6 @@ nsc add user --account APP pam \
--allow-pub 'pam' \
--allow-sub 'pam'

# A nice side effect of this is that now, joe and pam can't subscribe
# to each other's subjects, however, what about `_INBOX.>`? Let's observe
# the current behavior and then see how we can address this.

# First, let's save a few contexts for easier reference.
nats context save joe \
--nsc nsc://local/APP/joe
Expand All @@ -64,6 +58,7 @@ nats context save pam \
# Attempt to subscribe to the other user.. should get permission violation.
echo 'Attempting to subscribe to pam by joe..'
nats --context joe sub 'pam'

echo 'Attempting to subscribe to joe by pam..'
nats --context pam sub 'joe'

Expand All @@ -72,8 +67,10 @@ nats --context joe sub 'joe' &
nats --context pam sub 'pam' &

# Publish to the wrong user..
echo 'Publishing to pam as joe'
nats --context joe pub 'pam' ''
nats --context pam pub 'sue' ''
echo 'Publishing to joe as pam'
nats --context pam pub 'joe' ''

# Publish to the right user..
nats --context joe pub 'joe' ''
Expand Down

1 comment on commit 837fdd1

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for nats-by-example ready!

✅ Preview
https://nats-by-example-ndr8z0887-connecteverything.vercel.app

Built with commit 837fdd1.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.