# Adds the API key and url needed by the EGL connector to function
# Adds the API key and url needed by konnectors to function
# These information are defined in the .env file
echo Adding egl secrets to DB ...
echo Adding secrets to DB ...
source .env
docker-compose exec db curl -X PUT -d"{\"_id\":\"egl-api-connector\",\"grant_mode\":\"secret\",\"slug\":\"egl-api-connector\",\"secret\":{\"eglBaseURL\":\"${EGL_BASE_URL}\",\"eglAPIAuthKey\":\"${EGL_API_AUTH_KEY}\"}}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/egl-api-connector
docker-compose exec db curl -X PUT -d"{\"_id\":\"enedis-konnector\",\"grant_mode\":\"authorization_code\",\"client_id\":\"${ENEDIS_CLIENT_ID}\",\"client_secret\":\"${ENEDIS_CLIENT_SECRET}\",\"auth_endpoint\":\"${ENEDIS_AUTH_ENDPOINT}\",\"token_endpoint\": \"${ENEDIS_TOKEN_ENDPOINT}\",\"token_mode\":\"get\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/enedis-konnector