Skip to content

Remove unnecessary configs#2700

Merged
thivindu merged 2 commits into
wso2:mainfrom
thivindu:config-interpolation
Jul 15, 2026
Merged

Remove unnecessary configs#2700
thivindu merged 2 commits into
wso2:mainfrom
thivindu:config-interpolation

Conversation

@thivindu

@thivindu thivindu commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This pull request makes several improvements and clarifications to the Platform API configuration files and related documentation, focusing on security, environment variable usage, and listener/TLS configuration. It also updates code comments for accuracy and consistency with the configuration changes.

Resolves: #2682

Configuration and Security Improvements:

  • The configuration files now consistently use api-platform.env instead of the previous keys.env for environment variables, clarifying where secrets should be stored. [1] [2] [3]
  • The JWT and encryption key documentation and comments have been updated to reflect current best practices and environment variable names. [1] [2] [3]
  • The audience configuration for IDP authentication is now clearly documented, with instructions on how to use and override it.

Listener and TLS Configuration:

  • The HTTP and HTTPS listener configuration sections have been restored and clarified in the template, with detailed comments on defaults, overrides, and security considerations. [1] [2] [3]
  • The tls section is now explicitly included and described in the main configuration files, ensuring users know how to set up certificates. [1] [2]

Code and Comment Consistency:

  • References to environment variables and configuration keys in code comments have been updated for accuracy (e.g., APIP_CP_ENCRYPTION_KEY is now described as EncryptionKey, and error messages are clarified). [1] [2]
  • The documentation now consistently refers to the correct environment variable names for file-based users and CORS settings. [1] [2]

Minor Cleanups:

  • Unnecessary or outdated comments and sections have been removed or updated for clarity and conciseness. [1] [2] [3]

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Configuration documentation, JWT startup validation, encryption-key handling, and listener initialization were updated. Environment variables are documented as interpolation inputs, JWT secrets are validated across authentication modes, encryption uses the consolidated setting, and TLS/listener checks occur before startup.

Changes

Platform configuration and startup

Layer / File(s) Summary
Configuration and authentication contract
platform-api/README.md, platform-api/config/config.go, platform-api/config/config.toml, portals/ai-workspace/configs/config-platform-api-template.toml, portals/ai-workspace/configs/config-platform-api.toml, portals/developer-portal/docs/administer/manage-organizations.md
Configuration precedence, JWT secret validation, demo-mode skip validation, IDP variable names, and local authentication guidance were updated.
Consolidated encryption-key usage
platform-api/internal/repository/subscription_repository.go, portals/ai-workspace/configs/*
Subscription token encryption now uses EncryptionKey, with updated missing-key guidance and environment-file references.
Listener and TLS startup flow
platform-api/internal/server/server.go, portals/ai-workspace/configs/config-platform-api-template.toml
Startup validates enabled listener ports and builds TLS configuration before launching listeners; listener, timeout, and CORS configuration guidance was updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: thushani-jayasekera, pubudu538, malinthaprasan, renuka-fernando, tgtshanika

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is informative but does not follow the required template and omits several mandatory sections. Reformat the PR description to the repository template and add the missing sections for user stories, documentation, tests, security checks, samples, related PRs, and test environment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: removing unnecessary configuration content.
Linked Issues check ✅ Passed The PR appears to address issue #2682 by implementing the requested review-comment follow-ups across config, docs, and comments.
Out of Scope Changes check ✅ Passed The changes stay focused on Platform API configuration cleanup, documentation updates, and related comment fixes without obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platform-api/internal/server/server.go`:
- Around line 832-834: Update the warning message in the logger call so the
concatenated literals in the Plain-HTTP listener warning include a separating
space or punctuation after “(http.enabled=true)”. Preserve the existing message
content and logging behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a699ce52-c530-42bd-bb52-0114ae8a6e39

📥 Commits

Reviewing files that changed from the base of the PR and between f59bd67 and 3133da2.

📒 Files selected for processing (8)
  • platform-api/README.md
  • platform-api/config/config.go
  • platform-api/config/config.toml
  • platform-api/internal/repository/subscription_repository.go
  • platform-api/internal/server/server.go
  • portals/ai-workspace/configs/config-platform-api-template.toml
  • portals/ai-workspace/configs/config-platform-api.toml
  • portals/developer-portal/docs/administer/manage-organizations.md
💤 Files with no reviewable changes (1)
  • portals/ai-workspace/configs/config-platform-api.toml

Comment thread platform-api/internal/server/server.go
@thivindu
thivindu merged commit 23c45fc into wso2:main Jul 15, 2026
13 checks passed
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.

[Task]: Address comments in PR #2616

2 participants