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: Add createdByTokenName field to assets #2034

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

victorges
Copy link
Member

This is needed to do some analytics on how many assets are being created with API keys or from the dashboard.

Additional changes:

  • Did some cleanup on validateAssetPayload to avoid it growing indefinitely
  • Removed the createdByTokenId from streams which just increases our leakage risk (API keys IDs are the keys themselves)

We need a lot of stuff from the request, and
now something else (req.token). So let's just
send the whole req for simplicity.
The API key ID is basically the ID itself. Let's
stop copying it around so much. This is not really
used anywhere but to leak tokens lol
@victorges victorges requested a review from a team as a code owner February 1, 2024 16:20
Copy link

vercel bot commented Feb 1, 2024

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

Name Status Preview Comments Updated (UTC)
livepeer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2024 4:22pm

Copy link
Member

@gioelecerati gioelecerati left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -182,15 +182,15 @@ function parseUrlToDStorageUrl(
}

export async function validateAssetPayload(
req: Pick<Request, "body" | "user" | "token" | "config">,
Copy link
Member

Choose a reason for hiding this comment

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

Lovely

@victorges victorges merged commit ea9ca84 into master Feb 1, 2024
12 checks passed
@victorges victorges deleted the vg/feat/asset-created-by-token-name branch February 1, 2024 17:16
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.

2 participants