forked from MathieuLamiot/TechTeamBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide an endpoint to automate the update of the IP list for WP-Rocket
Fixes #49
- Loading branch information
1 parent
999443a
commit 0df6c82
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
This module defines the endpoint handler (called listener) for the Support team endpoints. | ||
""" | ||
|
||
from flask import current_app | ||
from sources.handlers.ServerListHandler import ServerListHandler | ||
|
||
|
||
class SupportListener(): | ||
""" | ||
Class to define the support endpoints handler. It is callable and called when the right url is used. | ||
""" | ||
|
||
def __init__(self): | ||
""" | ||
The listener instanciates the handlers it will pass the request to so that it is processed. | ||
""" | ||
self.server_list_handler = ServerListHandler() | ||
|
||
def get_wprocket_ips(self): | ||
""" | ||
Method generating the list of IPs used by WP Rocket and returning it in a list as a string. | ||
""" | ||
response_payload = self.server_list_handler.generate_wp_rocket_ips(app_context=current_app.app_context()) | ||
return response_payload, 200 |