Skip to content

Conversation

@Duzzann
Copy link

@Duzzann Duzzann commented Oct 10, 2025

Fixes #1475
Changed all references of PLATFORM_WALLET_PASSWORD to PLATFORM_WALLET_KEY across the codebase and configuration files.

Summary by CodeRabbit

  • Chores

    • Renamed public environment variable PLATFORM_WALLET_PASSWORD → PLATFORM_WALLET_KEY. Services now read the new variable. Action required: update your environment and deployment settings to use PLATFORM_WALLET_KEY.
  • Documentation

    • Updated example and demo environment files to use PLATFORM_WALLET_KEY so samples match runtime configuration.

@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Renamed environment variable PLATFORM_WALLET_PASSWORD → PLATFORM_WALLET_KEY in .env.demo and .env.sample, and updated apps/agent-service/src/main.ts to read PLATFORM_WALLET_KEY when constructing the IAgentSpinupDto payload. No control flow or type changes.

Changes

Cohort / File(s) Summary
Env templates
.env.demo, .env.sample
Renamed PLATFORM_WALLET_PASSWORDPLATFORM_WALLET_KEY; preserved comments and values.
Agent service init
apps/agent-service/src/main.ts
Switched payload construction to use process.env.PLATFORM_WALLET_KEY (formerly PLATFORM_WALLET_PASSWORD) when building IAgentSpinupDto.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Main as apps/agent-service/src/main.ts
    participant Env as Environment
    participant AgentProv as Agent Provisioner

    rect rgb(250,250,255)
    Note over Env,Main: Startup — read configuration
    Main->>Env: read PLATFORM_WALLET_KEY
    Env-->>Main: return walletKey
    end

    rect rgb(245,255,245)
    Note over Main,AgentProv: Build & send spinup payload
    Main->>AgentProv: IAgentSpinupDto { walletKey: PLATFORM_WALLET_KEY, ... }
    AgentProv-->>Main: provision result
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Thump-thump, I found a brand new key,
Renamed with care beneath the tree.
Env lines swapped and code aligned,
The wallet wakes with name refined.
Hooray — hop on, the build is keyed! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately reflects the primary change in this pull request by clearly stating the renaming of the environment variable from PLATFORM_WALLET_PASSWORD to PLATFORM_WALLET_KEY, and it does so concisely without extraneous detail. It uses straightforward phrasing that a teammate scanning the history will immediately understand. The title focuses on the main change and omits unnecessary noise.
Linked Issues Check ✅ Passed This pull request renames the environment variable in both the sample and demo env files and updates the code in main.ts to reference PLATFORM_WALLET_KEY instead of the old name, fully satisfying the objective of issue #1475. All references to PLATFORM_WALLET_PASSWORD have been replaced and existing behavior is preserved. The changes align exactly with the linked issue’s requirements.
Out of Scope Changes Check ✅ Passed All modifications in this pull request pertain solely to renaming the environment variable and updating the corresponding code references to PLATFORM_WALLET_KEY. There are no unrelated feature additions, refactorings, or configuration changes beyond the scope of issue #1475. The diff exclusively touches the intended files and logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69b8f27 and 4e43cd4.

📒 Files selected for processing (3)
  • .env.demo (1 hunks)
  • .env.sample (1 hunks)
  • apps/agent-service/src/main.ts (1 hunks)
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.env.sample

[warning] 94-94: [SpaceCharacter] The line has spaces around equal sign

(SpaceCharacter)


[warning] 94-94: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)


[warning] 94-94: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

.env.demo

[warning] 53-53: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 53-53: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)

🪛 Gitleaks (8.28.0)
.env.demo

[high] 53-53: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (2)
apps/agent-service/src/main.ts (1)

32-32: LGTM!

The code correctly reads from the renamed environment variable PLATFORM_WALLET_KEY. The property name walletPassword is preserved for interface compatibility, which is appropriate.

.env.demo (1)

53-53: LGTM!

The environment variable rename is correct, and the encrypted value is properly preserved.

@Duzzann Duzzann force-pushed the fix/env-var-wallet-key branch from 4e43cd4 to 4f8fc31 Compare October 10, 2025 12:51
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
.env.sample (1)

94-94: Fix wording, ordering, spacing, and quoting for PLATFORM_WALLET_KEY

  • Update text to “encrypted key”.
  • Put KEY before NAME.
  • Remove spaces around '='.
  • Quote the placeholder to satisfy linter.

Apply this diff:

-PLATFORM_WALLET_NAME=platform-admin
-PLATFORM_WALLET_KEY=      // Please provide encrypt password using crypto-js
+PLATFORM_WALLET_KEY="// Please provide encrypted key using crypto-js"
+PLATFORM_WALLET_NAME=platform-admin

Verify no stale references remain:

#!/bin/bash
# Check for any remaining references to the old env name
rg -n 'PLATFORM_WALLET_PASSWORD' --type-add 'env:*.env*' --type env --type ts --type tsx --type js --type json --type yaml --type md -S -C2
🧹 Nitpick comments (1)
.env.demo (1)

53-53: Tidy up key order and remove quotes to satisfy dotenv-linter

Place PLATFORM_WALLET_KEY before PLATFORM_WALLET_NAME and drop unnecessary quotes.

Apply this diff:

-PLATFORM_WALLET_NAME=platform-admin
-PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
+PLATFORM_WALLET_KEY=U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc=
+PLATFORM_WALLET_NAME=platform-admin
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e43cd4 and 4f8fc31.

📒 Files selected for processing (3)
  • .env.demo (1 hunks)
  • .env.sample (1 hunks)
  • apps/agent-service/src/main.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/agent-service/src/main.ts
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.env.demo

[warning] 53-53: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 53-53: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)

.env.sample

[warning] 94-94: [SpaceCharacter] The line has spaces around equal sign

(SpaceCharacter)


[warning] 94-94: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)


[warning] 94-94: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

@Duzzann Duzzann force-pushed the fix/env-var-wallet-key branch from 853cfdf to b3f9712 Compare October 10, 2025 12:57
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.env.sample (1)

94-94: Trim spaces around = to satisfy dotenv-linter.

dotenv-linter now flags this line for SpaceCharacter; please drop the extra spaces so the assignment reads PLATFORM_WALLET_KEY=// ….

Based on static analysis hints

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 853cfdf and b3f9712.

📒 Files selected for processing (1)
  • .env.sample (1 hunks)
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.env.sample

[warning] 94-94: [SpaceCharacter] The line has spaces around equal sign

(SpaceCharacter)


[warning] 94-94: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)


[warning] 94-94: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

@Duzzann Duzzann force-pushed the fix/env-var-wallet-key branch from 63aecc6 to 70a48f2 Compare October 10, 2025 15:00
@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.env.demo (1)

52-53: Consider alphabetical ordering of environment variables.

The static analysis tool suggests that PLATFORM_WALLET_KEY should be ordered before PLATFORM_WALLET_NAME for consistency. While this is a minor style preference, it can improve readability if your team follows alphabetical ordering conventions.

If alphabetical ordering is preferred, apply this diff:

-PLATFORM_WALLET_NAME=platform-admin
 PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
+PLATFORM_WALLET_NAME=platform-admin
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3f9712 and 70a48f2.

📒 Files selected for processing (2)
  • .env.demo (1 hunks)
  • apps/agent-service/src/main.ts (1 hunks)
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.env.demo

[warning] 53-53: [TrailingWhitespace] Trailing whitespace detected

(TrailingWhitespace)


[warning] 53-53: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)

🪛 Gitleaks (8.28.0)
.env.demo

[high] 53-53: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (3)
.env.demo (2)

53-53: Dismiss the 'Generic API Key' warning from static analysis.

The static analysis tool flagged this line as containing a generic API key. However, this is a false positive. The value U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc= is an encrypted string (notice the U2FsdGVkX19 prefix, which is the base64 encoding of "Salted__" from crypto-js encryption), not a plaintext API key. This is actually a security best practice.


53-53: PLATFORM_WALLET_PASSWORD references removed Verified that no occurrences of the old variable remain in the codebase.

apps/agent-service/src/main.ts (1)

30-42: Environment variable change looks correct.

The change from process.env.PLATFORM_WALLET_PASSWORD to process.env.PLATFORM_WALLET_KEY correctly implements the PR objective. The property name walletPassword in the IAgentSpinupDto interface appropriately remains unchanged, as it represents the semantic meaning of the field, while the environment variable name has been updated for consistency.


PLATFORM_WALLET_NAME=platform-admin
PLATFORM_WALLET_PASSWORD='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix trailing whitespace.

There is trailing whitespace at the end of line 53. Please remove it to maintain consistent formatting.

Apply this diff to remove the trailing whitespace:

-PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc=' 
+PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
PLATFORM_WALLET_KEY='U2FsdGVkX19l6w/PpuicnGBYThBHolzF27oN0JwfWkc='
🧰 Tools
🪛 dotenv-linter (3.3.0)

[warning] 53-53: [TrailingWhitespace] Trailing whitespace detected

(TrailingWhitespace)


[warning] 53-53: [UnorderedKey] The PLATFORM_WALLET_KEY key should go before the PLATFORM_WALLET_NAME key

(UnorderedKey)

🪛 Gitleaks (8.28.0)

[high] 53-53: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🤖 Prompt for AI Agents
In .env.demo around line 53, the line containing PLATFORM_WALLET_KEY has a
trailing whitespace character at the end; remove that trailing space so the line
ends immediately after the value (no extra spaces or tabs), save the file, and
ensure no other trailing whitespace remains on that line.

const agentSpinupPayload: IAgentSpinupDto = {
walletName: process.env.PLATFORM_WALLET_NAME,
walletPassword: process.env.PLATFORM_WALLET_PASSWORD,
walletPassword: process.env.PLATFORM_WALLET_KEY,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix trailing whitespace.

There is trailing whitespace at the end of line 32. Please remove it to maintain consistent formatting.

Apply this diff to remove the trailing whitespace:

-    walletPassword: process.env.PLATFORM_WALLET_KEY, 
+    walletPassword: process.env.PLATFORM_WALLET_KEY,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
walletPassword: process.env.PLATFORM_WALLET_KEY,
walletPassword: process.env.PLATFORM_WALLET_KEY,
🤖 Prompt for AI Agents
In apps/agent-service/src/main.ts around line 32, there's a trailing whitespace
at the end of the line containing "walletPassword:
process.env.PLATFORM_WALLET_KEY,"; remove the extra space character at
end-of-line so the line ends exactly with the comma (or adjust punctuation if
intended), then save the file and run formatter/linter to ensure consistent
formatting.

@GHkrishna
Copy link
Contributor

Thanks for the PR @Duzzann. Looks good to me, mind having the minor nit picks from coderabbit resolved?
We'll get it merged

@GHkrishna GHkrishna self-requested a review October 14, 2025 05:40
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.

fix: change env variable PLATFORM_WALLET_PASSWORD

2 participants