-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat(policy): add Heygen OAuth endpoints and onboard hints #1843
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
base: main
Are you sure you want to change the base?
Changes from all commits
eb35afa
6148c5d
8718e46
69190ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| preset: | ||
| name: heygen | ||
| description: "HeyGen API (REST, OAuth token endpoints, uploads, streaming WebSocket)" | ||
|
|
||
| network_policies: | ||
| heygen: | ||
| name: heygen | ||
| endpoints: | ||
| - host: api.heygen.com | ||
| port: 443 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| tls: terminate | ||
| rules: | ||
| - allow: { method: GET, path: "/**" } | ||
| - allow: { method: POST, path: "/**" } | ||
| - allow: { method: PATCH, path: "/**" } | ||
| - allow: { method: PUT, path: "/**" } | ||
| - allow: { method: DELETE, path: "/**" } | ||
| - host: api.heygen.com | ||
| port: 443 | ||
| access: full | ||
| - host: api2.heygen.com | ||
| port: 443 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| tls: terminate | ||
| rules: | ||
| - allow: { method: POST, path: "/v1/oauth/**" } | ||
| - allow: { method: GET, path: "/v1/user/**" } | ||
| - host: upload.heygen.com | ||
| port: 443 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| tls: terminate | ||
| rules: | ||
| - allow: { method: GET, path: "/**" } | ||
| - allow: { method: POST, path: "/**" } | ||
| - allow: { method: PUT, path: "/**" } | ||
| - host: files.heygen.com | ||
| port: 443 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| tls: terminate | ||
| rules: | ||
| - allow: { method: GET, path: "/**" } | ||
| binaries: | ||
| - { path: /usr/local/bin/node } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2712,6 +2712,9 @@ async function createSandbox( | |
| // Additional credentials not in REMOTE_PROVIDER_CONFIG | ||
| "BEDROCK_API_KEY", | ||
| "DISCORD_BOT_TOKEN", | ||
| "HEYGEN_ACCESS_TOKEN", | ||
| "HEYGEN_API_KEY", | ||
| "HEYGEN_REFRESH_TOKEN", | ||
| "SLACK_BOT_TOKEN", | ||
| "SLACK_APP_TOKEN", | ||
| "TELEGRAM_BOT_TOKEN", | ||
|
|
@@ -3924,6 +3927,20 @@ function getSuggestedPolicyPresets({ enabledChannels = null, webSearchConfig = n | |
| maybeSuggestMessagingPreset("slack", "SLACK_BOT_TOKEN"); | ||
| maybeSuggestMessagingPreset("discord", "DISCORD_BOT_TOKEN"); | ||
|
|
||
| if ( | ||
| getCredential("HEYGEN_API_KEY") || | ||
| process.env.HEYGEN_API_KEY || | ||
| getCredential("HEYGEN_ACCESS_TOKEN") || | ||
| process.env.HEYGEN_ACCESS_TOKEN || | ||
| getCredential("HEYGEN_REFRESH_TOKEN") || | ||
| process.env.HEYGEN_REFRESH_TOKEN | ||
| ) { | ||
| suggestions.push("heygen"); | ||
| if (process.stdout.isTTY && !isNonInteractive() && process.env.CI !== "true") { | ||
| console.log(" Auto-detected: HeyGen credentials -> suggesting heygen preset"); | ||
| } | ||
| } | ||
|
Comment on lines
+3930
to
+3942
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid raw
♻️ Proposed fix- if (
- getCredential("HEYGEN_API_KEY") ||
- process.env.HEYGEN_API_KEY ||
- getCredential("HEYGEN_ACCESS_TOKEN") ||
- process.env.HEYGEN_ACCESS_TOKEN ||
- getCredential("HEYGEN_REFRESH_TOKEN") ||
- process.env.HEYGEN_REFRESH_TOKEN
- ) {
+ const heygenCredentialKeys = [
+ "HEYGEN_API_KEY",
+ "HEYGEN_ACCESS_TOKEN",
+ "HEYGEN_REFRESH_TOKEN",
+ ];
+ if (heygenCredentialKeys.some((key) => getCredential(key))) {🤖 Prompt for AI Agents |
||
|
|
||
| if (webSearchConfig) suggestions.push("brave"); | ||
|
|
||
| return suggestions; | ||
|
|
||
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.
Add
/usr/bin/nodeto the binaries allowlist to avoid runtime mismatches.Line 50 currently allows only
/usr/local/bin/node. On images where Node is invoked from/usr/bin/node, this preset won’t match and HeyGen traffic will be blocked.Proposed fix
binaries: - { path: /usr/local/bin/node } + - { path: /usr/bin/node }📝 Committable suggestion
🤖 Prompt for AI Agents