Skip to content

Commit 269cc62

Browse files
committed
feat: add information about token validity times
Signed-off-by: Jana Peper <[email protected]>
1 parent 70c10a3 commit 269cc62

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

apps/webhook_listeners/lib/Controller/WebhooksController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public function show(int $id): DataResponse {
115115
* @param ?array<string,mixed> $tokenNeeded List of user ids for which to include auth tokens in the event.
116116
* Has two fields: "user_ids" list of user uids for which tokens are needed, "user_roles" list of roles (users not defined by their ID but by the role they have in the webhook event) for which tokens can be included.
117117
* Possible roles: "owner" for the user creating the webhook, "trigger" for the user triggering the webhook call.
118+
* Requested auth tokens are valid for 1 hour after receiving them in the event call request.
118119
*
119120
* @return DataResponse<Http::STATUS_OK, WebhookListenersWebhookInfo, array{}>
120121
*
@@ -189,6 +190,7 @@ public function create(
189190
* @param ?array<string,mixed> $tokenNeeded List of user ids for which to include auth tokens in the event.
190191
* Has two fields: "user_ids" list of user uids for which tokens are needed, "user_roles" list of roles (users not defined by their ID but by the role they have in the webhook event) for which tokens can be included.
191192
* Possible roles: "owner" for the user creating the webhook, "trigger" for the user triggering the webhook call.
193+
* Requested auth tokens are valid for 1 hour after receiving them in the event call request.
192194
*
193195
* @return DataResponse<Http::STATUS_OK, WebhookListenersWebhookInfo, array{}>
194196
*

apps/webhook_listeners/lib/Service/TokenService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct(
2929
* The array ['user_ids' => ['jane', 'bob'], 'user_roles' => ['owner', 'trigger']]
3030
* as requested tokens in the registered webhook produces a result like
3131
* ['user_ids' => [['jane' => 'abcdtokenabcd1'], ['bob','=> 'abcdtokenabcd2']], 'user_roles' => [['owner' => ['admin' => 'abcdtokenabcd3']], ['trigger' => ['user1' => 'abcdtokenabcd4']]]]
32+
* Created auth tokens are valid for 1 hour.
3233
*
3334
* @param WebhookListener $webhookListener
3435
* @param string|null $triggerUserId the user that triggered the webhook call

0 commit comments

Comments
 (0)