-
Notifications
You must be signed in to change notification settings - Fork 411
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
fix(api-users): users endpoint expect read:user:list
feature
#494
Conversation
@aprendendofelipe is attempting to deploy a commit to the TabNews Team on Vercel. To accomplish this, @aprendendofelipe needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
beforeEach(async () => { | ||
defaultUser = await orchestrator.createUser(); | ||
defaultUser = await orchestrator.activateUser(defaultUser); | ||
privilegedUser = await orchestrator.createUser(); | ||
privilegedUser = await orchestrator.activateUser(privilegedUser); | ||
privilegedUser = await orchestrator.addFeaturesToUser(privilegedUser, ['read:user:list']); | ||
}); |
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.
Zero impacto nesse caso, mas uma coisa que eu me peguei pensando no passado que queria compartilhar foi o tradeoff entre performance (de criar esses usuários mesmo em testes onde eles não são usados), legibilidade (há uma distância maior entre a declaração e uso das variáveis, mas talvez o maior problema seja quando houver dois privilegedUser
com features diferentes, e daí a criação deles vai estar num contexto longe do uso) e que está casado com refatoração (ta tudo num só lugar, delicinha).
Não mudaria nada, mas só queria compartilhar esse pensamento 🤝
Muito massa por ter respeitado o padrão:
🤝 |
5636dce
to
77f78e6
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Merged! Let's goooooo!!! |
Corrige o problema de segurança no endpoint
api/v1/users
que estava listando todos os usuários e suas propriedades sem exigir a featureread:user:list
e nem mesmo estava exigindo sessão de usuário ativa.Problema relacionado com #186 (comment)