-
I'm working on an adapter that lets ActiveExperiment use Unleash as its rollout and metrics service. I want to write some tests that connect to a real Unleash server, so the plan in CI is to spin up a docker container with Unleash running (which is pretty easy) -- and to use the admin API to add specific feature toggles, and variants. The code I have for that looks like this: Unleash::Util::Http.post(
URI("#{Unleash.configuration.url_stripped_of_slash}/admin/projects/default/features"),
{
"type": "experiment",
"name": "MyExperimentToggle",
"description": "This is a feature toggle for ActiveExperiment",
"impressionData": true
}.to_json
) Now, this works fine too -- but requires an admin token. So at a minimum it seems like I have to seed in an admin token somehow, so then I went looking, and I can connect to the database and export/import data directly, but I'm curious if there's any official tooling that I'm not seeing for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I found it -- there's an |
Beta Was this translation helpful? Give feedback.
I found it -- there's an
INIT_ADMIN_API_TOKENS
environment variant that can be used, which is perfect, and will let me use some of the code I already have.