Skip to content

Commit

Permalink
update Callback URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Sep 27, 2024
1 parent 13b1a07 commit 0aa8b64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions MyApp/_pages/background-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,31 +635,31 @@ public class NotifyCheckUrlsCommand(IHttpClientFactory clientFactory)
`ReplyTo` can be any URL which by default will have the result POST'ed back to the URL with a JSON
Content-Type. Typically URLs will contain a reference Id so external clients can correlate a callback
with the internal process that initiated the job. If the callback API is publicly available you'll
want to use an internal Id that can't be guessed so the callback can't be spoofed, like a Guid, e.g:
want to use an internal Id that can't be guessed (like a Guid) so the callback can't be spoofed, e.g:

`$"https://api.example.com?refId={RefId}"`
`$"https://api.example.com/callback?refId={RefId}"`

If needed the callback URL can be customized on how the HTTP Request callback is sent.

If the URL contains a space, the text before the space is treated as the HTTP method:

`"PUT https://api.example.com"`
`"PUT https://api.example.com/callback"`

If the auth part contains a colon `:` it's treated as Basic Auth:

`"username:password@https://api.example.com"`
`"username:password@https://api.example.com/callback"`

If name starts with `http.` sends a HTTP Header

`"http.X-API-Key:myApiKey@https://api.example.com"`
`"http.X-API-Key:myApiKey@https://api.example.com/callback"`

Otherwise it's sent as a Bearer Token:

`"myToken123@https://api.example.com"`
`"myToken123@https://api.example.com/callback"`

Bearer Token or HTTP Headers starting with `$` is substituted with Environment Variable if exists:

`"$API_TOKEN@https://api.example.com"`
`"$API_TOKEN@https://api.example.com/callback"`

When needed headers, passwords and tokens can be URL encoded if they contain any delimiter characters.

Expand Down
14 changes: 7 additions & 7 deletions MyApp/_pages/releases/v8_04.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,31 +779,31 @@ public class NotifyCheckUrlsCommand(IHttpClientFactory clientFactory)
`ReplyTo` can be any URL which by default will have the result POST'ed back to the URL with a JSON
Content-Type. Typically URLs will contain a reference Id so external clients can correlate a callback
with the internal process that initiated the job. If the callback API is publicly available you'll
want to use an internal Id that can't be guessed so the callback can't be spoofed, like a Guid, e.g:
want to use an internal Id that can't be guessed (like a Guid) so the callback can't be spoofed, e.g:

`$"https://api.example.com?refId={RefId}"`
`$"https://api.example.com/callback?refId={RefId}"`

If needed the callback URL can be customized on how the HTTP Request callback is sent.

If the URL contains a space, the text before the space is treated as the HTTP method:

`"PUT https://api.example.com"`
`"PUT https://api.example.com/callback"`

If the auth part contains a colon `:` it's treated as Basic Auth:

`"username:password@https://api.example.com"`
`"username:password@https://api.example.com/callback"`

If name starts with `http.` sends a HTTP Header

`"http.X-API-Key:myApiKey@https://api.example.com"`
`"http.X-API-Key:myApiKey@https://api.example.com/callback"`

Otherwise it's sent as a Bearer Token:

`"myToken123@https://api.example.com"`
`"myToken123@https://api.example.com/callback"`

Bearer Token or HTTP Headers starting with `$` is substituted with Environment Variable if exists:

`"$API_TOKEN@https://api.example.com"`
`"$API_TOKEN@https://api.example.com/callback"`

When needed headers, passwords and tokens can be URL encoded if they contain any delimiter characters.

Expand Down

0 comments on commit 0aa8b64

Please sign in to comment.