Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def create_app(name):
  2. app = Flask(name)
  3.  
  4. authenticator = HeaderApiKeyAuthenticator(header="X-MyApp-Key")
  5. # The HeaderApiKeyAuthenticator does super simple authentication, designed for
  6. # service-to-service authentication inside of a protected network, by looking for a
  7. # shared secret in the specified header. Here we define what that shared secret is.
  8. authenticator.register_key(key="my-api-key")
  9. registry.set_default_authenticator(authenticator=authenticator)
  10.  
  11. rebar.init_app(app=app)
  12.  
  13. return app
  14.  
  15.  
  16. if __name__ == "__main__":
  17. create_app(__name__).run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement