pyattackforge 0.1.7__tar.gz → 0.1.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyattackforge
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Python wrapper for the AttackForge API
5
5
  Home-page: https://github.com/Tantalum-Labs/PyAttackForge
6
6
  Author: Shane S
@@ -35,6 +35,7 @@ A lightweight Python library for interacting with the AttackForge API.
35
35
  ## Features
36
36
 
37
37
  - Create and fetch projects
38
+ - Manage users (create, update, activate/deactivate, access, audit logs)
38
39
  - Manage assets
39
40
  - Submit vulnerabilities
40
41
  - Create findings from existing writeups by passing a `writeup_id`
@@ -130,6 +131,43 @@ client.create_finding_from_writeup(
130
131
  )
131
132
  ```
132
133
 
134
+ ## User Management
135
+
136
+ Create a user:
137
+ ```python
138
+ client.create_user(
139
+ first_name="John",
140
+ last_name="Citizen",
141
+ username="john.citizen@attackforge.com",
142
+ email="john.citizen@attackforge.com",
143
+ password="ThisIsASuperLongPassword",
144
+ role="client",
145
+ mfa="Yes",
146
+ )
147
+ ```
148
+
149
+ Activate or deactivate a user:
150
+ ```python
151
+ client.activate_user("5eacb8450c8d520a8281e539")
152
+ client.deactivate_user("5eacb8450c8d520a8281e539")
153
+ ```
154
+
155
+ Fetch users:
156
+ ```python
157
+ users = client.get_users(email="john.citizen@attackforge.com")
158
+ user = client.get_user_by_email("john.citizen@attackforge.com")
159
+ ```
160
+
161
+ Invite users to a project:
162
+ ```python
163
+ client.invite_user_to_project(
164
+ project_id="abc123",
165
+ username="user@attackforge.com",
166
+ access_level="Edit",
167
+ role="Pentester",
168
+ )
169
+ ```
170
+
133
171
  ### Evidence and testcase helpers
134
172
 
135
173
  Upload evidence to an existing finding:
@@ -267,8 +305,14 @@ See the source code for full details and docstrings.
267
305
  writeup_custom_fields: Optional[list] = None,
268
306
  ) -> dict`
269
307
  - `create_finding_from_writeup(project_id: str, writeup_id: str, priority: str, affected_assets: Optional[list] = None, linked_testcases: Optional[list] = None, **kwargs) -> dict`
308
+ - `create_user(first_name: str, last_name: str, username: str, email: str, password: str, role: str, mfa: str) -> dict`
309
+ - `create_users(users: List[Dict[str, Any]]) -> Any`
270
310
  - `get_findings_for_project(project_id: str, priority: Optional[str] = None) -> list`
271
311
  - `upsert_finding_for_project(...)`
312
+ - `get_user(user_id: str) -> dict`
313
+ - `get_user_by_email(email: str) -> dict`
314
+ - `get_user_by_username(username: str) -> dict`
315
+ - `get_users(first_name: Optional[str] = None, last_name: Optional[str] = None, email: Optional[str] = None, username: Optional[str] = None) -> list`
272
316
  - `get_vulnerability(vulnerability_id: str) -> dict`
273
317
  - `add_note_to_finding(vulnerability_id: str, note: Any, note_type: str = "PLAINTEXT") -> dict`
274
318
  - `upload_finding_evidence(vulnerability_id: str, file_path: str) -> dict`
@@ -279,11 +323,30 @@ See the source code for full details and docstrings.
279
323
  - `assign_findings_to_testcase(project_id: str, testcase_id: str, vulnerability_ids: List[str], existing_linked_vulnerabilities: Optional[List[str]] = None, additional_fields: Optional[Dict[str, Any]] = None) -> dict`
280
324
  - `add_findings_to_testcase(project_id: str, testcase_id: str, vulnerability_ids: List[str], additional_fields: Optional[Dict[str, Any]] = None) -> dict`
281
325
  - `add_note_to_testcase(project_id: str, testcase_id: str, note: str, status: Optional[str] = None) -> dict`
326
+ - `update_user(user_id: str, first_name: Optional[str] = None, last_name: Optional[str] = None, email_address: Optional[str] = None, username: Optional[str] = None, is_deleted: Optional[bool] = None) -> dict`
327
+ - `activate_user(user_id: str) -> dict`
328
+ - `deactivate_user(user_id: str) -> dict`
329
+ - `add_user_to_group(group_id: str, user_id: str, access_level: str) -> dict`
330
+ - `update_user_access_on_group(group_id: str, user_id: str, access_level: str) -> dict`
331
+ - `update_user_access_on_project(project_id: str, user_id: str, update_action: str) -> dict`
332
+ - `invite_user_to_project(project_id: str, username: str, access_level: str, role: Optional[str] = None) -> dict`
333
+ - `invite_users_to_project_team(project_id: str, users: List[Dict[str, Any]]) -> dict`
334
+ - `get_user_groups(user_id: str) -> list`
335
+ - `get_user_projects(user_id: str) -> list`
336
+ - `get_user_audit_logs(user_id: str, skip: Optional[int] = None, limit: Optional[int] = None, include_request_body: Optional[bool] = None, endpoint: Optional[str] = None, method: Optional[str] = None) -> list`
337
+ - `get_user_login_history(user_id: str, skip: Optional[int] = None, limit: Optional[int] = None) -> list`
282
338
 
283
339
  See the source code for full details and docstrings.
284
340
 
285
341
  ---
286
342
 
343
+ ## Versioning and Changelog
344
+
345
+ - Current release: `0.1.9`
346
+ - See `CHANGELOG.md` for release notes.
347
+
348
+ ---
349
+
287
350
  ## Contributing
288
351
 
289
352
  Contributions are welcome! Please open issues or submit pull requests via GitHub.
@@ -7,6 +7,7 @@ A lightweight Python library for interacting with the AttackForge API.
7
7
  ## Features
8
8
 
9
9
  - Create and fetch projects
10
+ - Manage users (create, update, activate/deactivate, access, audit logs)
10
11
  - Manage assets
11
12
  - Submit vulnerabilities
12
13
  - Create findings from existing writeups by passing a `writeup_id`
@@ -102,6 +103,43 @@ client.create_finding_from_writeup(
102
103
  )
103
104
  ```
104
105
 
106
+ ## User Management
107
+
108
+ Create a user:
109
+ ```python
110
+ client.create_user(
111
+ first_name="John",
112
+ last_name="Citizen",
113
+ username="john.citizen@attackforge.com",
114
+ email="john.citizen@attackforge.com",
115
+ password="ThisIsASuperLongPassword",
116
+ role="client",
117
+ mfa="Yes",
118
+ )
119
+ ```
120
+
121
+ Activate or deactivate a user:
122
+ ```python
123
+ client.activate_user("5eacb8450c8d520a8281e539")
124
+ client.deactivate_user("5eacb8450c8d520a8281e539")
125
+ ```
126
+
127
+ Fetch users:
128
+ ```python
129
+ users = client.get_users(email="john.citizen@attackforge.com")
130
+ user = client.get_user_by_email("john.citizen@attackforge.com")
131
+ ```
132
+
133
+ Invite users to a project:
134
+ ```python
135
+ client.invite_user_to_project(
136
+ project_id="abc123",
137
+ username="user@attackforge.com",
138
+ access_level="Edit",
139
+ role="Pentester",
140
+ )
141
+ ```
142
+
105
143
  ### Evidence and testcase helpers
106
144
 
107
145
  Upload evidence to an existing finding:
@@ -239,8 +277,14 @@ See the source code for full details and docstrings.
239
277
  writeup_custom_fields: Optional[list] = None,
240
278
  ) -> dict`
241
279
  - `create_finding_from_writeup(project_id: str, writeup_id: str, priority: str, affected_assets: Optional[list] = None, linked_testcases: Optional[list] = None, **kwargs) -> dict`
280
+ - `create_user(first_name: str, last_name: str, username: str, email: str, password: str, role: str, mfa: str) -> dict`
281
+ - `create_users(users: List[Dict[str, Any]]) -> Any`
242
282
  - `get_findings_for_project(project_id: str, priority: Optional[str] = None) -> list`
243
283
  - `upsert_finding_for_project(...)`
284
+ - `get_user(user_id: str) -> dict`
285
+ - `get_user_by_email(email: str) -> dict`
286
+ - `get_user_by_username(username: str) -> dict`
287
+ - `get_users(first_name: Optional[str] = None, last_name: Optional[str] = None, email: Optional[str] = None, username: Optional[str] = None) -> list`
244
288
  - `get_vulnerability(vulnerability_id: str) -> dict`
245
289
  - `add_note_to_finding(vulnerability_id: str, note: Any, note_type: str = "PLAINTEXT") -> dict`
246
290
  - `upload_finding_evidence(vulnerability_id: str, file_path: str) -> dict`
@@ -251,11 +295,30 @@ See the source code for full details and docstrings.
251
295
  - `assign_findings_to_testcase(project_id: str, testcase_id: str, vulnerability_ids: List[str], existing_linked_vulnerabilities: Optional[List[str]] = None, additional_fields: Optional[Dict[str, Any]] = None) -> dict`
252
296
  - `add_findings_to_testcase(project_id: str, testcase_id: str, vulnerability_ids: List[str], additional_fields: Optional[Dict[str, Any]] = None) -> dict`
253
297
  - `add_note_to_testcase(project_id: str, testcase_id: str, note: str, status: Optional[str] = None) -> dict`
298
+ - `update_user(user_id: str, first_name: Optional[str] = None, last_name: Optional[str] = None, email_address: Optional[str] = None, username: Optional[str] = None, is_deleted: Optional[bool] = None) -> dict`
299
+ - `activate_user(user_id: str) -> dict`
300
+ - `deactivate_user(user_id: str) -> dict`
301
+ - `add_user_to_group(group_id: str, user_id: str, access_level: str) -> dict`
302
+ - `update_user_access_on_group(group_id: str, user_id: str, access_level: str) -> dict`
303
+ - `update_user_access_on_project(project_id: str, user_id: str, update_action: str) -> dict`
304
+ - `invite_user_to_project(project_id: str, username: str, access_level: str, role: Optional[str] = None) -> dict`
305
+ - `invite_users_to_project_team(project_id: str, users: List[Dict[str, Any]]) -> dict`
306
+ - `get_user_groups(user_id: str) -> list`
307
+ - `get_user_projects(user_id: str) -> list`
308
+ - `get_user_audit_logs(user_id: str, skip: Optional[int] = None, limit: Optional[int] = None, include_request_body: Optional[bool] = None, endpoint: Optional[str] = None, method: Optional[str] = None) -> list`
309
+ - `get_user_login_history(user_id: str, skip: Optional[int] = None, limit: Optional[int] = None) -> list`
254
310
 
255
311
  See the source code for full details and docstrings.
256
312
 
257
313
  ---
258
314
 
315
+ ## Versioning and Changelog
316
+
317
+ - Current release: `0.1.9`
318
+ - See `CHANGELOG.md` for release notes.
319
+
320
+ ---
321
+
259
322
  ## Contributing
260
323
 
261
324
  Contributions are welcome! Please open issues or submit pull requests via GitHub.