What happens now
ntk reads the API key from --apikey or config.yml.
The init and checkout commands can save a supplied API key to config.yml. Other commands do not rewrite the file.
There is no way for CI jobs or agents to provide the key through an environment variable without putting it in the command or configuration file.
What should happen
Allow the API key to be supplied through NTK_APIKEY.
Use this order:
--apikey
NTK_APIKEY
config.yml
If the key came from NTK_APIKEY, ntk must not copy it into config.yml.
The existing behavior for an explicitly supplied --apikey can remain unchanged.
How to verify
- Run a command with only
NTK_APIKEY set. It should authenticate without asking for --apikey.
- Run
init or checkout using NTK_APIKEY. The environment value should not appear in config.yml.
- Supply both
--apikey and NTK_APIKEY. The command-line value should be used.
- Run without either value. ntk should continue to read the key from
config.yml.
Done when
- All ntk commands can use
NTK_APIKEY.
- Environment-supplied keys are never written to
config.yml.
- Command-line values take priority over environment values.
- Existing
config.yml behavior continues to work.
- Tests cover the three possible sources.
What happens now
ntk reads the API key from
--apikeyorconfig.yml.The
initandcheckoutcommands can save a supplied API key toconfig.yml. Other commands do not rewrite the file.There is no way for CI jobs or agents to provide the key through an environment variable without putting it in the command or configuration file.
What should happen
Allow the API key to be supplied through
NTK_APIKEY.Use this order:
--apikeyNTK_APIKEYconfig.ymlIf the key came from
NTK_APIKEY, ntk must not copy it intoconfig.yml.The existing behavior for an explicitly supplied
--apikeycan remain unchanged.How to verify
NTK_APIKEYset. It should authenticate without asking for--apikey.initorcheckoutusingNTK_APIKEY. The environment value should not appear inconfig.yml.--apikeyandNTK_APIKEY. The command-line value should be used.config.yml.Done when
NTK_APIKEY.config.yml.config.ymlbehavior continues to work.