Hy,
We are designing all that but the idea is:
Apps - leafnode auth:
We distribute our python code as an exe. We also encrypt it to be sure that the user has a license to run it. Because our software is encrypted we can put a passphrase in it. We can encrypt the nkey that the user will use to connect to the leaf node and store it into the hard drive (a file, or windows registry). When our code needs to connect to the nats leafnode it just have to read the encrypted nkey, decrypt it and connect (I hope python library can use an argument to set the nkey, do not relay into files for that) and the jwt signed with the account can be stored in the hard drive.
We do not need to set any permissions to this user because want can recieve and send to the cloud will be limited by the permissions of the user that the leafnode use to connect to the cloud.
Leafnode - cloud auth:
We do not know how to make it secure. The only option we have now is to create a credentials file. But anyone with physical access to the system will be able to read.
The administration of the users and permissions will be done by our software:
- create nkeys
- create jwt to sign the nkeys with the account seed
- create jwt's for permissions
- push all the info into the nats server
The leafnodes will synchronize with the servers to get all the information.
If you see anything that is not possible or there is a better way to implement it, we will be glad to know it, as I say we are just designing it and we do not know if there is a better aproach.
Thanks!