-
Notifications
You must be signed in to change notification settings - Fork 31
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/auth: Add capacity to authorize via playback ID #1714
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #1714 +/- ##
===================================================
+ Coverage 53.61029% 53.86283% +0.25254%
===================================================
Files 75 75
Lines 5055 5074 +19
Branches 1008 1017 +9
===================================================
+ Hits 2710 2733 +23
+ Misses 2001 1999 -2
+ Partials 344 342 -2
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
67cd44b
to
54c8bc4
Compare
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.
LGTM 👍
@@ -16,30 +17,51 @@ type UserOwnedObj = { id: string; deleted?: boolean; userId?: string }; | |||
async function checkUserOwned( | |||
req: Request, | |||
headerName: string, | |||
table: Table<UserOwnedObj> | |||
getter: (id: string) => Promise<UserOwnedObj> |
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.
Nice abstraction!
This will help creating an API to retrieve any kind of resource by playback ID. Coming next.
Oh JavaScript...
448577a
to
8f19629
Compare
c6133bf
to
b06dd40
Compare
This reverts commit b06dd40.
What does this pull request do? Explain your changes. (required)
This is to increment the
/api/auth
API, used by external services that need tobuild on top of the API authorization, to also support authorizing access to a
given playback ID. This playback ID can not only be the canonical playback ID of
assets/streams, but can also be the "aliased" IDs like a dStorage ID.
This will be used in the viewership v2 API when it is accessed with a playback ID filter.
Specific updates (required)
x-livepeer-playback-id
header support to auth APIgetResourceByPlaybackId
at some point)How did you test each of these updates (required)
yarn test
Does this pull request close any open issues?
Implements API-50
Checklist