-
Notifications
You must be signed in to change notification settings - Fork 602
[dashboard] add solana policies to vault access token #8239
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -560,6 +560,98 @@ export async function createWalletAccessToken(props: { | |
], | ||
type: "eoa:create", | ||
}, | ||
{ | ||
metadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:read", | ||
}, | ||
{ | ||
requiredMetadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:create", | ||
}, | ||
{ | ||
metadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:signTransaction", | ||
}, | ||
{ | ||
metadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:signMessage", | ||
}, | ||
], | ||
}, | ||
}, | ||
|
@@ -633,6 +725,52 @@ async function createManagementAccessToken(props: { | |
], | ||
type: "eoa:create", | ||
}, | ||
{ | ||
metadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:read", | ||
}, | ||
{ | ||
requiredMetadataPatterns: [ | ||
{ | ||
key: "projectId", | ||
rule: { | ||
pattern: props.project.id, | ||
}, | ||
}, | ||
{ | ||
key: "teamId", | ||
rule: { | ||
pattern: props.project.teamId, | ||
}, | ||
}, | ||
{ | ||
key: "type", | ||
rule: { | ||
pattern: "server-wallet", | ||
}, | ||
}, | ||
], | ||
type: "solana:create", | ||
}, | ||
Comment on lines
+728
to
+773
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Approve Solana management policies. The Solana management token policies are correctly limited to read and create operations (no signing), which matches the EVM policy structure. This is the appropriate permission model for management tokens. The same helper function refactor suggested for lines 563-654 would reduce duplication here as well. Both 🤖 Prompt for AI Agents
|
||
{ | ||
metadataPatterns: [ | ||
{ | ||
|
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.
🛠️ Refactor suggestion | 🟠 Major
Approve Solana wallet policies with refactor recommendation.
The Solana policy additions correctly mirror the existing EVM policy structure and will enable Solana wallet operations. However, the identical
metadataPatterns
structure across all policies creates significant duplication.Consider extracting a helper function to generate policy objects:
Then replace the policy blocks:
This would also address the pre-existing duplicate
eoa:read
andeoa:create
policies at lines 351-396 and 517-562.🤖 Prompt for AI Agents