Skip to content

fix: resolve executor compile regressions#271

Closed
KooshaPari wants to merge 426 commits intorouter-for-me:mainfrom
KooshaPari:ci-compile-fix-clean-pr
Closed

fix: resolve executor compile regressions#271
KooshaPari wants to merge 426 commits intorouter-for-me:mainfrom
KooshaPari:ci-compile-fix-clean-pr

Conversation

@KooshaPari
Copy link
Copy Markdown

Amended compile regression fix branch with two targeted fixes: use awsRegionPattern for OIDC region validation and remove unused strings import in copilot token test.

KooshaPari and others added 30 commits February 22, 2026 16:47
These fields are not supported by Codex Responses API and cause upstream errors.

Fixes: router-for-me#1667
- Replace manual prefix/suffix checks with strings.TrimPrefix/TrimSuffix
- Remove unused functions and variables in kiro_executor.go and request_logger.go
- Move default case to the end of switch statement in kiro_executor.go
- Fix function signatures and call sites in kiro_executor.go where arguments were immediately overwritten

Co-authored-by: Cursor <cursoragent@cursor.com>
- Added unit tests for internal/auth packages (codex, copilot, gemini, kiro).
- Added unit tests for internal/runtime/executor, specifically for Kiro executor.
- Added unit tests for various internal translators.
- Improved internal/api and sdk test coverage.
- Fixed a race condition in Kiro social authentication callback server.
- Updated .gitignore to exclude build artifacts and coverage files.
- Cleaned up go.mod and go.sum with go mod tidy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rs and fix kiro_websearch functions

This commit:
- Updates cmd/codegen/main.go to support multiple templates and directories.
- Embeds GeneratedConfig in internal/config/Config.
- Restores SSE and message ID functions in internal/translator/kiro/claude/kiro_websearch.go.
- Adds pkg/llmproxy/ directory structure for shared components.
- Fixes missing strings import in generated config files.

Co-authored-by: Cursor <cursoragent@cursor.com>
Renamed references to CLIProxyAPIPlus to cliproxyapi++ (display) and cliproxyapi-plusplus (technical). Updated GitHub remote and internal URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @KooshaPari, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a substantial refactoring and enhancement of the project, shifting towards a library-first architecture by exposing core proxy logic in a new pkg/llmproxy module. It significantly upgrades the CI/CD pipeline with new quality gates and automation tools for release management and project synchronization. Furthermore, the project undergoes a branding update to cliproxyapi++ and receives a comprehensive documentation overhaul, providing extensive guides and API references. New CLI features for provider logins and setup wizards are also included, broadening the project's usability and maintainability.

Highlights

  • Architectural Refactoring: The core proxy logic was moved from the internal/ package to pkg/llmproxy/ to establish a library-first architecture, enhancing code reusability and modularity for embedding into other Go applications.
  • Enhanced CI/CD and Quality Gates: New GitHub workflows and scripts were introduced to implement stricter quality checks, including external endpoint validation, documentation secret scanning, fragmented parity checks, workflow token permissions, and release linting.
  • New Project Automation Tools: Dedicated Go programs were added for automating key project processes: cmd/boardsync for synchronizing GitHub project boards, cmd/codegen for code generation, and cmd/releasebatch for streamlined release tagging and notes generation.
  • Comprehensive Documentation Overhaul: The project's documentation was significantly expanded and restructured using VitePress, providing detailed guides for installation, provider usage, API references, operational runbooks, and audience-specific docsets.
  • Branding Update: The project name was updated from cli-proxy-api-plus to cliproxyapi++ across various configuration files, Docker images, and documentation to reflect the new branding.
  • Expanded CLI Login Options: New command-line flags were added to facilitate login for a wider range of LLM providers, including Roo Code, MiniMax, DeepSeek, Groq, Mistral, SiliconFlow, OpenRouter, Together AI, Fireworks AI, and Novita AI, alongside an interactive setup wizard.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .env.example
    • Updated with Docker runtime configuration variables.
  • .github/ISSUE_TEMPLATE/bug_report.md
    • Updated the bug report template with more specific fields for cliproxyapi++ configuration and environment information.
  • .github/policies/approved-external-endpoints.txt
    • Added a new policy file listing approved external endpoint hosts.
  • .github/release-required-checks.txt
    • Added a new file listing required checks for release workflows.
  • .github/required-checks.txt
    • Added a new file listing general required checks for pull requests.
  • .github/scripts/check-approved-external-endpoints.sh
    • Added a new script to check for unapproved external endpoints in the codebase.
  • .github/scripts/check-distributed-critical-paths.sh
    • Added a new script to validate filesystem-sensitive, ops endpoint, compute/cache-sensitive, queue telemetry, and signature cache paths.
  • .github/scripts/check-docs-secret-samples.sh
    • Added a new script to scan documentation for potential secret samples.
  • .github/scripts/check-open-items-fragmented-parity.sh
    • Added a new script to check for status drift in fragmented open-items reports.
  • .github/scripts/check-workflow-token-permissions.sh
    • Added a new script to validate GitHub Actions workflow token permissions.
  • .github/scripts/release-lint.sh
    • Added a new script to lint release-facing configuration examples and documentation snippets.
  • .github/scripts/tests/check-open-items-fragmented-parity-test.sh
    • Added a new test script for the check-open-items-fragmented-parity.sh script.
  • .github/scripts/tests/fixtures/open-items-parity/fail-missing-status.md
    • Added a new fixture file for testing open-items parity checks.
  • .github/scripts/tests/fixtures/open-items-parity/fail-status-partial.md
    • Added a new fixture file for testing open-items parity checks.
  • .github/scripts/tests/fixtures/open-items-parity/pass-hash-status-done.md
    • Added a new fixture file for testing open-items parity checks.
  • .github/scripts/tests/fixtures/open-items-parity/pass-status-implemented.md
    • Added a new fixture file for testing open-items parity checks.
  • .gitignore
    • Updated to include new build artifacts, git cache, and documentation node modules.
  • .golangci.yml
    • Added a new configuration file for golangci-lint.
  • .goreleaser.yml
    • Updated build and archive IDs and binary names from cli-proxy-api-plus to cliproxyapi++.
  • .pre-commit-config.yaml
    • Added a new pre-commit configuration file for quality checks.
  • CHANGELOG.md
    • Added a new changelog file with an 'Unreleased' section.
  • CONTRIBUTING.md
    • Added a new contributing guide with details on bug reporting, enhancements, pull requests, and governance.
  • Dockerfile
    • Updated to rename the binary to cliproxyapi++.
    • Added sed to the base image.
    • Copied docker-init.sh.
    • Exposed additional ports.
    • Set environment variables for runtime configuration.
  • LICENSE
    • Updated copyright year and added KooshaPari's copyright.
  • README.md
    • Updated to reflect the new cliproxyapi++ branding.
    • Provided a detailed project overview, technical differences, quick start guide, provider capabilities, contributing guidelines, and documentation links.
  • README_CN.md
    • Updated the Chinese README to reflect the new cliproxyapi++ branding.
    • Provided a detailed project overview, technical differences, quick start guide, provider capabilities, contributing guidelines, and documentation links.
  • README_FA.md
    • Added a new Farsi README.
  • SECURITY.md
    • Added a new security policy document outlining supported versions, vulnerability reporting, and hardening measures.
  • Taskfile.yml
    • Added a new Taskfile for unified development experience, including build, test, quality, and Docker operations.
  • cmd/boardsync/main.go
    • Added a new Go program to synchronize GitHub issues, PRs, and discussions into a project board, generating JSON, CSV, and Markdown artifacts.
  • cmd/codegen/main.go
    • Added a new Go program for code generation, specifically for provider configurations and synthesizers.
  • cmd/releasebatch/main.go
    • Added a new Go program to automate release tagging, notes generation, and GitHub release creation.
  • cmd/releasebatch/main_test.go
    • Added unit tests for the releasebatch command.
  • cmd/server/config_path.go
    • Added a new Go file to resolve default configuration file paths based on environment and deployment mode.
  • cmd/server/config_path_test.go
    • Added unit tests for the config_path.go logic.
  • cmd/server/config_validate.go
    • Added a new Go file to strictly validate the configuration file schema.
  • cmd/server/config_validate_test.go
    • Added unit tests for the config_validate.go logic.
  • cmd/server/main.go
    • Updated import paths from internal to pkg/llmproxy.
    • Added new CLI flags for various provider logins and a setup wizard.
    • Included validation for Kiro incognito flags.
  • cmd/server/main_kiro_flags_test.go
    • Added unit tests for Kiro incognito flag validation and setting.
  • config.example.yaml
    • Updated default values for host, port, TLS, and remote management.
    • Removed passthrough-headers.
    • Added new provider configuration examples (Cursor, MiniMax, Roo Code, Kilo, DeepSeek, Groq, Mistral, SiliconFlow, OpenRouter, Together AI, Fireworks AI, Novita AI) and OAuth upstream overrides.
  • docker-compose.yml
    • Updated the Docker image name to KooshaPari/cliproxyapi-plusplus:latest.
    • Added environment variable overrides for Docker runtime configuration.
  • docker-init.sh
    • Added a new shell script as the Docker entrypoint to initialize directories, create a minimal config if none exists, and apply environment variable overrides to the config file.
  • docs/.vitepress/config.ts
    • Added a new VitePress configuration file for documentation generation, including navigation, sidebar, search, footer, and markdown plugins.
  • docs/.vitepress/plugins/content-tabs.ts
    • Added a new TypeScript file implementing a Markdown-it plugin for content tabs and a client-side script for tab behavior.
  • docs/.vitepress/theme/index.ts
    • Added a new TypeScript file to extend the VitePress default theme and inject the content tabs client script.
  • docs/FEATURE_CHANGES_PLUSPLUS.md
    • Added a new document detailing feature changes in cliproxyapi++ compared to the baseline.
  • docs/README.md
    • Added a new documentation map README.
  • docs/api/index.md
    • Added a new API index document.
  • docs/api/management.md
    • Added a new document detailing the Management API.
  • docs/api/openai-compatible.md
    • Added a new document detailing the OpenAI-Compatible API.
  • docs/api/operations.md
    • Added a new document detailing the Operations API.
  • docs/docsets/agent/index.md
    • Added a new docset for agent operators.
  • docs/docsets/agent/operating-model.md
    • Added a new document detailing the agent operating model.
  • docs/docsets/developer/external/index.md
    • Added a new docset for external developers.
  • docs/docsets/developer/external/integration-quickstart.md
    • Added a new document detailing an integration quickstart for external developers.
  • docs/docsets/developer/internal/architecture.md
    • Added a new document detailing the internal architecture for developers.
  • docs/docsets/developer/internal/fragemented/.fragmented-candidates.txt
    • Added a new fragmented candidates file.
  • docs/docsets/developer/internal/fragemented/.migration.log
    • Added a new migration log file.
  • docs/docsets/developer/internal/fragemented/DEV.md
    • Added a new fragmented DEV.md file.
  • docs/docsets/developer/internal/fragemented/README.md
    • Added a new fragmented README.md file.
  • docs/docsets/developer/internal/fragemented/SPEC.md
    • Added a new fragmented SPEC.md file.
  • docs/docsets/developer/internal/fragemented/USER.md
    • Added a new fragmented USER.md file.
  • docs/docsets/developer/internal/fragemented/explanation.md
    • Added a new fragmented explanation.md file.
  • docs/docsets/developer/internal/fragemented/index.md
    • Added a new fragmented index.md file.
  • docs/docsets/developer/internal/fragemented/merged.md
    • Added a new fragmented merged.md file.
  • docs/docsets/developer/internal/index.md
    • Added a new docset for internal developers.
  • docs/docsets/index.md
    • Added a new docsets index.
  • docs/docsets/user/index.md
    • Added a new docset for technical users.
  • docs/docsets/user/quickstart.md
    • Added a new quickstart guide for technical users.
  • docs/features/architecture/DEV.md
    • Added a new developer guide for architecture.
  • docs/features/architecture/SPEC.md
    • Added a new technical specification for architecture.
  • docs/features/architecture/USER.md
    • Added a new user guide for architecture.
  • docs/features/architecture/fragemented/.fragmented-candidates.txt
    • Added a new fragmented candidates file.
  • docs/features/architecture/fragemented/.migration.log
    • Added a new migration log file.
  • docs/features/architecture/fragemented/DEV.md
    • Added a new fragmented DEV.md file.
  • docs/features/architecture/fragemented/README.md
    • Added a new fragmented README.md file.
  • docs/features/architecture/fragemented/SPEC.md
    • Added a new fragmented SPEC.md file.
  • docs/features/architecture/fragemented/USER.md
    • Added a new fragmented USER.md file.
  • docs/features/architecture/fragemented/explanation.md
    • Added a new fragmented explanation.md file.
  • docs/features/architecture/fragemented/index.md
    • Added a new fragmented index.md file.
  • docs/features/architecture/fragemented/merged.md
    • Added a new fragmented merged.md file.
  • docs/features/auth/DEV.md
    • Added a new developer guide for authentication.
  • docs/features/auth/SPEC.md
    • Added a new technical specification for authentication.
  • docs/features/auth/USER.md
    • Added a new user guide for authentication.
  • docs/features/auth/index.md
    • Added a new authentication feature docs index.
  • docs/features/index.md
    • Added a new feature guides index.
  • docs/features/operations/SPEC.md
    • Added a new technical specification for operations.
  • docs/features/operations/USER.md
    • Added a new user guide for operations.
  • docs/features/operations/index.md
    • Added a new operations feature docs index.
  • docs/features/providers/SPEC.md
    • Added a new technical specification for providers.
  • docs/features/providers/USER.md
    • Added a new user guide for providers.
  • docs/features/providers/fragemented/.fragmented-candidates.txt
    • Added a new fragmented candidates file.
  • docs/features/providers/fragemented/.migration.log
    • Added a new migration log file.
  • docs/features/providers/fragemented/README.md
    • Added a new fragmented README.md file.
  • docs/features/providers/fragemented/SPEC.md
    • Added a new fragmented SPEC.md file.
  • docs/features/providers/fragemented/USER.md
    • Added a new fragmented USER.md file.
  • docs/features/providers/fragemented/explanation.md
    • Added a new fragmented explanation.md file.
  • docs/features/providers/fragemented/index.md
    • Added a new fragmented index.md file.
  • docs/features/providers/fragemented/merged.md
    • Added a new fragmented merged.md file.
  • docs/features/security/SPEC.md
    • Added a new technical specification for security.
  • docs/features/security/USER.md
    • Added a new user guide for security.
  • docs/features/security/index.md
    • Added a new security feature docs index.
  • docs/getting-started.md
    • Added a new getting started guide.
  • docs/guides/CHANGELOG_ENTRY_TEMPLATE.md
    • Added a new changelog entry template.
  • docs/guides/CHANGELOG_PROCESS.md
    • Added a new changelog process guide.
  • docs/guides/PROJECT_SETUP_STYLE.md
    • Added a new project setup style guide.
  • docs/guides/release-batching.md
    • Added a new release batching guide.
  • docs/index.md
    • Added a new main documentation index.
  • docs/install.md
    • Added a new installation guide.
  • docs/operations/auth-refresh-failure-symptom-fix.md
    • Added a new document for auth refresh failure symptoms and fixes.
  • docs/operations/checks-owner-responder-map.md
    • Added a new document mapping checks to owner responders.
  • docs/operations/critical-endpoints-curl-pack.md
    • Added a new document with critical endpoints curl commands.
  • docs/operations/distributed-fs-compute-status.md
    • Added a new document detailing distributed filesystem and compute status.
  • docs/operations/index.md
    • Added a new operations response kit index.
  • docs/operations/provider-outage-triage-quick-guide.md
    • Added a new quick guide for provider outage triage.
  • docs/operations/release-governance.md
    • Added a new release governance and checklist document.
  • docs/operations/required-branch-check-ownership.md
    • Added a new document detailing required branch check ownership.
Ignored Files
  • Ignored by pattern: .github/workflows/** (8)
    • .github/workflows/ci-rerun-flaky.yml
    • .github/workflows/codeql.yml
    • .github/workflows/pr-path-guard.yml
    • .github/workflows/pr-test-build.yml
    • .github/workflows/release-batch.yaml
    • .github/workflows/release.yaml
    • .github/workflows/required-check-names-guard.yml
    • .github/workflows/vitepress-pages.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a significant refactoring and rebranding of the project to 'cliproxyapi++', along with a transition to a library-first architecture. While the intent is clear and the architectural improvements are valuable, the current changes introduce several critical compilation regressions in the server command and some non-portable or brittle logic in scripts and tools. Specifically, several variables and functions used in cmd/server/main.go are not declared or defined, which will prevent the application from building. Additionally, there are regex bugs in CI scripts and hardcoded values in experimental tools that should be addressed to ensure maintainability and portability.

Comment on lines +291 to +303
if showConfigPaths {
selected, candidates := resolveDefaultConfigPathWithCandidates(wd, isCloudDeploy)
fmt.Println("Config path candidates:")
if strings.TrimSpace(configPath) != "" {
fmt.Printf("* %s [from --config]\n", configPath)
}
printConfigCandidates(selected, candidates)
fmt.Printf("Selected: %s\n", selected)
if _, err := fmt.Fprintf(os.Stdout, "Template: %s\n", filepath.Join(wd, "config.example.yaml")); err != nil {
log.Errorf("failed to print config template path: %v", err)
}
return
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This block introduces a critical compilation error. The variable showConfigPaths is used but not declared anywhere in the main function or as a global variable. Furthermore, the functions resolveDefaultConfigPathWithCandidates and printConfigCandidates are called but not defined in this file or any other file in the main package. This regression contradicts the PR title 'fix: resolve executor compile regressions'.

Items: board,
}

const base = "CLIPROXYAPI_2000_ITEM_EXECUTION_BOARD_2026-02-22"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename base is hardcoded with a specific date ('2026-02-22'). If this tool is intended for ongoing use, the filename should be generated dynamically using the current date to avoid overwriting or using stale names.

desc: "Auto format Go source files with gofmt"
cmds:
- |
mapfile -t go_files < <(find . -name "*.go" -type f -not -path "./vendor/*")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of mapfile is a Bash-specific feature (version 4+) and is not portable. It will fail on systems where /bin/sh is not Bash (like Debian/Ubuntu's dash) or on older versions of Bash (like the default on macOS). Since the Docker image uses Alpine Linux, which uses busybox ash by default, this command will fail if executed within the container environment. Consider using a more portable way to iterate over files or use xargs.


if [ -n "${CLIPROXY_SECRET_KEY}" ]; then
echo "[docker-init] Setting management secret-key from env"
sed -i "s/secret-key:.*/secret-key: \"${CLIPROXY_SECRET_KEY}\"/" "${CONFIG_FILE}" 2>/dev/null || \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using sed with / as a delimiter is brittle when the replacement value (like ${CLIPROXY_SECRET_KEY}) might contain the delimiter character itself. If the secret key contains a /, the sed command will fail. It is safer to use a different delimiter like | or #, or better yet, handle these overrides natively within the Go application using environment variables.

"[REDACTED",
]

fence_pattern = re.compile(r"```([\\w-]+)\s*\n(.*?)\n```", re.S)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The regex r"```([\\w-]+)..." in the Python block contains an extra backslash. In a Python raw string, \\w matches a literal backslash followed by 'w'. It should be r"```([\w-]+)..." to correctly match word characters (like 'json' or 'yaml') in markdown code fences.

References
  1. Regex patterns should be correctly escaped to match intended characters. (link)

Comment on lines +1 to +5
# CLIProxyAPI Plus

[English](README.md) | 中文

这是 [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) 的 Plus 版本,在原有基础上增加了第三方供应商的支持。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The content of README_FA.md appears to be Chinese and refers to the old project name 'CLIProxyAPI Plus'. This is inconsistent with the filename (which suggests Persian/Farsi) and the rebranding to 'cliproxyapi++' seen in other files.

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic hashing algorithm on sensitive data High

Sensitive data (password)
is used in a hashing algorithm (SHA256) that is insecure for password hashing, since it is not a computationally expensive hash function.
Sensitive data (password)
is used in a hashing algorithm (SHA256) that is insecure for password hashing, since it is not a computationally expensive hash function.
return
}
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason))
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to apiKeyModelAlias
flows to a logging call.
}

func logCodexWebsocketDisconnected(sessionID string, authID string, wsURL string, reason string, err error) {
if err != nil {
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason), err)
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason), err)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to apiKeyModelAlias
flows to a logging call.
}

func logCodexWebsocketDisconnected(sessionID string, authID string, wsURL string, reason string, err error) {
if err != nil {
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL), strings.TrimSpace(reason), err)
log.Infof("codex websockets: upstream disconnected session=%s auth=%s url=%s reason=%s err=%v", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL), strings.TrimSpace(reason), err)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to apiKeyModelAlias
flows to a logging call.
@@ -1290,15 +1295,34 @@
}

func logCodexWebsocketConnected(sessionID string, authID string, wsURL string) {
log.Infof("codex websockets: upstream connected session=%s auth=%s url=%s", strings.TrimSpace(sessionID), strings.TrimSpace(authID), strings.TrimSpace(wsURL))
log.Infof("codex websockets: upstream connected session=%s auth=%s url=%s", strings.TrimSpace(sessionID), sanitizeCodexWebsocketLogField(authID), sanitizeCodexWebsocketLogURL(wsURL))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to apiKeyModelAlias
flows to a logging call.
@@ -49,13 +54,29 @@
return fmt.Errorf("failed to marshal token storage: %w", err)
}

if err := os.WriteFile(authFilePath, data, 0600); err != nil {
if err := os.WriteFile(cleanPath, data, 0600); err != nil {

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
@@ -39,7 +40,11 @@

// SaveTokenToFile persists the token storage to the specified file path.
func (s *KiroTokenStorage) SaveTokenToFile(authFilePath string) error {
dir := filepath.Dir(authFilePath)
cleanPath, err := cleanTokenPath(authFilePath, "kiro token")

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a user-provided value.
This path depends on a user-provided value.

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by HTTP request headers
flows to a logging call.
if normalized == "." {
return "/"
}
if !strings.HasPrefix(normalized, "/") {

Check warning

Code scanning / CodeQL

Bad redirect check Medium

This is a check that
this value
, which flows into a
redirect
, has a leading slash, but not that it does not have '/' or '' in its second position.
if normalized == "" {
return "/"
}
if !strings.HasPrefix(normalized, "/") {

Check warning

Code scanning / CodeQL

Bad redirect check Medium

This is a check that
this value
, which flows into a
redirect
, has a leading slash, but not that it does not have '/' or '' in its second position.
This is a check that
this value
, which flows into a
redirect
, has a leading slash, but not that it does not have '/' or '' in its second position.
@KooshaPari

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants