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

feat(Exercise): get vote from the connected user when accessing one exercise #28

Closed
dewita opened this issue Dec 29, 2019 · 1 comment
Closed

Comments

@dewita
Copy link
Collaborator

dewita commented Dec 29, 2019

No description provided.

@jy95
Copy link
Member

jy95 commented Dec 31, 2019

The only solution ( if not a new endpoint ) is to tweak current structure to do that

What are the problems :

  • The endpoint /api/exercises/{id} OAS :
    It doesn't need a security check from now so to detect the user, you use add the authorization header when you want the user vote but keep the endpoint accessible to guest too : security must be optional
security:
  - {}
  - bearerAuth: []

( Stackoverflow source and Link to explanation )

( TODO : check how openapi-enforcer will handle this case )

How it is highly likely that other endpoints will undergo the same logic of optionality, the cleanest way to deal with this kind of case is to introduce some code to detect that

I'm going to see how I'm going to deal with these problems today ...

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

No branches or pull requests

2 participants