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

User >: Any In SwaggerSecurityExtractors #71

Open
moishy90 opened this issue Mar 17, 2017 · 6 comments
Open

User >: Any In SwaggerSecurityExtractors #71

moishy90 opened this issue Mar 17, 2017 · 6 comments

Comments

@moishy90
Copy link

moishy90 commented Mar 17, 2017

Hey guys. I was looking through the security templates and code and realized that the security extractors have the type parameters User :> Any. For example def basicAuth[User >: Any]:

I'm wondering: Is this a feature, or is this something that should be fixed?

I'd like to wrap the request with the data generated by the authentication process, through play's play.api.mvc.WrappedRequest with the WrappedRequest's type parameter being the type of the generated data.

@moishy90
Copy link
Author

Ah. I see. You don't pass the request over to the code modified by the user. So it doesn't matter. Whatever data that is needed is passed directly by type to the method changed by the user.

@slavaschmidt
Copy link
Collaborator

yeah, we don't pass authentication information to the controller as for now, but there is a ticket for that.

@ashmcleod
Copy link

ashmcleod commented Mar 21, 2017

Hi, any news or ETA on this? I would like to get SecurityExtractors information in my controllers. Is there any way to access that info from the controllers. Or maybe getting de request itself?

Wich one is the ticket realted to this?

@slavaschmidt
Copy link
Collaborator

@ashmcleod Can't find the ticket, may be I've confused it with comments in the code :) You are welcome to create a ticket for that :)

@ashmcleod
Copy link

Hi slavaschmidt,

I think that my request is the same as moishy90's, to be able to get SecurityExtractors generated data in the generated controllers in some way. Do I have to open a new issue for this? or this one may be adecuate?

Is there any way i can get that data modifying de templates?

@slavaschmidt
Copy link
Collaborator

Let's leave it here for now.
The idea is to get the data obtained by the SecurityExtractor directly into the controller as a parameter.
The play.api.mvc.WrappedRequest @moishy90 is talking about is a bit low-level for our approach, I don't have a direct idea how to do this with the API-first approach. It might very well be doable but I can't answer the question right now.

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

3 participants