Skip to content

How to use authorization via JWT for KV Buckets #4639

Answered by jjthiessen
shoaibmerchant asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know what the right answer is here, but I'm doing something like the following in/for one application/use-case (user foo; bucket bar):

Pub:

$JS.API.CONSUMER.CREATE.KV_bar.*.$KV.bar.>
$JS.API.CONSUMER.DELETE.KV_bar.>
$JS.API.STREAM.INFO.KV_bar
$JS.FC.KV_bar.>

Sub:

_INBOX_foo.>

This allows me to use a custom/per-user (foo) inbox, and restricts access otherwise/as best I think I can?

The permissions were collected by not granting permissions, turning on tracing, tailing logs + testing, and iteratively adding permissions until things worked. I don't think that I added in more than I needed, but it's possible. You might need slightly different permissions depending on what the user n…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shoaibmerchant
Comment options

Answer selected by shoaibmerchant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants