ebowman/api-first-hand

User >: Any In SwaggerSecurityExtractors

moishy90 opened this issue · 6 comments

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.

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.

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

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?

@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 :)

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?

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.