hug
hug copied to clipboard
Apply requires to extend_api
Is there currently a way to achieve this?
@hug.extend_api ('/backoffice', requires = token_key_authentication)
def extend_api_backoffice():
import backoffice
return (backoffice,)
or
hug_auth = hug.http (requires = token_key_authentication)
@hug_auth.extend_api ('/backoffice')
def extend_api_backoffice():
import backoffice
return (backoffice,)
I would also like to know if there is a way to extend like that
I am having the same question; I have one main API file in which I extend functionality with different files, by making use of the @hug.extend_api directive. I would like to secure this at the main API file, so I don't have to put in authentication in the other files.
@timothycrosley, does 287933cab78652d0535ea5b93d87fa161e9feabe look correct to do this?