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

project: user: create default project id #2163

Merged
merged 22 commits into from
Jun 7, 2024

Conversation

gioelecerati
Copy link
Member

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

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

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.

Copy link

vercel bot commented May 3, 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 Jun 7, 2024 1:45pm

@gioelecerati gioelecerati marked this pull request as ready for review May 10, 2024 15:30
@gioelecerati gioelecerati requested a review from a team as a code owner May 10, 2024 15:30
@@ -1477,4 +1500,51 @@
}
);

app.post(
"/migrate/userDefaultProject",
authorizer({ anyAdmin: true }),

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
@@ -139,4 +139,47 @@
res.json(project);
});

app.patch("/:id", authorizer({}), async (req, res) => {

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
res.end();
});

app.delete("/:id", authorizer({}), async (req, res) => {

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

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

Good work @gioelecerati 🎖️ I really like where it's heading, plus the mung injection. I think it simplified a lot of things.

Added some inline comments, other than that I tried the following:

Test Result
non-admin token /stream/<id> 🆗
non-admin token /stream 🚫 no projectId included
non-admin token /asset/<id> 🆗
non-admin token /asset 🚫 no projectId included
admin token /stream/<id> 🚫 no projectId included
admin token /stream 🚫 no projectId included
admin token /asset/<id> 🚫 no projectId included
admin token /asset 🚫 no projectId included

Could you please check? I think we should always include projectId in the resource. I checked it in the box.

packages/api/src/controllers/api-token.js Show resolved Hide resolved
packages/api/src/controllers/asset.test.ts Show resolved Hide resolved
packages/api/src/controllers/asset.test.ts Show resolved Hide resolved
packages/api/src/controllers/asset.ts Show resolved Hide resolved
packages/api/src/controllers/helpers.ts Show resolved Hide resolved
packages/api/src/controllers/project.ts Show resolved Hide resolved
packages/api/src/controllers/project.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/user.ts Show resolved Hide resolved
packages/api/src/middleware/auth.ts Show resolved Hide resolved
Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

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

LGTM

@gioelecerati gioelecerati merged commit c39df25 into master Jun 7, 2024
7 of 8 checks passed
@gioelecerati gioelecerati deleted the gio/projects/default-project branch June 7, 2024 13:56
victorges added a commit that referenced this pull request Jun 11, 2024
victorges added a commit that referenced this pull request Jun 11, 2024
victorges added a commit that referenced this pull request Jun 11, 2024
victorges added a commit that referenced this pull request Jun 11, 2024
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