-
Notifications
You must be signed in to change notification settings - Fork 71
fix: rename PLATFORM_WALLET_PASSWORD to PLATFORM_WALLET_KEY #1477
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?
Conversation
WalkthroughRenamed environment variable PLATFORM_WALLET_PASSWORD → PLATFORM_WALLET_KEY in Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 namewalletPasswordis 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.
Signed-off-by: Duzzann <[email protected]>
4e43cd4 to
4f8fc31
Compare
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.
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-adminVerify 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-linterPlace 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
📒 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)
Signed-off-by: Duzzann <[email protected]>
853cfdf to
b3f9712
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.env.sample (1)
94-94: Trim spaces around=to satisfy dotenv-linter.
dotenv-linternow flags this line forSpaceCharacter; please drop the extra spaces so the assignment readsPLATFORM_WALLET_KEY=// ….Based on static analysis hints
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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)
Signed-off-by: Duzzann <[email protected]>
63aecc6 to
70a48f2
Compare
|
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.
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_KEYshould be ordered beforePLATFORM_WALLET_NAMEfor 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
📒 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 theU2FsdGVkX19prefix, 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_PASSWORDtoprocess.env.PLATFORM_WALLET_KEYcorrectly implements the PR objective. The property namewalletPasswordin theIAgentSpinupDtointerface 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=' |
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.
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.
| 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, |
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.
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.
| 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.
|
Thanks for the PR @Duzzann. Looks good to me, mind having the minor nit picks from coderabbit resolved? |



Fixes #1475
Changed all references of PLATFORM_WALLET_PASSWORD to PLATFORM_WALLET_KEY across the codebase and configuration files.
Summary by CodeRabbit
Chores
Documentation