Skip to content

Commit

Permalink
Re-writing main branch history to be common with next branch
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and pzhou-splunk committed Nov 16, 2021
1 parent 3d2149e commit 87e5df5
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 335 deletions.
12 changes: 1 addition & 11 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# File: __init__.py
#
# Copyright (c) 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions
# and limitations under the License.
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
16 changes: 3 additions & 13 deletions adldap_connector.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# File: adldap_connector.py
#
# Copyright (c) 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions
# and limitations under the License.
#
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)


# Phantom App imports
import phantom.app as phantom
# import json
Expand Down
14 changes: 3 additions & 11 deletions adldap_view.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# File: adldap_view.py
#
# Copyright (c) 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions
# and limitations under the License.
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)


def get_ctx_result(result):
ctx_result = {}
param = result.get_param()
Expand Down
220 changes: 0 additions & 220 deletions notes.md

This file was deleted.

45 changes: 45 additions & 0 deletions query_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# File: query_view.py
# Copyright (c) 2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)


def get_ctx_result(result):
ctx_result = {}
param = result.get_param()
summary = result.get_summary()
data = result.get_data()

ctx_result['param'] = param

if (data):
ctx_result['data'] = data[0]

if (summary):
ctx_result['summary'] = summary

return ctx_result


def display_attributes(provides, all_app_runs, context):
context['results'] = results = []
context['attributes'] = []
print("DEBUG all_app_runs = {}".format(all_app_runs))
for summary, action_results in all_app_runs:
for result in action_results:
ctx_result = get_ctx_result(result)
if (not ctx_result):
continue
results.append(ctx_result)
print("DEBUG ctx_result = {}".format(ctx_result))

# populate keys into 'attributes' variable for django template
try:
for n in list(ctx_result['data']['entries'][0]['attributes'].keys()):
if n not in context['attributes']:
context['attributes'].append(n)
except Exception as e:
context['attributes'] = False
context['error'] = str(e)

return 'display_attributes.html'
Loading

0 comments on commit 87e5df5

Please sign in to comment.