Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rest handler template code for oauth #1499

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions splunk_add_on_ucc_framework/templates/oauth.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ logger = log.Logs().get_logger('{{app_name|lower}}_rh_oauth2_token')
# Map for available proxy type
_PROXY_TYPE_MAP = {
'http': socks.PROXY_TYPE_HTTP,
# comment the below line if your add-on is not compatible with 'http_no_tunnel' protocol
kkedziak-splunk marked this conversation as resolved.
Show resolved Hide resolved
'http_no_tunnel': socks.PROXY_TYPE_HTTP_NO_TUNNEL,
'socks4': socks.PROXY_TYPE_SOCKS4,
'socks5': socks.PROXY_TYPE_SOCKS5,
Expand All @@ -39,7 +40,7 @@ class {{app_name | lower}}_rh_oauth2_token(admin.MConfigHandler):
"""

def __init__(self, *args, **kwargs):
super().__init__(self, *args, **kwargs)
super().__init__(*args, **kwargs)
session_key = self.getSessionKey()
log_level = conf_manager.get_log_level(
logger=logger,
Expand All @@ -49,7 +50,7 @@ class {{app_name | lower}}_rh_oauth2_token(admin.MConfigHandler):
log_stanza="{{log_stanza}}",
log_level_field="{{log_level_field}}"
)
logger.set_level(log_level)
log.Logs().set_level(log_level)

def setup(self):
if self.requestedAction == admin.ACTION_EDIT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# Map for available proxy type
_PROXY_TYPE_MAP = {
'http': socks.PROXY_TYPE_HTTP,
# comment the below line if your add-on is not compatible with 'http_no_tunnel' protocol
'http_no_tunnel': socks.PROXY_TYPE_HTTP_NO_TUNNEL,
'socks4': socks.PROXY_TYPE_SOCKS4,
'socks5': socks.PROXY_TYPE_SOCKS5,
Expand All @@ -39,7 +40,7 @@ class splunk_ta_uccexample_rh_oauth2_token(admin.MConfigHandler):
"""

def __init__(self, *args, **kwargs):
super().__init__(self, *args, **kwargs)
super().__init__(*args, **kwargs)
session_key = self.getSessionKey()
log_level = conf_manager.get_log_level(
logger=logger,
Expand All @@ -49,7 +50,7 @@ def __init__(self, *args, **kwargs):
log_stanza="logging",
log_level_field="loglevel"
)
logger.set_level(log_level)
log.Logs().set_level(log_level)

def setup(self):
if self.requestedAction == admin.ACTION_EDIT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# Map for available proxy type
_PROXY_TYPE_MAP = {
'http': socks.PROXY_TYPE_HTTP,
# comment the below line if your add-on is not compatible with 'http_no_tunnel' protocol
'http_no_tunnel': socks.PROXY_TYPE_HTTP_NO_TUNNEL,
'socks4': socks.PROXY_TYPE_SOCKS4,
'socks5': socks.PROXY_TYPE_SOCKS5,
Expand All @@ -39,7 +40,7 @@ class splunk_ta_uccexample_rh_oauth2_token(admin.MConfigHandler):
"""

def __init__(self, *args, **kwargs):
super().__init__(self, *args, **kwargs)
super().__init__(*args, **kwargs)
session_key = self.getSessionKey()
log_level = conf_manager.get_log_level(
logger=logger,
Expand All @@ -49,7 +50,7 @@ def __init__(self, *args, **kwargs):
log_stanza="logging",
log_level_field="loglevel"
)
logger.set_level(log_level)
log.Logs().set_level(log_level)

def setup(self):
if self.requestedAction == admin.ACTION_EDIT:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
splunktaucclib
httplib2
Loading