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

api: Create access-control API for signing keys #1275

Merged
merged 16 commits into from
Sep 23, 2022

Conversation

gioelecerati
Copy link
Member

@gioelecerati gioelecerati commented Sep 14, 2022

What does this pull request do? Explain your changes. (required)

Creates a set of API for signing keys, as first milestone toward access control

Specific updates (required)

  • Create signing key schema
  • POST create up to 10 signing keys, retrieving the private key if the keypair only on creation
  • GET retrieve a list of your existing signing keys, with only the public key
  • DELETE a signing key
  • UPDATE a signing key, disabling it
  • Create a EC P-256 keypair in pem format for JWT generations
  • Tests

How did you test each of these updates (required)

yarn test - postman

Does this pull request close any open issues?

Fixes #1284

Screenshots (optional):

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@gioelecerati gioelecerati requested a review from a team as a code owner September 14, 2022 16:38
@vercel
Copy link

vercel bot commented Sep 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
livepeer-studio ✅ Ready (Inspect) Visit Preview Sep 22, 2022 at 10:01PM (UTC)

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Merging #1275 (63f7781) into master (25b49e4) will increase coverage by 0.30400%.
The diff coverage is 62.88660%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1275         +/-   ##
===================================================
+ Coverage   51.06138%   51.36538%   +0.30400%     
===================================================
  Files             66          68          +2     
  Lines           4334        4431         +97     
  Branches         786         805         +19     
===================================================
+ Hits            2213        2276         +63     
- Misses          1842        1865         +23     
- Partials         279         290         +11     
Impacted Files Coverage Δ
packages/api/src/controllers/signing-key.ts 60.67416% <60.67416%> (ø)
packages/api/src/test-helpers.ts 80.85106% <66.66667%> (-0.46762%) ⬇️
packages/api/src/controllers/access-control.ts 100.00000% <100.00000%> (ø)
packages/api/src/store/db.ts 82.22222% <100.00000%> (+0.19974%) ⬆️
packages/api/src/controllers/helpers.ts 49.67742% <0.00000%> (+1.29032%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25b49e4...63f7781. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/controllers/signing-key.ts 60.67416% <60.67416%> (ø)
packages/api/src/test-helpers.ts 80.85106% <66.66667%> (-0.46762%) ⬇️
packages/api/src/controllers/access-control.ts 100.00000% <100.00000%> (ø)
packages/api/src/store/db.ts 82.22222% <100.00000%> (+0.19974%) ⬆️
packages/api/src/controllers/helpers.ts 49.67742% <0.00000%> (+1.29032%) ⬆️

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

Awesome! Only some smaller nits or questions :)

packages/api/src/controllers/signing-key.test.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.test.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.test.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.test.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/signing-key.ts Outdated Show resolved Hide resolved
packages/api/src/schema/schema.yaml Show resolved Hide resolved
packages/api/src/controllers/signing-key.test.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create signing-keys CRUD API
2 participants