Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions anchor-counter-privy/.claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"permissions": {
"allow": [
"Bash(yarn add *)",
"Bash(node -e \"const p = require\\('@privy-io/react-auth'\\); console.log\\(Object.keys\\(p\\).filter\\(k => k.toLowerCase\\(\\).includes\\('sol'\\) || k.toLowerCase\\(\\).includes\\('wallet'\\) || k.toLowerCase\\(\\).includes\\('privy'\\)\\)\\)\")",
"Bash(python3 -c \"import sys,json; p=json.load\\(sys.stdin\\); print\\(list\\(p.get\\('exports',{}\\).keys\\(\\)\\)[:20]\\)\")",
"Bash(node -e \"const p = require\\('@privy-io/react-auth/solana'\\); console.log\\(Object.keys\\(p\\)\\)\")",
"Bash(python3 -c \"import sys,json; p=json.load\\(sys.stdin\\); exports=p.get\\('exports',{}\\); [print\\(k,'->',v\\) for k,v in exports.items\\(\\) if 'sol' in k.lower\\(\\)]\")",
"Bash(npm list *)",
"Bash(npx cross-env *)"
Comment on lines +4 to +10
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Narrow the Claude Bash allowlist.

These wildcard entries grant effectively arbitrary command execution (yarn add * can run package install scripts, and npx cross-env * can prefix almost any command). That is much broader than the read-only inspection use case described by the rest of this file and makes the checked-in agent config unsafe to reuse as-is.

🤖 Prompt for 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.

In `@anchor-counter-privy/.claude/settings.json` around lines 4 - 10, The
allowlist contains overly-broad wildcard Bash entries like "Bash(yarn add *)",
"Bash(npx cross-env *)" and similar patterns that permit arbitrary command
execution; replace those wildcard entries with a minimal, explicit set of safe
inspection commands or remove them entirely (for example, keep the specific
node/python inspection lines such as the existing "Bash(node -e ...)" and
"Bash(python3 -c ...)" entries) and instead whitelist exact invocations or
read-only flags (no "*" wildcards) for symbols like "Bash(yarn add *)",
"Bash(npm list *)", and "Bash(npx cross-env *)" so the agent can only run
predefined, read-only commands.

]
}
}
4 changes: 4 additions & 0 deletions anchor-counter-privy/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PROVIDER_ENDPOINT=https://api.devnet.solana.com
EPHEMERAL_PROVIDER_ENDPOINT=
ROUTER_ENDPOINT=
TEE_PROVIDER_ENDPOINT=
23 changes: 23 additions & 0 deletions anchor-counter-privy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.DS_Store
.idea
**/*.rs.bk
**/target/*
**/node_modules
**/test-ledger
**/.anchor
**/.bolt
**/.yarn
**/.next/
**/.env
**/magicblock-test-storage
Comment on lines +11 to +12
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Ignore local env variants too.

Line 11 only ignores files named exactly .env, so client/.env.local and other .env.*.local files in this template can still be committed. That is a real leak path for local Privy/app endpoint configuration.

Suggested fix
 **/.env
+**/.env.local
+**/.env.*.local
+!**/.env.example
📝 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
**/.env
**/magicblock-test-storage
**/.env
**/.env.local
**/.env.*.local
!**/.env.example
**/magicblock-test-storage
🤖 Prompt for 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.

In `@anchor-counter-privy/.gitignore` around lines 11 - 12, The .gitignore
currently only excludes files named exactly "**/.env", which still allows
variants like ".env.local" or ".env.*" to be committed; update the ignore
patterns to cover env variants by replacing or supplementing the existing
"**/.env" entry with broader patterns such as "**/.env*" and "**/.env.*" (and
optionally specific ones like "**/.env.local" / "**/.env.production") so all
local env variants are ignored while keeping the existing
"**/magicblock-test-storage" entry intact.

!target/deploy/
target/deploy/*
!target/deploy/*-keypair.json
!/bolt-counter/target/deploy/counter-keypair.json
!/bolt-counter/target/deploy/increase-keypair.json

# But don't ignore the target/idl/ directory
!**/anchor-minter/target/idl/
!**/anchor-counter/target/idl/
!**/anchor-minter/target/deploy/anchor-counter/magicblock-test-storage/
anchor-counter/magicblock-test-storage/
16 changes: 16 additions & 0 deletions anchor-counter-privy/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[toolchain]
anchor_version = "1.0.2"

[features]
resolution = true
skip-lint = false

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "../fullstack-test.sh"
Loading