I've reviewed the documentation at http://cherrypy.readthedocs.io/en/latest/basics.html#authentication in order to understand how to send my API call to Cherrypy and validate an API key that I'll have in the header of the HTTP request that I'll send from my client side program. The header will follow Basic Authorization with the header having the following example key and value Example: Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
Then I want the Cherrypy function that I write to run only after some authorization has be completed. From the client, I'll call my function like: https:///myfunction?param1=value¶m2=value¶m3=value with the Basic Authorization header set up as seen above
and in Cherrypy I'll code the function like:
@cherrypy.expose def myfunction(self, param1=1,param2=cat,param3=dog): # do my work in the function return
Note: the function will not have a user enter any credentials. The call will pre-populate the basic authorization header programmatically.
Can you set up the Cherrypy code example in such a way to explicitly show me how this can be achieved. Assume a beginner with Cherrypy (e.g. did the first 5 or so tutorials only ( http://docs.cherrypy.org/en/latest/tutorials.html#tutorials ). Thanks much.