To use token rotation, the gem assumes that they are separated with \n. The problem is that when the value is read from the .env-file, it is escaped like this: xxxxxxxxx-yyyyy-zzzz-aaaaa-bbbbbbbbbbbbb\\nxxxxxxxxx-yyyyy-zzzzz-aaaa-bbbbbbbbbbbb Notice the \\n separating the two tokens.
We did not get this problem when running our tests because the values from our .env-file are never used in our tests. Instead, we have a shared context for repositories that sets the environment variables and our spec_helper resets these values after each test run. We should remove this and use our .env-file instead since current approach is error prone.
To use token rotation, the gem assumes that they are separated with
\n
. The problem is that when the value is read from the.env
-file, it is escaped like this:xxxxxxxxx-yyyyy-zzzz-aaaaa-bbbbbbbbbbbbb\\nxxxxxxxxx-yyyyy-zzzzz-aaaa-bbbbbbbbbbbb
Notice the\\n
separating the two tokens.We did not get this problem when running our tests because the values from our
.env
-file are never used in our tests. Instead, we have a shared context for repositories that sets the environment variables and ourspec_helper
resets these values after each test run. We should remove this and use our.env
-file instead since current approach is error prone.