From aa8c73cd18b418a1e509a406c99c05ac21994770 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Tue, 15 Sep 2020 09:00:44 -0400 Subject: [PATCH] website: Credentials helper response for no creds For a credentials helper plugin to be useful with Terraform 0.13+, we need to cope with the case of having no credentials for a host without this being an error. This is to allow the public Terraform Registry to be accessed without supplying a token. The way to implement this is to respond to queries for credentials for a host which has no credentials stored with an empty object and a success exit code. This contradicts the previous documentation, which calls for an error response in this case. --- website/docs/internals/credentials-helpers.html.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/website/docs/internals/credentials-helpers.html.md b/website/docs/internals/credentials-helpers.html.md index c599c2b18..c7572484e 100644 --- a/website/docs/internals/credentials-helpers.html.md +++ b/website/docs/internals/credentials-helpers.html.md @@ -83,9 +83,12 @@ If the credentials helper is able to provide credentials for the given host then it must print a JSON credentials object to its stdout stream and then exit with status code zero to indicate success. -If it is unable to provide the requested credentials for any reason, it must -print an end-user-oriented plain text error message to its stderr stream and -then exit with a _non-zero_ status code. +If the credentials helper definitively has no credentials for the given host, +then it must print an empty JSON object to stdout and exit with status zero. + +If the credentials helper is unable to provide the requested credentials for +any other reason, it must print an end-user-oriented plain text error message +to its stderr stream and then exit with a _non-zero_ status code. ## `store`: store new credentials for the given hostname