ubiquity-os / permit-generation

A standalone module to generate permits.
1 stars 19 forks source link

feat: private key formats #59

Closed rndquu closed 1 month ago

rndquu commented 1 month ago

Related to https://github.com/ubiquity/ubiquibot-kernel/issues/104

Right now there is an issue when a malicious partner can copy other partner's encrypted private key and use it in its own organization.

This PR introduces 3 private key formats:

  1. PRIVATE_KEY
  2. PRIVATE_KEY:GITHUB_ORGANIZATION_ID
  3. PRIVATE_KEY:GITHUB_ORGANIZATION_ID:GITHUB_REPOSITORY_ID

You may read how they're supposed to be used here.

The next step is to validate organization and repository in the https://github.com/ubiquibot/conversation-rewards plugin if they are allowed to be used in the organization/repository where original issue was called from.

rndquu commented 1 month ago

The decrypt functions should be exported in src/index.ts if we want to use it in conversation-rewards

Fixed https://github.com/ubiquibot/permit-generation/pull/59/commits/114a9cfd714bb3afba8d278f1fc45e0348e519ba