From 88399da10d18714fea67e203ee11b6e66e0e73db Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:24:24 +0800 Subject: [PATCH 1/2] fix: clarify what the authorization header is asking for --- src/pages/guides/using/asynchronous_calls.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/guides/using/asynchronous_calls.md b/src/pages/guides/using/asynchronous_calls.md index 29ca713..029bc02 100644 --- a/src/pages/guides/using/asynchronous_calls.md +++ b/src/pages/guides/using/asynchronous_calls.md @@ -79,8 +79,11 @@ aio rt:rule:create async-rule my-worker-trigger my-worker ``` What we got so far: when our trigger is executed (my-worker-trigger), in turn will execute the action (my-worker). Here is how you can execute it. Please note the authentication header. You will need to use the same authentication as the one used by the namespace where you created these actions/trigger/rule. ``` -curl https://adobeioruntime.net/api/v1/namespaces/_/triggers/my-worker-trigger -X POST -H "Authorization: Basic NAMESPACE AUTHORIZATION" +curl https://adobeioruntime.net/api/v1/namespaces/_/triggers/my-worker-trigger -X POST -H "Authorization: Basic NAMESPACE_AUTHORIZATION" ``` + +`NAMESPACE_AUTHORIZATION` here is using standard Basic authentication encoding. This is generated by base64 encoding the concatenation of the namespace, and the namespace api key, separated by a colon. For example, if your namespace is `my-namespace`, and your api key is `abc123`, you would base64 encode the value: `my-namespace:abc123`. Base64 encoding this value, would result in the encoded value: `bXktbmFtZXNwYWNlOmFiYzEyMw==`. Thus your `Authorization` header would be: `Authorization: Basic bXktbmFtZXNwYWNlOmFiYzEyMw==`. + Tip: you can find the URI and the authorization for a trigger (or secured web action) by adding `-v` (verbose) to the commands to get an trigger (or action): ``` aio rt:trigger:get my-worker-trigger -v From 0216ad60930f897e4bbdaac4f725eecd535119d6 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Sat, 22 Jun 2024 00:14:24 +0800 Subject: [PATCH 2/2] use correct docs --- src/pages/guides/using/asynchronous_calls.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/guides/using/asynchronous_calls.md b/src/pages/guides/using/asynchronous_calls.md index 029bc02..31bed3f 100644 --- a/src/pages/guides/using/asynchronous_calls.md +++ b/src/pages/guides/using/asynchronous_calls.md @@ -79,10 +79,10 @@ aio rt:rule:create async-rule my-worker-trigger my-worker ``` What we got so far: when our trigger is executed (my-worker-trigger), in turn will execute the action (my-worker). Here is how you can execute it. Please note the authentication header. You will need to use the same authentication as the one used by the namespace where you created these actions/trigger/rule. ``` -curl https://adobeioruntime.net/api/v1/namespaces/_/triggers/my-worker-trigger -X POST -H "Authorization: Basic NAMESPACE_AUTHORIZATION" +curl https://adobeioruntime.net/api/v1/namespaces/_/triggers/my-worker-trigger -X POST -H "Authorization: Basic BASE64D_API_KEY" ``` -`NAMESPACE_AUTHORIZATION` here is using standard Basic authentication encoding. This is generated by base64 encoding the concatenation of the namespace, and the namespace api key, separated by a colon. For example, if your namespace is `my-namespace`, and your api key is `abc123`, you would base64 encode the value: `my-namespace:abc123`. Base64 encoding this value, would result in the encoded value: `bXktbmFtZXNwYWNlOmFiYzEyMw==`. Thus your `Authorization` header would be: `Authorization: Basic bXktbmFtZXNwYWNlOmFiYzEyMw==`. +`BASE64D_API_KEY` here is using standard Basic authentication encoding. This is generated by base64 encoding the namespace api key. For example, if your api key is `abc123`, you would base64 encode the value: `abc123`. Base64 encoding this value, would result in the encoded value: `YWJjMTIz`. Thus your `Authorization` header would be: `Authorization: Basic YWJjMTIz`. Tip: you can find the URI and the authorization for a trigger (or secured web action) by adding `-v` (verbose) to the commands to get an trigger (or action): ```