-
Notifications
You must be signed in to change notification settings - Fork 400
docs: improve secrets and OAuth discoverability #3206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
topher-lo
wants to merge
7
commits into
main
Choose a base branch
from
codex/docs-secrets-oauth-discoverability
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
195aa9b
docs: improve secrets and OAuth discoverability
topher-lo eff12a9
docs: refine HTTP authentication guide
topher-lo 69e4e0e
docs: address OAuth review feedback
topher-lo e3ed971
docs: move pagination tip to action
topher-lo b0e95e0
docs: add HTTP poll lambda examples
topher-lo fd78219
docs: clarify HTTP polling conditions
topher-lo 020a6ee
docs: fix OAuth YAML declaration link
topher-lo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| title: "OAuth token expressions" | ||
| description: "Reference OAuth provider IDs and managed tokens in Tracecat expressions." | ||
| --- | ||
|
|
||
| OAuth expressions use the provider's exact ID, not its display name. | ||
|
topher-lo marked this conversation as resolved.
|
||
|
|
||
| - Built-in providers use stable lowercase IDs assigned by Tracecat, with | ||
| underscores between words, such as `slack`, `google_drive`, and | ||
| `microsoft_sentinel`. | ||
| - Custom providers use an ID derived from the provider name, or from the | ||
| requested ID when you create one through the API. Tracecat slugifies it with | ||
| underscores and prepends `custom_`. `My Security API` becomes | ||
| `custom_my_security_api`. If that ID is already used for the same grant type, | ||
| Tracecat appends `_1`, `_2`, and so on. | ||
|
|
||
| Append `_oauth` to the exact provider ID for the secret name. For the key, | ||
| uppercase the complete provider ID, preserve its underscores and any numeric | ||
| suffix, then append `_USER_TOKEN` for `authorization_code` or `_SERVICE_TOKEN` | ||
| for `client_credentials`. | ||
|
|
||
| ```yaml | ||
| # authorization_code grant | ||
| ${{ SECRETS.<provider_id>_oauth.<PROVIDER_ID_UPPER>_USER_TOKEN }} | ||
|
|
||
| # client_credentials grant | ||
| ${{ SECRETS.<provider_id>_oauth.<PROVIDER_ID_UPPER>_SERVICE_TOKEN }} | ||
| ``` | ||
|
|
||
| A built-in `google_drive` authorization-code provider and a custom | ||
| `custom_my_security_api` client-credentials provider resolve as: | ||
|
|
||
| ```yaml | ||
| ${{ SECRETS.google_drive_oauth.GOOGLE_DRIVE_USER_TOKEN }} | ||
| ${{ SECRETS.custom_my_security_api_oauth.CUSTOM_MY_SECURITY_API_SERVICE_TOKEN }} | ||
| ``` | ||
|
|
||
| When either grant type is allowed, use a fallback: | ||
|
|
||
| ```yaml | ||
| ${{ SECRETS.microsoft_sentinel_oauth.MICROSOFT_SENTINEL_USER_TOKEN || SECRETS.microsoft_sentinel_oauth.MICROSOFT_SENTINEL_SERVICE_TOKEN }} | ||
| ``` | ||
|
|
||
| <Info> | ||
| Tracecat refreshes expiring authorization-code tokens when the provider | ||
| issued a refresh token, and reacquires client-credentials tokens with the | ||
| stored client credentials. The expression resolves only to the current | ||
| access-token string, which may be a JWT or an opaque token, not the refresh | ||
| token. | ||
| </Info> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a job API reports another nonterminal state such as
queuedorpendingbeforeprocessing, this predicate is immediatelyTrue, socore.http_pollstops and returns an unfinished job instead of polling. The same premature stop occurs when a transient response has no status value. Restrict this recommendation to APIs whereprocessingis the only nonterminal state, or use the documented explicit terminal-state predicate.Useful? React with 👍 / 👎.