Skip to content

Commit e368efd

Browse files
committed
Multiple changes.
* GSOC 2021 ideas list: GRR has been accepted. * Return empty examples instead of failing when KbAttribute is missing. * Show raw glob-expression when explanation is loading/failed. * Show artifact links under sources. * Sandboxing: refactor handling of shared file descriptors. * Make approval toggle more intuitive with hover effect and toggle button. * Windows MSI: add support for signing. * Bump the used `pytest-xdist` version to 2.2.1. * Bump the used `pytest` version to 6.2.2. * Add WindowsRegistryInstalledSoftware to populate installed applications from registry * Introduced incremental updates for client actions (with memory, MySQL implementations). * Restyle approval bottom sheet header. * Clear FlowPicker after flow is started. * Introduced HumanReadableToMicrosecondsSinceEpoch helper function. * Use new super() syntax. * Create auxiliary constructors for the action mock. * Fixing Linux RPM command parser. * Fixing OSXInstallHistoryPlistParser. * Fixing FileFinderResultExportConverter. * Reduced the amount of info-logging and fixed the logging bug. * Index clients by UUID and serial number. * Type annotate client_index. * Introduce tree view to show child artifact sources. * Speed up ListArtifacts 4x by looping through raw ArtifactParser types. * Sandboxing: refactor to support multiple RPC interfaces in the unprivileged server. * Additional logging in the fleetspeak frontend. * Fixing accelerated.c varint_decode and py_split_buffer. * Fix issue with HTTP API not ignoring excessive GET parameters. * Deprecate Proto ACLToken. * Sandboxing: add unprivileged TSK implementation. * Remove all remaining ACLToken uses. 🎉🎉 * Refactor Events, remove legacy token. * Remove legacy token from Cronjobs. * Remove legacy token from OutputPlugins. * Remove legacy token from most tests. * Remove self.token.username in tests. * Remove legacy token from flows. * Remove legacy ACLToken fields requested_access, is_emergency, supervisor. * Remove legacy token from report plugins. * Preview sources of selected artifact. * Merging #916
1 parent 1194c97 commit e368efd

File tree

340 files changed

+4792
-2452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+4792
-2452
lines changed

api_client/python/grr_api_client/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GrrApi(object):
3232
"""Root GRR API object."""
3333

3434
def __init__(self, connector: connectors.Connector):
35-
super(GrrApi, self).__init__()
35+
super().__init__()
3636

3737
self._context = context.GrrApiContext(connector=connector)
3838
self.types = types.Types(context=self._context) # type: types.Types

api_client/python/grr_api_client/api_shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class GrrApiShellArgParser(argparse.ArgumentParser):
1818
"""API shell args parser."""
1919

2020
def __init__(self):
21-
super(GrrApiShellArgParser, self).__init__()
21+
super().__init__()
2222

2323
self.add_argument(
2424
"api_endpoint", type=str, help="API endpoint specified as host[:port]")

api_client/python/grr_api_client/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self,
2222
approval_id=None,
2323
username=None,
2424
context=None):
25-
super(ClientApprovalBase, self).__init__()
25+
super().__init__()
2626

2727
if not client_id:
2828
raise ValueError("client_id can't be empty.")
@@ -89,7 +89,7 @@ def __init__(self, data=None, username=None, context=None):
8989
if data is None:
9090
raise ValueError("data can't be None")
9191

92-
super(ClientApproval, self).__init__(
92+
super().__init__(
9393
client_id=utils.UrnStringToClientId(data.subject.urn),
9494
approval_id=data.id,
9595
username=username,
@@ -102,7 +102,7 @@ class ClientCrash(object):
102102
"""Wrapper class for client crashes."""
103103

104104
def __init__(self, data=None, context=None):
105-
super(ClientCrash, self).__init__()
105+
super().__init__()
106106

107107
self.data = data
108108

@@ -118,7 +118,7 @@ class ClientBase(object):
118118
"""Base class for Client and ClientRef."""
119119

120120
def __init__(self, client_id=None, context=None):
121-
super(ClientBase, self).__init__()
121+
super().__init__()
122122

123123
if not client_id:
124124
raise ValueError("client_id can't be empty.")
@@ -291,7 +291,7 @@ def __init__(self, data=None, context=None):
291291
if data is None:
292292
raise ValueError("data can't be None")
293293

294-
super(Client, self).__init__(
294+
super().__init__(
295295
client_id=utils.UrnStringToClientId(data.urn), context=context)
296296

297297
self.data = data

api_client/python/grr_api_client/config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(
1818
path: str,
1919
context: api_context.GrrApiContext,
2020
):
21-
super(GrrBinaryBase, self).__init__()
21+
super().__init__()
2222

2323
self.binary_type = binary_type
2424
self.path = path
@@ -51,8 +51,7 @@ def __init__(
5151
data: config_pb2.ApiGrrBinary,
5252
context: api_context.GrrApiContext,
5353
):
54-
super(GrrBinary, self).__init__(
55-
binary_type=data.type, path=data.path, context=context)
54+
super().__init__(binary_type=data.type, path=data.path, context=context)
5655

5756
self.data = data # type: config_pb2.ApiGrrBinary
5857

api_client/python/grr_api_client/connectors/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(
131131
page_size: Optional[int] = None,
132132
validate_version: Optional[bool] = None,
133133
):
134-
super(HttpConnector, self).__init__()
134+
super().__init__()
135135

136136
if verify is None:
137137
verify = True

api_client/python/grr_api_client/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GrrApiContext(object):
1919
"""API context object. Used to make every API request."""
2020

2121
def __init__(self, connector: connectors.Connector):
22-
super(GrrApiContext, self).__init__()
22+
super().__init__()
2323

2424
self.connector = connector # type: connectors.Connector
2525
self.user = None # type: Optional[user_pb2.ApiGrrUser]

api_client/python/grr_api_client/flow.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
self,
2323
data: flow_pb2.ApiFlowResult,
2424
):
25-
super(FlowResult, self).__init__()
25+
super().__init__()
2626
self.data = data # type: flow_pb2.ApiFlowResult
2727
self.timestamp = data.timestamp # type: int
2828

@@ -41,7 +41,7 @@ def __init__(
4141
self,
4242
data: flow_pb2.ApiFlowLog,
4343
):
44-
super(FlowLog, self).__init__()
44+
super().__init__()
4545

4646
self.data = data # type: flow_pb2.ApiFlowLog
4747
self.log_message = self.data.log_message # type: str
@@ -56,7 +56,7 @@ def __init__(
5656
flow_id: str,
5757
context: api_context.GrrApiContext,
5858
):
59-
super(FlowBase, self).__init__()
59+
super().__init__()
6060

6161
if not client_id:
6262
raise ValueError("client_id can't be empty.")
@@ -192,8 +192,7 @@ def __init__(
192192
client_id = utils.UrnStringToClientId(data.urn)
193193
flow_id = data.flow_id
194194

195-
super(Flow, self).__init__(
196-
client_id=client_id, flow_id=flow_id, context=context)
195+
super().__init__(client_id=client_id, flow_id=flow_id, context=context)
197196

198197
self.data = data # type: flow_pb2.ApiFlow
199198

api_client/python/grr_api_client/hunt.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
username: str,
3030
context: context_lib.GrrApiContext,
3131
):
32-
super(HuntApprovalBase, self).__init__()
32+
super().__init__()
3333

3434
if not hunt_id:
3535
raise ValueError("hunt_id can't be empty.")
@@ -108,7 +108,7 @@ def __init__(
108108
username: str,
109109
context: context_lib.GrrApiContext,
110110
):
111-
super(HuntApproval, self).__init__(
111+
super().__init__(
112112
hunt_id=utils.UrnStringToHuntId(data.subject.urn),
113113
approval_id=data.id,
114114
username=username,
@@ -125,7 +125,7 @@ def __init__(
125125
data: hunt_pb2.ApiHuntResult,
126126
context: context_lib.GrrApiContext,
127127
):
128-
super(HuntResult, self).__init__()
128+
super().__init__()
129129
self.data = data # type: hunt_pb2.ApiHuntResult
130130

131131
self.client = client.ClientRef(
@@ -146,7 +146,7 @@ def __init__(
146146
data: hunt_pb2.ApiHuntError,
147147
context: context_lib.GrrApiContext,
148148
):
149-
super(HuntError, self).__init__()
149+
super().__init__()
150150

151151
self.data = data # type: hunt_pb2.ApiHuntError
152152
self.log_message = self.data.log_message # type: str
@@ -165,7 +165,7 @@ def __init__(
165165
data: hunt_pb2.ApiHuntLog,
166166
context: context_lib.GrrApiContext,
167167
):
168-
super(HuntLog, self).__init__()
168+
super().__init__()
169169

170170
self.data = data # type: hunt_pb2.ApiHuntLog
171171
self.log_message = self.data.log_message # str
@@ -184,7 +184,7 @@ def __init__(
184184
data: hunt_pb2.ApiHuntClient,
185185
context: context_lib.GrrApiContext,
186186
):
187-
super(HuntClient, self).__init__(client_id=data.client_id, context=context)
187+
super().__init__(client_id=data.client_id, context=context)
188188

189189
self.data = data # type: hunt_pb2.ApiHuntClient
190190

@@ -197,7 +197,7 @@ def __init__(
197197
hunt_id: str,
198198
context: context_lib.GrrApiContext,
199199
):
200-
super(HuntBase, self).__init__()
200+
super().__init__()
201201

202202
if not hunt_id:
203203
raise ValueError("hunt_id can't be empty.")
@@ -400,7 +400,7 @@ def __init__(
400400
):
401401
hunt_id = utils.UrnStringToHuntId(data.urn)
402402

403-
super(Hunt, self).__init__(hunt_id=hunt_id, context=context)
403+
super().__init__(hunt_id=hunt_id, context=context)
404404

405405
self.data = data # type: hunt_pb2.ApiHunt
406406

api_client/python/grr_api_client/root.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
username: str,
3434
context: api_context.GrrApiContext,
3535
):
36-
super(GrrUserBase, self).__init__()
36+
super().__init__()
3737

3838
self.username = username # type: str
3939
self._context = context # type: api_context.GrrApiContext
@@ -97,7 +97,7 @@ def __init__(
9797
data: user_pb2.ApiGrrUser,
9898
context: api_context.GrrApiContext,
9999
):
100-
super(GrrUser, self).__init__(username=data.username, context=context)
100+
super().__init__(username=data.username, context=context)
101101

102102
self.data = data # type: user_pb2.ApiGrrUser
103103

@@ -113,7 +113,7 @@ def __init__(
113113
path: str,
114114
context: api_context.GrrApiContext,
115115
):
116-
super(GrrBinaryRef, self).__init__()
116+
super().__init__()
117117

118118
self.binary_type = binary_type # type: config_pb2.ApiGrrBinary.Type
119119
self.path = path # type: str
@@ -202,7 +202,7 @@ def __init__(
202202
self,
203203
context: api_context.GrrApiContext,
204204
):
205-
super(RootGrrApi, self).__init__()
205+
super().__init__()
206206
self._context = context # type: api_context.GrrApiContext
207207

208208
# TODO(hanuszczak): Python's protobuf enums don't currently work with

api_client/python/grr_api_client/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
self,
2929
context: api_context.GrrApiContext,
3030
):
31-
super(Types, self).__init__()
31+
super().__init__()
3232

3333
self._context = context # type: api_context.GrrApiContext
3434
self._flow_descriptors = None

0 commit comments

Comments
 (0)