Googlecloudbuildcloudrun
Googlecloudbuildcloudrun
The server could not verify that you are authorized to access the URL requested. You either si
4 >
cistfile xt hosted with @ by GitHub view raw
Testing the protected application endpoint with curl — HTTP 401
Now, if you remember, the /hello endpoint is protected with a Basic Auth
mechanism, and the reason for this is to demonstrate how we can make use
of environment variables on Cloud Run.
To fix this problem, we can make use of some scripts versioned into our
repository. If you have gone through the steps to run and test the application
locally, as described in the application README file, you'll remember of the
scripts/hash_value.py script, which we can use to hash values in the SHA-512
form.
Earlier in this article, we talked about the require_api_key decorator, which
is used to secure our /hello endpoint with Basic Auth. Remember that, under
the hood, this decorator reads the HASHED_API_KEY environment variable,
hashes the received x-api-key HTTP header value with SHA-512 and
compares both values to decide whether or not to allow the request to.
proceed.
To set the HASHED_API_KEY environment variable, follow these steps:
nips medium, comic. thow4o-setup-2- deployment pipeine-on-gcp-withYou might also like