Skip to content
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

Pro 2758 #145

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Pro 2758 #145

merged 4 commits into from
Oct 14, 2024

Conversation

nikhilkumar1612
Copy link
Contributor

Description

  • enabled safe mode for both /saveKey and /deleteKey endpoints.
  • added kms integration for private key encryption.
  • new private keys are generated when a new api key is registered.
  • added authentication for /saveKey and /deleteKey using hmac signature along with timestamp validation.

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Further comments (optional)

  • all changes are tested using a hardcoded bundler api key.
  • private keys are not yet using kms for encryption.
  • balance validation for /deleteKey endpoint includes native balances as well as sponsor balance on native paymasters.
Screenshot 2024-10-08 at 1 00 50 PM Screenshot 2024-10-08 at 1 02 24 PM Screenshot 2024-10-08 at 1 03 56 PM Screenshot 2024-10-08 at 10 12 42 AM

Copy link

linear bot commented Oct 8, 2024

@@ -90,7 +96,10 @@ const configPlugin: FastifyPluginAsync = async (server) => {
EP7_TOKEN_VGL: process.env.EP7_TOKEN_VGL ?? '90000',
EP7_TOKEN_PGL: process.env.EP7_TOKEN_PGL ?? '150000',
EPV_06: process.env.EPV_06?.split(',') ?? ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'],
EPV_07: process.env.EPV_07?.split(',') ?? ['0x0000000071727De22E5E9d8BAf0edAc6f37da032']
EPV_07: process.env.EPV_07?.split(',') ?? ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
DELETE_KEY_RECOVER_WINDOW: parseInt(process.env.DELETE_KEY_RECOVER_WINDOW || '7'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ch4r10t33r using 7 days because only 7-30 days values are allowed for scheduled deletion.

Copy link

cloudflare-workers-and-pages bot commented Oct 10, 2024

Deploying arka with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a7179d
Status: ✅  Deploy successful!
Preview URL: https://40e67923.arka-3qg.pages.dev
Branch Preview URL: https://pro-2758.arka-3qg.pages.dev

View logs

Copy link
Member

@ch4r10t33r ch4r10t33r left a comment

Choose a reason for hiding this comment

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

LGTM

MNEMONIC: mnemonic
}),
});

Copy link
Contributor

Choose a reason for hiding this comment

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

We need to also create a record on the connected db since the sponsorship olivies are handled by that so even in unsafeMode as false create one record on was secrets as above and also include database record creation for the same which also includes addition of policy record by default for the same apiKey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vignesha22 does this mean we have to delete the record also on /deleteKey endpoint ?

Copy link
Contributor

@vignesha22 vignesha22 left a comment

Choose a reason for hiding this comment

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

LGTM

@nikhilkumar1612 nikhilkumar1612 merged commit 2d8bde9 into master Oct 14, 2024
4 checks passed
@nikhilkumar1612 nikhilkumar1612 deleted the PRO-2758 branch October 14, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants