outmoded / lout

API documentation generator
Other
276 stars 49 forks source link

Restrict docs #142

Closed furyscript closed 8 years ago

furyscript commented 8 years ago

How can I restrict permissions to route documentation?

I'm thinking http based authentication with nginx proxy, but there is a way to enter in page with some password or similar?

Marsup commented 8 years ago

If you already have an nginx in front of your node yes, currently that's not built-in.

furyscript commented 8 years ago

Uhm ok thanks, is it possible that this feature can be added?? I think that can be only with username and password, without too much hard code :+1:

Marsup commented 8 years ago

If you want it it'll have to be a hapi compatible solution, I'm not going to implement a whole new auth solution just for that.

furyscript commented 8 years ago

ok, so what do you suggest ?

Marsup commented 8 years ago

Like I just said, we need to allow an extension point to provide your own auth.

furyscript commented 8 years ago

Ok, I hope this feature come in the future! In mainwhile I use nginx to do this..

furyscript commented 8 years ago

Hi @Marsup, do you have some news about that? :smile:

Marsup commented 8 years ago

Actually I should have closed this since you can already provide an auth option, so same as any other hapi route.

furyscript commented 8 years ago

So by default, restrict docs won't be implemented? You could simply add two params on the route docs like /docs?username=admin&password=admin :smile: .

Marsup commented 8 years ago

Add this with your custom scheme, look at how auth is done on hapi, maybe basic-auth is enough for your use case, but no I won't be implementing any specific lout auth.