Plugin Inline Functions Env Unable to Find Functions Directory

Hey, I’m running into a slight issue when trying to use RS256 encryption for my JWTs. I understand that env variables as according to AWS’s requirements cannot be longer than 4kb or 256 characters. I want to use RS256 encryption for my JWTs to make them longer and harder to crack. Unfortunately, this means a private key which is 4096 characters and a public key which is ~1000 chars, I’m looking for a way to store these in my code without uploading my .env file or having them stored openly in the repository because if someone were to get ahold of them they could become anyone on the site, admin, another user, whatever. I looked it up online and found that there was a plugin for including env variables on build called inline-functions-env, and this seemed like a great solution, so I tried to add it and I’m running into a slight issue on build.

The error is that the plugin cannot find the functions folder.

My functions are stored at the endpoint:

I have this set in my .toml like such:

  from = "/api/*"
  to = "/.netlify/functions/server/api/:splat"
  status = 200

  from = "/*"
  to = "/index.html"
  status = 200

  directory = "/.netlify/functions/server"

package = "netlify-plugin-inline-functions-env"
  include = ["RS256KEY", "RS256KEYPUB"]

The error is

Error: Could not list Netlify Functions files
Functions folders do not exist: /opt/build/repo/.netlify/functions-internal, /opt/build/repo/.netlify/functions/server

In "onPreBuild" event in "netlify-plugin-inline-functions-env" from netlify.toml

Why is it searching /opt/build/repo/.netlify/functions-internal and /opt/build/repo/.netlify/functions/server instead of just .netlify/functions/server? I assume that is where the functions are actually stored given the endpoint, what am I doing wrong in my configuration for this to be happening?

Any and all help is very greatly appreciated, thank you in advance!

I don’tm think you’re supposed to use .netlify folder to store your Functions. Try moving those to a different folder.

I tried, and it still is searching the same folders, I just decided to just split my keys into 13 for the private keys and 4 for the public keys variables to meet the requirements of AWS 256 character limit, it was pretty easy to get set up with just an online string splitter and then I was able to disable the plugin, remove it from my toml, clear the cache, and redeploy, and it works with the RS256 encryption for my JWTs.