Today I noticed that there are some gotchas in the Fauna Docker image.
The secret key that is supplied with the image should be use to create a database and a key to use to create everything else. You can’t use it to just plug into your regular code.
CreateRole doesn’t behave the same as production. The following code doesn’t work locally for some reason but it does in production Fauna. Create Role in Fauna · GitHub
Any suggestions for what I’m doing wrong would be gladly welcomed.
The secret key that is supplied with the image should be use to create a database and a key to use to create everything else. You can’t use it to just plug into your regular code.
When using Fauna Dev, secret is, indeed, the default secret used to access the top-level database running within the Docker image. That secret gives you admin access, so you can create whatever collections, documents, indexes, functions, roles, access providers, etc., that you need. It is not limited in any way.
When you tried to “plug it into your regular code”, what issues did you encounter?
CreateRole doesn’t behave the same as production. The following code doesn’t work locally for some reason but it does in production Fauna. Create Role in Fauna · GitHub
What different behaviour did you see? The Role that you linked to doesn’t specify any membership, so it doesn’t automatically apply to any identity documents contained in your database, but perhaps you are assigning that role to a UDF?
More details would be required to help you further.
The code I linked here works in production Fauna but I receive a BadRequest error in the Docker version. I’ve noticed for any role I try to create that has a function resource that I try to add call to fails.