From 056a7bfde98b36da1aa32538866e127afe352b20 Mon Sep 17 00:00:00 2001 From: fireblocks_dx_team Date: Wed, 26 Aug 2026 08:30:10 +0000 Subject: [PATCH] Generated SDK #2791732002 --- .openapi-generator/FILES | 15 + CHANGELOG.md | 290 ------------------ README.md | 7 + docs/AcceptFindingRequest.md | 31 ++ docs/ComplianceRequirement.md | 33 ++ docs/ReopenFindingRequest.md | 31 ++ docs/SecurityFindingDetailed.md | 43 +++ docs/SecurityPostureManagementApi.md | 162 +++++++++- docs/UpdateFindingExternalRequest.md | 31 ++ fireblocks/__init__.py | 9 +- .../api/security_posture_management_api.py | 289 ++++++++++++++++- fireblocks/configuration.py | 2 +- fireblocks/models/__init__.py | 5 + fireblocks/models/accept_finding_request.py | 98 ++++++ fireblocks/models/compliance_requirement.py | 94 ++++++ fireblocks/models/reopen_finding_request.py | 97 ++++++ fireblocks/models/security_finding.py | 4 +- .../models/security_finding_detailed.py | 151 +++++++++ .../models/update_finding_external_request.py | 141 +++++++++ pyproject.toml | 2 +- setup.py | 2 +- test/test_accept_finding_request.py | 56 ++++ test/test_add_connected_account_request.py | 4 +- test/test_compliance_requirement.py | 59 ++++ test/test_reopen_finding_request.py | 55 ++++ test/test_security_finding_detailed.py | 77 +++++ test/test_security_posture_management_api.py | 14 + test/test_update_finding_external_request.py | 58 ++++ 28 files changed, 1560 insertions(+), 300 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 docs/AcceptFindingRequest.md create mode 100644 docs/ComplianceRequirement.md create mode 100644 docs/ReopenFindingRequest.md create mode 100644 docs/SecurityFindingDetailed.md create mode 100644 docs/UpdateFindingExternalRequest.md create mode 100644 fireblocks/models/accept_finding_request.py create mode 100644 fireblocks/models/compliance_requirement.py create mode 100644 fireblocks/models/reopen_finding_request.py create mode 100644 fireblocks/models/security_finding_detailed.py create mode 100644 fireblocks/models/update_finding_external_request.py create mode 100644 test/test_accept_finding_request.py create mode 100644 test/test_compliance_requirement.py create mode 100644 test/test_reopen_finding_request.py create mode 100644 test/test_security_finding_detailed.py create mode 100644 test/test_update_finding_external_request.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index abed79de..4bb1fa77 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,6 +5,7 @@ README.md docs/APIUser.md docs/AbaPaymentInfo.md docs/AbiFunction.md +docs/AcceptFindingRequest.md docs/AccessRegistryAddressItem.md docs/AccessRegistryCurrentStateResponse.md docs/AccessRegistryCurrentStateResponse2.md @@ -197,6 +198,7 @@ docs/CollectionTokenMetadataAttributeDto.md docs/CollectionTokenMetadataDto.md docs/CollectionType.md docs/ComplianceApi.md +docs/ComplianceRequirement.md docs/ComplianceResultFullPayload.md docs/ComplianceResultStatusesEnum.md docs/ComplianceResults.md @@ -782,6 +784,7 @@ docs/RenameConnectedAccountRequest.md docs/RenameConnectedAccountResponse.md docs/RenameCosigner.md docs/RenameVaultAccountResponse.md +docs/ReopenFindingRequest.md docs/ReportConflictResponse.md docs/ReportJob.md docs/ReportJobLinks.md @@ -850,6 +853,7 @@ docs/ScreeningVerdictEnum.md docs/ScreeningVerdictMatchedRule.md docs/SearchNetworkIdsResponse.md docs/SecurityFinding.md +docs/SecurityFindingDetailed.md docs/SecurityPostureManagementApi.md docs/SepaPaymentInfo.md docs/SessionDTO.md @@ -1179,6 +1183,7 @@ docs/UpdateCallbackHandlerRequest.md docs/UpdateCallbackHandlerResponse.md docs/UpdateCounterpartyGroupRequest.md docs/UpdateDraftRequest.md +docs/UpdateFindingExternalRequest.md docs/UpdateLegalEntityRequest.md docs/UpdateTagRequest.md docs/UpdateTokenOwnershipStatusDto.md @@ -1317,6 +1322,7 @@ fireblocks/exceptions.py fireblocks/models/__init__.py fireblocks/models/aba_payment_info.py fireblocks/models/abi_function.py +fireblocks/models/accept_finding_request.py fireblocks/models/access_registry_address_item.py fireblocks/models/access_registry_current_state_response.py fireblocks/models/access_registry_current_state_response2.py @@ -1505,6 +1511,7 @@ fireblocks/models/collection_ownership_response.py fireblocks/models/collection_token_metadata_attribute_dto.py fireblocks/models/collection_token_metadata_dto.py fireblocks/models/collection_type.py +fireblocks/models/compliance_requirement.py fireblocks/models/compliance_result_full_payload.py fireblocks/models/compliance_result_statuses_enum.py fireblocks/models/compliance_results.py @@ -2063,6 +2070,7 @@ fireblocks/models/rename_connected_account_request.py fireblocks/models/rename_connected_account_response.py fireblocks/models/rename_cosigner.py fireblocks/models/rename_vault_account_response.py +fireblocks/models/reopen_finding_request.py fireblocks/models/report_conflict_response.py fireblocks/models/report_job.py fireblocks/models/report_job_links.py @@ -2125,6 +2133,7 @@ fireblocks/models/screening_verdict_enum.py fireblocks/models/screening_verdict_matched_rule.py fireblocks/models/search_network_ids_response.py fireblocks/models/security_finding.py +fireblocks/models/security_finding_detailed.py fireblocks/models/sepa_address.py fireblocks/models/sepa_destination.py fireblocks/models/sepa_payment_info.py @@ -2446,6 +2455,7 @@ fireblocks/models/update_callback_handler_request.py fireblocks/models/update_callback_handler_response.py fireblocks/models/update_counterparty_group_request.py fireblocks/models/update_draft_request.py +fireblocks/models/update_finding_external_request.py fireblocks/models/update_legal_entity_request.py fireblocks/models/update_tag_request.py fireblocks/models/update_token_ownership_status_dto.py @@ -2535,6 +2545,7 @@ test/fireblocks/test_user_agent_util.py test/fireblocks/test_validation_utils.py test/test_aba_payment_info.py test/test_abi_function.py +test/test_accept_finding_request.py test/test_access_registry_address_item.py test/test_access_registry_current_state_response.py test/test_access_registry_current_state_response2.py @@ -2728,6 +2739,7 @@ test/test_collection_token_metadata_attribute_dto.py test/test_collection_token_metadata_dto.py test/test_collection_type.py test/test_compliance_api.py +test/test_compliance_requirement.py test/test_compliance_result_full_payload.py test/test_compliance_result_statuses_enum.py test/test_compliance_results.py @@ -3313,6 +3325,7 @@ test/test_rename_connected_account_request.py test/test_rename_connected_account_response.py test/test_rename_cosigner.py test/test_rename_vault_account_response.py +test/test_reopen_finding_request.py test/test_report_conflict_response.py test/test_report_job.py test/test_report_job_links.py @@ -3377,6 +3390,7 @@ test/test_screening_verdict_enum.py test/test_screening_verdict_matched_rule.py test/test_search_network_ids_response.py test/test_security_finding.py +test/test_security_finding_detailed.py test/test_security_posture_management_api.py test/test_sepa_address.py test/test_sepa_destination.py @@ -3707,6 +3721,7 @@ test/test_update_callback_handler_request.py test/test_update_callback_handler_response.py test/test_update_counterparty_group_request.py test/test_update_draft_request.py +test/test_update_finding_external_request.py test/test_update_legal_entity_request.py test/test_update_tag_request.py test/test_update_token_ownership_status_dto.py diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 8b9fba71..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,290 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v27.0.0](https://github.com/fireblocks/py-sdk/compare/v24.0.0...v27.0.0) - 2026-08-18 - -### Merged - -- Generated SDK #2768393570 [`#156`](https://github.com/fireblocks/py-sdk/pull/156) - -## [v24.0.0](https://github.com/fireblocks/py-sdk/compare/v23.0.0...v24.0.0) - 2026-07-23 - -### Merged - -- Generated SDK #2700459745 (major) [`#146`](https://github.com/fireblocks/py-sdk/pull/146) - -## [v23.0.0](https://github.com/fireblocks/py-sdk/compare/v22.0.0...v23.0.0) - 2026-07-01 - -### Merged - -- Generated SDK #1180 [`#145`](https://github.com/fireblocks/py-sdk/pull/145) - -## [v22.0.0](https://github.com/fireblocks/py-sdk/compare/v21.0.0...v22.0.0) - 2026-06-28 - -### Merged - -- Generated SDK #5347 [`#144`](https://github.com/fireblocks/py-sdk/pull/144) - -## [v21.0.0](https://github.com/fireblocks/py-sdk/compare/v20.0.0...v21.0.0) - 2026-06-11 - -### Merged - -- Generated SDK #5364 [`#142`](https://github.com/fireblocks/py-sdk/pull/142) - -## [v20.0.0](https://github.com/fireblocks/py-sdk/compare/v19.1.0...v20.0.0) - 2026-06-02 - -### Merged - -- Generated SDK #2839 (major) [`#141`](https://github.com/fireblocks/py-sdk/pull/141) - -## [v19.1.0](https://github.com/fireblocks/py-sdk/compare/v19.0.0...v19.1.0) - 2026-05-27 - -### Merged - -- Generated SDK #2710 (minor) [`#140`](https://github.com/fireblocks/py-sdk/pull/140) - -## [v19.0.0](https://github.com/fireblocks/py-sdk/compare/v18.0.0...v19.0.0) - 2026-05-17 - -### Merged - -- Generated SDK #7742 (major) [`#139`](https://github.com/fireblocks/py-sdk/pull/139) - -## [v18.0.0](https://github.com/fireblocks/py-sdk/compare/v17.0.0...v18.0.0) - 2026-05-07 - -### Merged - -- Generated SDK #3222 (major) [`#138`](https://github.com/fireblocks/py-sdk/pull/138) - -## [v17.0.0](https://github.com/fireblocks/py-sdk/compare/v16.0.0...v17.0.0) - 2026-04-20 - -### Merged - -- Generated SDK #9605 (major) [`#137`](https://github.com/fireblocks/py-sdk/pull/137) - -## [v16.0.0](https://github.com/fireblocks/py-sdk/compare/v15.0.0...v16.0.0) - 2026-04-06 - -### Merged - -- Generated SDK #3331 [`#135`](https://github.com/fireblocks/py-sdk/pull/135) - -## [v15.0.0](https://github.com/fireblocks/py-sdk/compare/v14.1.0...v15.0.0) - 2026-03-15 - -### Merged - -- Generated SDK #3733 (major) [`#129`](https://github.com/fireblocks/py-sdk/pull/129) - -## [v14.1.0](https://github.com/fireblocks/py-sdk/compare/v14.0.0...v14.1.0) - 2026-02-26 - -### Merged - -- Generated SDK #2167 [`#127`](https://github.com/fireblocks/py-sdk/pull/127) - -## [v14.0.0](https://github.com/fireblocks/py-sdk/compare/v13.0.0...v14.0.0) - 2026-02-03 - -### Merged - -- Generated SDK #4746 [`#123`](https://github.com/fireblocks/py-sdk/pull/123) - -## [v13.0.0](https://github.com/fireblocks/py-sdk/compare/v12.1.2...v13.0.0) - 2025-11-13 - -### Merged - -- Generated SDK #5834 [`#121`](https://github.com/fireblocks/py-sdk/pull/121) - -## [v12.1.2](https://github.com/fireblocks/py-sdk/compare/v12.1.1...v12.1.2) - 2025-10-22 - -### Merged - -- Generated SDK #8293 [`#120`](https://github.com/fireblocks/py-sdk/pull/120) - -## [v12.1.1](https://github.com/fireblocks/py-sdk/compare/v12.1.0...v12.1.1) - 2025-09-29 - -### Merged - -- Generated SDK #6061 [`#119`](https://github.com/fireblocks/py-sdk/pull/119) - -## [v12.1.0](https://github.com/fireblocks/py-sdk/compare/v12.0.0...v12.1.0) - 2025-09-09 - -### Merged - -- Generated SDK #4521 [`#118`](https://github.com/fireblocks/py-sdk/pull/118) - -## [v12.0.0](https://github.com/fireblocks/py-sdk/compare/v11.2.0...v12.0.0) - 2025-09-01 - -### Merged - -- Generated SDK #7741 [`#117`](https://github.com/fireblocks/py-sdk/pull/117) - -## [v11.2.0](https://github.com/fireblocks/py-sdk/compare/v11.1.0...v11.2.0) - 2025-08-18 - -### Merged - -- Generated SDK #3302 [`#116`](https://github.com/fireblocks/py-sdk/pull/116) - -## [v11.1.0](https://github.com/fireblocks/py-sdk/compare/v11.0.0...v11.1.0) - 2025-08-11 - -### Merged - -- Generated SDK #1782 [`#115`](https://github.com/fireblocks/py-sdk/pull/115) - -## [v11.0.0](https://github.com/fireblocks/py-sdk/compare/v10.4.0...v11.0.0) - 2025-07-15 - -### Merged - -- Generated SDK #5610 [`#114`](https://github.com/fireblocks/py-sdk/pull/114) - -## [v10.4.0](https://github.com/fireblocks/py-sdk/compare/v10.3.0...v10.4.0) - 2025-06-29 - -### Merged - -- Generated SDK #1492 [`#113`](https://github.com/fireblocks/py-sdk/pull/113) - -## [v10.3.0](https://github.com/fireblocks/py-sdk/compare/v10.2.0...v10.3.0) - 2025-06-18 - -### Merged - -- Generated SDK #4009 [`#112`](https://github.com/fireblocks/py-sdk/pull/112) - -## [v10.2.0](https://github.com/fireblocks/py-sdk/compare/v10.1.1...v10.2.0) - 2025-06-04 - -### Merged - -- Generated SDK #8912 [`#111`](https://github.com/fireblocks/py-sdk/pull/111) - -## [v10.1.1](https://github.com/fireblocks/py-sdk/compare/v10.1.0...v10.1.1) - 2025-05-18 - -### Merged - -- Generated SDK #5019 [`#110`](https://github.com/fireblocks/py-sdk/pull/110) - -## [v10.1.0](https://github.com/fireblocks/py-sdk/compare/v10.0.0...v10.1.0) - 2025-05-07 - -### Merged - -- Generated SDK #7076 [`#107`](https://github.com/fireblocks/py-sdk/pull/107) - -## [v10.0.0](https://github.com/fireblocks/py-sdk/compare/v9.0.1...v10.0.0) - 2025-04-20 - -### Merged - -- Generated SDK #4794 [`#105`](https://github.com/fireblocks/py-sdk/pull/105) - -## [v9.0.1](https://github.com/fireblocks/py-sdk/compare/v9.0.0...v9.0.1) - 2025-04-07 - -### Merged - -- Generated SDK #3065 [`#104`](https://github.com/fireblocks/py-sdk/pull/104) - -## [v9.0.0](https://github.com/fireblocks/py-sdk/compare/v8.0.0...v9.0.0) - 2025-03-27 - -### Merged - -- Generated SDK #619 [`#102`](https://github.com/fireblocks/py-sdk/pull/102) - -## [v8.0.0](https://github.com/fireblocks/py-sdk/compare/v7.1.0...v8.0.0) - 2025-03-17 - -### Merged - -- Generated SDK #645 [`#101`](https://github.com/fireblocks/py-sdk/pull/101) -- Generated SDK #726 [`#99`](https://github.com/fireblocks/py-sdk/pull/99) - -## [v7.1.0](https://github.com/fireblocks/py-sdk/compare/v7.0.1...v7.1.0) - 2025-02-25 - -### Merged - -- Generated SDK #9833 [`#96`](https://github.com/fireblocks/py-sdk/pull/96) - -## [v7.0.1](https://github.com/fireblocks/py-sdk/compare/v7.0.0...v7.0.1) - 2025-02-12 - -### Merged - -- Generated SDK #4262 [`#95`](https://github.com/fireblocks/py-sdk/pull/95) - -## [v7.0.0](https://github.com/fireblocks/py-sdk/compare/v6.0.0...v7.0.0) - 2025-02-02 - -### Merged - -- Generated SDK #538 [`#92`](https://github.com/fireblocks/py-sdk/pull/92) - -## [v6.0.0](https://github.com/fireblocks/py-sdk/compare/v5.0.0...v6.0.0) - 2025-01-08 - -### Merged - -- Generated SDK #8699 [`#89`](https://github.com/fireblocks/py-sdk/pull/89) - -## [v5.0.0](https://github.com/fireblocks/py-sdk/compare/v4.0.0...v5.0.0) - 2024-12-05 - -### Merged - -- Generated SDK #1430 [`#85`](https://github.com/fireblocks/py-sdk/pull/85) -- Update python-package.yml, deprecate macos-12 [`#86`](https://github.com/fireblocks/py-sdk/pull/86) - -## [v4.0.0](https://github.com/fireblocks/py-sdk/compare/v3.0.0...v4.0.0) - 2024-10-31 - -### Merged - -- Generated SDK #5184 [`#82`](https://github.com/fireblocks/py-sdk/pull/82) - -## [v3.0.0](https://github.com/fireblocks/py-sdk/compare/v2.1.0...v3.0.0) - 2024-09-17 - -### Merged - -- Generated SDK #237 [`#81`](https://github.com/fireblocks/py-sdk/pull/81) - -## [v2.1.0](https://github.com/fireblocks/py-sdk/compare/v2.0.0...v2.1.0) - 2024-07-25 - -### Merged - -- Generated SDK #6749 [`#78`](https://github.com/fireblocks/py-sdk/pull/78) - -## [v2.0.0](https://github.com/fireblocks/py-sdk/compare/v1.0.4...v2.0.0) - 2024-07-17 - -### Merged - -- Generated SDK #6152 [`#76`](https://github.com/fireblocks/py-sdk/pull/76) -- Generated SDK #7647 [`#73`](https://github.com/fireblocks/py-sdk/pull/73) -- Generated SDK #7984 [`#70`](https://github.com/fireblocks/py-sdk/pull/70) - -## [v1.0.4](https://github.com/fireblocks/py-sdk/compare/v1.0.3...v1.0.4) - 2024-06-26 - -### Merged - -- Generated SDK #5779 [`#69`](https://github.com/fireblocks/py-sdk/pull/69) -- Generated SDK #913 [`#68`](https://github.com/fireblocks/py-sdk/pull/68) -- Generated SDK #1353 [`#67`](https://github.com/fireblocks/py-sdk/pull/67) -- Generated SDK #9982 [`#66`](https://github.com/fireblocks/py-sdk/pull/66) -- Generated SDK #1362 [`#65`](https://github.com/fireblocks/py-sdk/pull/65) -- Generated SDK #3652 [`#64`](https://github.com/fireblocks/py-sdk/pull/64) - -## [v1.0.3](https://github.com/fireblocks/py-sdk/compare/v1.0.2...v1.0.3) - 2024-06-06 - -### Merged - -- Generated SDK #2648 [`#30`](https://github.com/fireblocks/py-sdk/pull/30) - -## [v1.0.2](https://github.com/fireblocks/py-sdk/compare/v0.0.2-beta...v1.0.2) - 2024-06-04 - -### Merged - -- version 1.0.2 [`#25`](https://github.com/fireblocks/py-sdk/pull/25) -- version 1.0.0 [`#24`](https://github.com/fireblocks/py-sdk/pull/24) - -## v0.0.2-beta - 2024-05-30 - -### Merged - -- version 0.0.2-beta [`#23`](https://github.com/fireblocks/py-sdk/pull/23) -- Update .bumpversion.cfg [`#14`](https://github.com/fireblocks/py-sdk/pull/14) -- Update setup.py [`#13`](https://github.com/fireblocks/py-sdk/pull/13) -- Bug Fixes [`#12`](https://github.com/fireblocks/py-sdk/pull/12) -- update support for beta in bumpversion [`#11`](https://github.com/fireblocks/py-sdk/pull/11) -- Update setup.py [`#10`](https://github.com/fireblocks/py-sdk/pull/10) -- Update setup.py [`#9`](https://github.com/fireblocks/py-sdk/pull/9) -- Added Idempotency & NCW headers support [`#7`](https://github.com/fireblocks/py-sdk/pull/7) -- Added Idempotency & NCW headers support [`#8`](https://github.com/fireblocks/py-sdk/pull/8) -- Update setup.py [`#5`](https://github.com/fireblocks/py-sdk/pull/5) -- API Support Updates [`#4`](https://github.com/fireblocks/py-sdk/pull/4) diff --git a/README.md b/README.md index e0bc4091..1b950d99 100644 --- a/README.md +++ b/README.md @@ -477,7 +477,9 @@ Class | Method | HTTP request | Description *ReportsBetaApi* | [**get_report**](docs/ReportsBetaApi.md#get_report) | **GET** /reports/{reportId} | Get report status *ReportsBetaApi* | [**list_reports**](docs/ReportsBetaApi.md#list_reports) | **GET** /reports | List reports *ResetDeviceApi* | [**reset_device**](docs/ResetDeviceApi.md#reset_device) | **POST** /management/users/{id}/reset_device | Resets device +*SecurityPostureManagementApi* | [**get_security_finding_by_id**](docs/SecurityPostureManagementApi.md#get_security_finding_by_id) | **GET** /security/fspm/findings/{id} | Get a FSPM security finding by ID *SecurityPostureManagementApi* | [**get_security_findings**](docs/SecurityPostureManagementApi.md#get_security_findings) | **GET** /security/fspm/findings | Get FSPM security findings +*SecurityPostureManagementApi* | [**update_security_finding_by_id**](docs/SecurityPostureManagementApi.md#update_security_finding_by_id) | **PATCH** /security/fspm/findings/{id} | Update a FSPM security finding by ID *SmartTransferApi* | [**approve_dv_p_ticket_term**](docs/SmartTransferApi.md#approve_dv_p_ticket_term) | **PUT** /smart_transfers/{ticketId}/terms/{termId}/dvp/approve | Set funding source and approval *SmartTransferApi* | [**cancel_ticket**](docs/SmartTransferApi.md#cancel_ticket) | **PUT** /smart-transfers/{ticketId}/cancel | Cancel Ticket *SmartTransferApi* | [**create_ticket**](docs/SmartTransferApi.md#create_ticket) | **POST** /smart-transfers | Create Ticket @@ -692,6 +694,7 @@ Class | Method | HTTP request | Description - [APIUser](docs/APIUser.md) - [AbaPaymentInfo](docs/AbaPaymentInfo.md) - [AbiFunction](docs/AbiFunction.md) + - [AcceptFindingRequest](docs/AcceptFindingRequest.md) - [AccessRegistryAddressItem](docs/AccessRegistryAddressItem.md) - [AccessRegistryCurrentStateResponse](docs/AccessRegistryCurrentStateResponse.md) - [AccessRegistryCurrentStateResponse2](docs/AccessRegistryCurrentStateResponse2.md) @@ -879,6 +882,7 @@ Class | Method | HTTP request | Description - [CollectionTokenMetadataAttributeDto](docs/CollectionTokenMetadataAttributeDto.md) - [CollectionTokenMetadataDto](docs/CollectionTokenMetadataDto.md) - [CollectionType](docs/CollectionType.md) + - [ComplianceRequirement](docs/ComplianceRequirement.md) - [ComplianceResultFullPayload](docs/ComplianceResultFullPayload.md) - [ComplianceResultStatusesEnum](docs/ComplianceResultStatusesEnum.md) - [ComplianceResults](docs/ComplianceResults.md) @@ -1437,6 +1441,7 @@ Class | Method | HTTP request | Description - [RenameConnectedAccountResponse](docs/RenameConnectedAccountResponse.md) - [RenameCosigner](docs/RenameCosigner.md) - [RenameVaultAccountResponse](docs/RenameVaultAccountResponse.md) + - [ReopenFindingRequest](docs/ReopenFindingRequest.md) - [ReportConflictResponse](docs/ReportConflictResponse.md) - [ReportJob](docs/ReportJob.md) - [ReportJobLinks](docs/ReportJobLinks.md) @@ -1503,6 +1508,7 @@ Class | Method | HTTP request | Description - [ScreeningVerdictMatchedRule](docs/ScreeningVerdictMatchedRule.md) - [SearchNetworkIdsResponse](docs/SearchNetworkIdsResponse.md) - [SecurityFinding](docs/SecurityFinding.md) + - [SecurityFindingDetailed](docs/SecurityFindingDetailed.md) - [SepaPaymentInfo](docs/SepaPaymentInfo.md) - [SessionDTO](docs/SessionDTO.md) - [SessionMetadata](docs/SessionMetadata.md) @@ -1822,6 +1828,7 @@ Class | Method | HTTP request | Description - [UpdateCallbackHandlerResponse](docs/UpdateCallbackHandlerResponse.md) - [UpdateCounterpartyGroupRequest](docs/UpdateCounterpartyGroupRequest.md) - [UpdateDraftRequest](docs/UpdateDraftRequest.md) + - [UpdateFindingExternalRequest](docs/UpdateFindingExternalRequest.md) - [UpdateLegalEntityRequest](docs/UpdateLegalEntityRequest.md) - [UpdateTagRequest](docs/UpdateTagRequest.md) - [UpdateTokenOwnershipStatusDto](docs/UpdateTokenOwnershipStatusDto.md) diff --git a/docs/AcceptFindingRequest.md b/docs/AcceptFindingRequest.md new file mode 100644 index 00000000..1573d409 --- /dev/null +++ b/docs/AcceptFindingRequest.md @@ -0,0 +1,31 @@ +# AcceptFindingRequest + +Request to accept a FSPM finding. A reason is required. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Marks the finding as accepted. | +**status_updated_reason** | **str** | The reason for accepting the finding. | + +## Example + +```python +from fireblocks.models.accept_finding_request import AcceptFindingRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AcceptFindingRequest from a JSON string +accept_finding_request_instance = AcceptFindingRequest.from_json(json) +# print the JSON string representation of the object +print(AcceptFindingRequest.to_json()) + +# convert the object into a dict +accept_finding_request_dict = accept_finding_request_instance.to_dict() +# create an instance of AcceptFindingRequest from a dict +accept_finding_request_from_dict = AcceptFindingRequest.from_dict(accept_finding_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ComplianceRequirement.md b/docs/ComplianceRequirement.md new file mode 100644 index 00000000..25302bf8 --- /dev/null +++ b/docs/ComplianceRequirement.md @@ -0,0 +1,33 @@ +# ComplianceRequirement + +A compliance requirement associated with a finding + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the compliance requirement | +**standard** | **str** | The compliance standard this requirement belongs to | +**criteria** | **str** | The specific criteria within the compliance standard | +**description** | **str** | Human-readable description of the requirement, omitted if not available | [optional] + +## Example + +```python +from fireblocks.models.compliance_requirement import ComplianceRequirement + +# TODO update the JSON string below +json = "{}" +# create an instance of ComplianceRequirement from a JSON string +compliance_requirement_instance = ComplianceRequirement.from_json(json) +# print the JSON string representation of the object +print(ComplianceRequirement.to_json()) + +# convert the object into a dict +compliance_requirement_dict = compliance_requirement_instance.to_dict() +# create an instance of ComplianceRequirement from a dict +compliance_requirement_from_dict = ComplianceRequirement.from_dict(compliance_requirement_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReopenFindingRequest.md b/docs/ReopenFindingRequest.md new file mode 100644 index 00000000..5a44edd3 --- /dev/null +++ b/docs/ReopenFindingRequest.md @@ -0,0 +1,31 @@ +# ReopenFindingRequest + +Request to reopen a FSPM finding. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Marks the finding as open again. | +**status_updated_reason** | **str** | Ignored when reopening a finding. | [optional] + +## Example + +```python +from fireblocks.models.reopen_finding_request import ReopenFindingRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ReopenFindingRequest from a JSON string +reopen_finding_request_instance = ReopenFindingRequest.from_json(json) +# print the JSON string representation of the object +print(ReopenFindingRequest.to_json()) + +# convert the object into a dict +reopen_finding_request_dict = reopen_finding_request_instance.to_dict() +# create an instance of ReopenFindingRequest from a dict +reopen_finding_request_from_dict = ReopenFindingRequest.from_dict(reopen_finding_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SecurityFindingDetailed.md b/docs/SecurityFindingDetailed.md new file mode 100644 index 00000000..e432d31d --- /dev/null +++ b/docs/SecurityFindingDetailed.md @@ -0,0 +1,43 @@ +# SecurityFindingDetailed + +A single FSPM finding, redacted to the public field set + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the finding | +**type** | **str** | The finding type identifier | +**status** | **str** | Current status of the finding | +**severity** | **str** | Severity level of the finding | +**category** | **str** | Category of the finding | +**created_at** | **datetime** | When the finding was first detected | +**title** | **str** | Human-readable title of the finding | +**status_updated_at** | **datetime** | When the finding status was last updated, omitted if the status was never updated | [optional] +**status_updated_by_user_id** | **str** | The user who last updated the finding status, omitted if the status was never updated | [optional] +**status_updated_reason** | **str** | The reason provided for the last status update, omitted if none was provided | [optional] +**info** | **Dict[str, object]** | Additional structured context about the finding. Shape varies by finding type. | +**compliance_reqs** | [**List[ComplianceRequirement]**](ComplianceRequirement.md) | Compliance requirements this finding relates to | +**risk_explanation** | **str** | Explanation of the risk this finding represents | +**mitigation_guidance** | **str** | Guidance on how to mitigate this finding | + +## Example + +```python +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed + +# TODO update the JSON string below +json = "{}" +# create an instance of SecurityFindingDetailed from a JSON string +security_finding_detailed_instance = SecurityFindingDetailed.from_json(json) +# print the JSON string representation of the object +print(SecurityFindingDetailed.to_json()) + +# convert the object into a dict +security_finding_detailed_dict = security_finding_detailed_instance.to_dict() +# create an instance of SecurityFindingDetailed from a dict +security_finding_detailed_from_dict = SecurityFindingDetailed.from_dict(security_finding_detailed_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SecurityPostureManagementApi.md b/docs/SecurityPostureManagementApi.md index 9da3f1ea..8cc6c8fe 100644 --- a/docs/SecurityPostureManagementApi.md +++ b/docs/SecurityPostureManagementApi.md @@ -4,16 +4,94 @@ All URIs are relative to *https://api.fireblocks.io/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_security_finding_by_id**](SecurityPostureManagementApi.md#get_security_finding_by_id) | **GET** /security/fspm/findings/{id} | Get a FSPM security finding by ID [**get_security_findings**](SecurityPostureManagementApi.md#get_security_findings) | **GET** /security/fspm/findings | Get FSPM security findings +[**update_security_finding_by_id**](SecurityPostureManagementApi.md#update_security_finding_by_id) | **PATCH** /security/fspm/findings/{id} | Update a FSPM security finding by ID +# **get_security_finding_by_id** +> SecurityFindingDetailed get_security_finding_by_id(id) + +Get a FSPM security finding by ID + +Returns a single FSPM security finding for the workspace, redacted to the public field set. +Endpoint Roles: Security Admin, Security Auditor. + + +### Example + + +```python +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed +from fireblocks.client import Fireblocks +from fireblocks.client_configuration import ClientConfiguration +from fireblocks.exceptions import ApiException +from fireblocks.base_path import BasePath +from pprint import pprint + +# load the secret key content from a file +with open('your_secret_key_file_path', 'r') as file: + secret_key_value = file.read() + +# build the configuration +configuration = ClientConfiguration( + api_key="your_api_key", + secret_key=secret_key_value, + base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1" +) + + +# Enter a context with an instance of the API client +with Fireblocks(configuration) as fireblocks: + id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2' # str | Unique identifier of the finding + + try: + # Get a FSPM security finding by ID + api_response = fireblocks.security_posture_management.get_security_finding_by_id(id).result() + print("The response of SecurityPostureManagementApi->get_security_finding_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SecurityPostureManagementApi->get_security_finding_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the finding | + +### Return type + +[**SecurityFindingDetailed**](SecurityFindingDetailed.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A single FSPM finding | * X-Request-ID -
| +**0** | Error Response | * X-Request-ID -
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_security_findings** > GetFindingsExternalResponse get_security_findings(page_cursor=page_cursor, page_size=page_size, severity=severity, category=category, status=status) Get FSPM security findings Returns a paginated list of FSPM security findings for the workspace. -Endpoint Permissions: Security Admin, Security Auditor. +Endpoint Roles: Security Admin, Security Auditor. ### Example @@ -96,3 +174,85 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_security_finding_by_id** +> SecurityFindingDetailed update_security_finding_by_id(id, update_finding_external_request, idempotency_key=idempotency_key) + +Update a FSPM security finding by ID + +Accepts or reopens a finding for the workspace. When accepting a finding +(`status: "ACCEPTED"`), `statusUpdatedReason` is required. +Endpoint Roles: Security Admin. + + +### Example + + +```python +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed +from fireblocks.models.update_finding_external_request import UpdateFindingExternalRequest +from fireblocks.client import Fireblocks +from fireblocks.client_configuration import ClientConfiguration +from fireblocks.exceptions import ApiException +from fireblocks.base_path import BasePath +from pprint import pprint + +# load the secret key content from a file +with open('your_secret_key_file_path', 'r') as file: + secret_key_value = file.read() + +# build the configuration +configuration = ClientConfiguration( + api_key="your_api_key", + secret_key=secret_key_value, + base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1" +) + + +# Enter a context with an instance of the API client +with Fireblocks(configuration) as fireblocks: + id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2' # str | Unique identifier of the finding + update_finding_external_request = fireblocks.UpdateFindingExternalRequest() # UpdateFindingExternalRequest | + idempotency_key = 'idempotency_key_example' # str | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional) + + try: + # Update a FSPM security finding by ID + api_response = fireblocks.security_posture_management.update_security_finding_by_id(id, update_finding_external_request, idempotency_key=idempotency_key).result() + print("The response of SecurityPostureManagementApi->update_security_finding_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SecurityPostureManagementApi->update_security_finding_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the finding | + **update_finding_external_request** | [**UpdateFindingExternalRequest**](UpdateFindingExternalRequest.md)| | + **idempotency_key** | **str**| A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional] + +### Return type + +[**SecurityFindingDetailed**](SecurityFindingDetailed.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated FSPM finding | * X-Request-ID -
| +**0** | Error Response | * X-Request-ID -
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UpdateFindingExternalRequest.md b/docs/UpdateFindingExternalRequest.md new file mode 100644 index 00000000..6105a5bf --- /dev/null +++ b/docs/UpdateFindingExternalRequest.md @@ -0,0 +1,31 @@ +# UpdateFindingExternalRequest + +Request to update the status of a FSPM finding. Only OPEN (reopen) and ACCEPTED (accept) are settable; findings become RESOLVED via automated detection, not through this API. `statusUpdatedReason` is required when accepting a finding and ignored when reopening. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Marks the finding as open again. | +**status_updated_reason** | **str** | Ignored when reopening a finding. | + +## Example + +```python +from fireblocks.models.update_finding_external_request import UpdateFindingExternalRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateFindingExternalRequest from a JSON string +update_finding_external_request_instance = UpdateFindingExternalRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateFindingExternalRequest.to_json()) + +# convert the object into a dict +update_finding_external_request_dict = update_finding_external_request_instance.to_dict() +# create an instance of UpdateFindingExternalRequest from a dict +update_finding_external_request_from_dict = UpdateFindingExternalRequest.from_dict(update_finding_external_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/fireblocks/__init__.py b/fireblocks/__init__.py index 9bdba53c..c9a7f8b6 100644 --- a/fireblocks/__init__.py +++ b/fireblocks/__init__.py @@ -14,7 +14,7 @@ Do not edit the class manually. """ # noqa: E501 -__version__ = "27.0.0" +__version__ = "0.0.0" # import apis into sdk package from fireblocks.api.api_user_api import ApiUserApi @@ -90,6 +90,7 @@ from fireblocks.models.api_user import APIUser from fireblocks.models.aba_payment_info import AbaPaymentInfo from fireblocks.models.abi_function import AbiFunction +from fireblocks.models.accept_finding_request import AcceptFindingRequest from fireblocks.models.access_registry_address_item import AccessRegistryAddressItem from fireblocks.models.access_registry_current_state_response import ( AccessRegistryCurrentStateResponse, @@ -351,6 +352,7 @@ ) from fireblocks.models.collection_token_metadata_dto import CollectionTokenMetadataDto from fireblocks.models.collection_type import CollectionType +from fireblocks.models.compliance_requirement import ComplianceRequirement from fireblocks.models.compliance_result_full_payload import ComplianceResultFullPayload from fireblocks.models.compliance_result_statuses_enum import ( ComplianceResultStatusesEnum, @@ -1209,6 +1211,7 @@ ) from fireblocks.models.rename_cosigner import RenameCosigner from fireblocks.models.rename_vault_account_response import RenameVaultAccountResponse +from fireblocks.models.reopen_finding_request import ReopenFindingRequest from fireblocks.models.report_conflict_response import ReportConflictResponse from fireblocks.models.report_job import ReportJob from fireblocks.models.report_job_links import ReportJobLinks @@ -1311,6 +1314,7 @@ from fireblocks.models.screening_verdict_matched_rule import ScreeningVerdictMatchedRule from fireblocks.models.search_network_ids_response import SearchNetworkIdsResponse from fireblocks.models.security_finding import SecurityFinding +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed from fireblocks.models.sepa_payment_info import SepaPaymentInfo from fireblocks.models.session_dto import SessionDTO from fireblocks.models.session_metadata import SessionMetadata @@ -1850,6 +1854,9 @@ UpdateCounterpartyGroupRequest, ) from fireblocks.models.update_draft_request import UpdateDraftRequest +from fireblocks.models.update_finding_external_request import ( + UpdateFindingExternalRequest, +) from fireblocks.models.update_legal_entity_request import UpdateLegalEntityRequest from fireblocks.models.update_tag_request import UpdateTagRequest from fireblocks.models.update_token_ownership_status_dto import ( diff --git a/fireblocks/api/security_posture_management_api.py b/fireblocks/api/security_posture_management_api.py index 1d81f43f..b0e618c4 100644 --- a/fireblocks/api/security_posture_management_api.py +++ b/fireblocks/api/security_posture_management_api.py @@ -22,6 +22,8 @@ from typing import Optional from typing_extensions import Annotated from fireblocks.models.get_findings_external_response import GetFindingsExternalResponse +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed +from fireblocks.models.update_finding_external_request import UpdateFindingExternalRequest from fireblocks.api_client import ApiClient, RequestSerialized from fireblocks.api_response import ApiResponse @@ -42,6 +44,135 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def get_security_finding_by_id( + self, + id: Annotated[StrictStr, Field(description="Unique identifier of the finding")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Future[ApiResponse[SecurityFindingDetailed]]: + """Get a FSPM security finding by ID + + Returns a single FSPM security finding for the workspace, redacted to the public field set. Endpoint Roles: Security Admin, Security Auditor. + + :param id: Unique identifier of the finding (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + validate_not_empty_string(function_name="get_security_finding_by_id", param_name="id", param_value=id) + + _param = self._get_security_finding_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SecurityFindingDetailed", + 'default': "ErrorSchema", + } + + return self.api_client.call_api( + *_param, + _request_timeout=_request_timeout, + _response_types_map=_response_types_map, + ) + + def _get_security_finding_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/security/fspm/findings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_security_findings( self, @@ -65,7 +196,7 @@ def get_security_findings( ) -> Future[ApiResponse[GetFindingsExternalResponse]]: """Get FSPM security findings - Returns a paginated list of FSPM security findings for the workspace. Endpoint Permissions: Security Admin, Security Auditor. + Returns a paginated list of FSPM security findings for the workspace. Endpoint Roles: Security Admin, Security Auditor. :param page_cursor: Cursor indicating the page position. Omit to fetch the first page. :type page_cursor: str @@ -211,3 +342,159 @@ def _get_security_findings_serialize( ) + + + @validate_call + def update_security_finding_by_id( + self, + id: Annotated[StrictStr, Field(description="Unique identifier of the finding")], + update_finding_external_request: UpdateFindingExternalRequest, + idempotency_key: Annotated[Optional[StrictStr], Field(description="A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Future[ApiResponse[SecurityFindingDetailed]]: + """Update a FSPM security finding by ID + + Accepts or reopens a finding for the workspace. When accepting a finding (`status: \"ACCEPTED\"`), `statusUpdatedReason` is required. Endpoint Roles: Security Admin. + + :param id: Unique identifier of the finding (required) + :type id: str + :param update_finding_external_request: (required) + :type update_finding_external_request: UpdateFindingExternalRequest + :param idempotency_key: A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. + :type idempotency_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + validate_not_empty_string(function_name="update_security_finding_by_id", param_name="id", param_value=id) + + _param = self._update_security_finding_by_id_serialize( + id=id, + update_finding_external_request=update_finding_external_request, + idempotency_key=idempotency_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SecurityFindingDetailed", + 'default': "ErrorSchema", + } + + return self.api_client.call_api( + *_param, + _request_timeout=_request_timeout, + _response_types_map=_response_types_map, + ) + + def _update_security_finding_by_id_serialize( + self, + id, + update_finding_external_request, + idempotency_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + if idempotency_key is not None: + _header_params['Idempotency-Key'] = idempotency_key + # process the form parameters + # process the body parameter + if update_finding_external_request is not None: + _body_params = update_finding_external_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/security/fspm/findings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/fireblocks/configuration.py b/fireblocks/configuration.py index 5a7e5fcd..c1a025c0 100644 --- a/fireblocks/configuration.py +++ b/fireblocks/configuration.py @@ -550,7 +550,7 @@ def to_debug_report(self) -> str: "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 1.6.2\n" - "SDK Package Version: 27.0.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 0.0.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self) -> List[HostSetting]: diff --git a/fireblocks/models/__init__.py b/fireblocks/models/__init__.py index 89e8e734..3ab53f5e 100644 --- a/fireblocks/models/__init__.py +++ b/fireblocks/models/__init__.py @@ -18,6 +18,7 @@ from fireblocks.models.api_user import APIUser from fireblocks.models.aba_payment_info import AbaPaymentInfo from fireblocks.models.abi_function import AbiFunction +from fireblocks.models.accept_finding_request import AcceptFindingRequest from fireblocks.models.access_registry_address_item import AccessRegistryAddressItem from fireblocks.models.access_registry_current_state_response import AccessRegistryCurrentStateResponse from fireblocks.models.access_registry_current_state_response2 import AccessRegistryCurrentStateResponse2 @@ -205,6 +206,7 @@ from fireblocks.models.collection_token_metadata_attribute_dto import CollectionTokenMetadataAttributeDto from fireblocks.models.collection_token_metadata_dto import CollectionTokenMetadataDto from fireblocks.models.collection_type import CollectionType +from fireblocks.models.compliance_requirement import ComplianceRequirement from fireblocks.models.compliance_result_full_payload import ComplianceResultFullPayload from fireblocks.models.compliance_result_statuses_enum import ComplianceResultStatusesEnum from fireblocks.models.compliance_results import ComplianceResults @@ -763,6 +765,7 @@ from fireblocks.models.rename_connected_account_response import RenameConnectedAccountResponse from fireblocks.models.rename_cosigner import RenameCosigner from fireblocks.models.rename_vault_account_response import RenameVaultAccountResponse +from fireblocks.models.reopen_finding_request import ReopenFindingRequest from fireblocks.models.report_conflict_response import ReportConflictResponse from fireblocks.models.report_job import ReportJob from fireblocks.models.report_job_links import ReportJobLinks @@ -829,6 +832,7 @@ from fireblocks.models.screening_verdict_matched_rule import ScreeningVerdictMatchedRule from fireblocks.models.search_network_ids_response import SearchNetworkIdsResponse from fireblocks.models.security_finding import SecurityFinding +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed from fireblocks.models.sepa_payment_info import SepaPaymentInfo from fireblocks.models.session_dto import SessionDTO from fireblocks.models.session_metadata import SessionMetadata @@ -1148,6 +1152,7 @@ from fireblocks.models.update_callback_handler_response import UpdateCallbackHandlerResponse from fireblocks.models.update_counterparty_group_request import UpdateCounterpartyGroupRequest from fireblocks.models.update_draft_request import UpdateDraftRequest +from fireblocks.models.update_finding_external_request import UpdateFindingExternalRequest from fireblocks.models.update_legal_entity_request import UpdateLegalEntityRequest from fireblocks.models.update_tag_request import UpdateTagRequest from fireblocks.models.update_token_ownership_status_dto import UpdateTokenOwnershipStatusDto diff --git a/fireblocks/models/accept_finding_request.py b/fireblocks/models/accept_finding_request.py new file mode 100644 index 00000000..e2580032 --- /dev/null +++ b/fireblocks/models/accept_finding_request.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AcceptFindingRequest(BaseModel): + """ + Request to accept a FSPM finding. A reason is required. + """ # noqa: E501 + status: StrictStr = Field(description="Marks the finding as accepted.") + status_updated_reason: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The reason for accepting the finding.", alias="statusUpdatedReason") + __properties: ClassVar[List[str]] = ["status", "statusUpdatedReason"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACCEPTED']): + raise ValueError("must be one of enum values ('ACCEPTED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AcceptFindingRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AcceptFindingRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "statusUpdatedReason": obj.get("statusUpdatedReason") + }) + return _obj + + diff --git a/fireblocks/models/compliance_requirement.py b/fireblocks/models/compliance_requirement.py new file mode 100644 index 00000000..f6560197 --- /dev/null +++ b/fireblocks/models/compliance_requirement.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ComplianceRequirement(BaseModel): + """ + A compliance requirement associated with a finding + """ # noqa: E501 + id: StrictStr = Field(description="Identifier of the compliance requirement") + standard: StrictStr = Field(description="The compliance standard this requirement belongs to") + criteria: StrictStr = Field(description="The specific criteria within the compliance standard") + description: Optional[StrictStr] = Field(default=None, description="Human-readable description of the requirement, omitted if not available") + __properties: ClassVar[List[str]] = ["id", "standard", "criteria", "description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ComplianceRequirement from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ComplianceRequirement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "standard": obj.get("standard"), + "criteria": obj.get("criteria"), + "description": obj.get("description") + }) + return _obj + + diff --git a/fireblocks/models/reopen_finding_request.py b/fireblocks/models/reopen_finding_request.py new file mode 100644 index 00000000..75ee7afb --- /dev/null +++ b/fireblocks/models/reopen_finding_request.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReopenFindingRequest(BaseModel): + """ + Request to reopen a FSPM finding. + """ # noqa: E501 + status: StrictStr = Field(description="Marks the finding as open again.") + status_updated_reason: Optional[StrictStr] = Field(default=None, description="Ignored when reopening a finding.", alias="statusUpdatedReason") + __properties: ClassVar[List[str]] = ["status", "statusUpdatedReason"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['OPEN']): + raise ValueError("must be one of enum values ('OPEN')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReopenFindingRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReopenFindingRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "statusUpdatedReason": obj.get("statusUpdatedReason") + }) + return _obj + + diff --git a/fireblocks/models/security_finding.py b/fireblocks/models/security_finding.py index ab08fab7..a12f02ce 100644 --- a/fireblocks/models/security_finding.py +++ b/fireblocks/models/security_finding.py @@ -73,8 +73,8 @@ def category_validate_enum(cls, value): if value is None: return value - if value not in set(['USER_MANAGEMENT', 'ACCESS_CONTROL', 'ADMIN_MANAGEMENT', 'SECURITY', 'CONFIGURATION', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT']): - raise ValueError("must be one of enum values ('USER_MANAGEMENT', 'ACCESS_CONTROL', 'ADMIN_MANAGEMENT', 'SECURITY', 'CONFIGURATION', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT')") + if value not in set(['USER_MANAGEMENT', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT']): + raise ValueError("must be one of enum values ('USER_MANAGEMENT', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT')") return value model_config = ConfigDict( diff --git a/fireblocks/models/security_finding_detailed.py b/fireblocks/models/security_finding_detailed.py new file mode 100644 index 00000000..25337c6b --- /dev/null +++ b/fireblocks/models/security_finding_detailed.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from fireblocks.models.compliance_requirement import ComplianceRequirement +from typing import Optional, Set +from typing_extensions import Self + +class SecurityFindingDetailed(BaseModel): + """ + A single FSPM finding, redacted to the public field set + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the finding") + type: StrictStr = Field(description="The finding type identifier") + status: StrictStr = Field(description="Current status of the finding") + severity: StrictStr = Field(description="Severity level of the finding") + category: StrictStr = Field(description="Category of the finding") + created_at: datetime = Field(description="When the finding was first detected", alias="createdAt") + title: StrictStr = Field(description="Human-readable title of the finding") + status_updated_at: Optional[datetime] = Field(default=None, description="When the finding status was last updated, omitted if the status was never updated", alias="statusUpdatedAt") + status_updated_by_user_id: Optional[StrictStr] = Field(default=None, description="The user who last updated the finding status, omitted if the status was never updated", alias="statusUpdatedByUserId") + status_updated_reason: Optional[StrictStr] = Field(default=None, description="The reason provided for the last status update, omitted if none was provided", alias="statusUpdatedReason") + info: Dict[str, Any] = Field(description="Additional structured context about the finding. Shape varies by finding type.") + compliance_reqs: List[ComplianceRequirement] = Field(description="Compliance requirements this finding relates to", alias="complianceReqs") + risk_explanation: StrictStr = Field(description="Explanation of the risk this finding represents", alias="riskExplanation") + mitigation_guidance: StrictStr = Field(description="Guidance on how to mitigate this finding", alias="mitigationGuidance") + __properties: ClassVar[List[str]] = ["id", "type", "status", "severity", "category", "createdAt", "title", "statusUpdatedAt", "statusUpdatedByUserId", "statusUpdatedReason", "info", "complianceReqs", "riskExplanation", "mitigationGuidance"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS']): + raise ValueError("must be one of enum values ('API_USER_NOT_WHITELISTED', 'CONSOLE_IP_ALLOWLIST_DEACTIVATED', 'ADMIN_TH_SET_TO_ALL_AND_MORE_THAN_2_ADMINS', 'API_USERS_COUNT_PASSES_TH_AND_OWNER_NOT_MANDATORY', 'API_COSIGNER_WITH_NO_CALLBACK', 'API_USER_DIDNT_APPROVE_CCR_IN_X_DAYS', 'NON_VIEWER_DIDNT_INITIATE_APPROVE_OR_SIGN_TX_OR_CCR_LAST_X_DAYS', 'TH_SET_TO_1_AND_MORE_THAN_3_APPROVERS', 'ADMIN_TH_SET_TO_1_AND_MORE_THAN_3_ADMINS', 'NON_EVM_DAPP_CONNECTIONS_ENABLED_BUT_UNUSED', 'OTA_ENABLED_BUT_UNUSED', 'POLICY_NOT_UPDATED_RECENTLY', 'RAW_SIGNING_ENABLED_BUT_UNUSED', 'API_USER_UNUSED_FOR_90_DAYS', 'UNUSED_UNLIMITED_TOKEN_ALLOWANCES', 'UNUSED_WHITELISTED_ADDRESS', 'TRANSACTION_REPETITION_ATTACK', 'USER_EMAIL_DOMAIN_NON_BUSINESS', 'OUTDATED_MOBILE_APP_VERSION', 'SINGLE_HOP_DRAIN_ATTACK', 'LATERAL_MOVEMENT_DRAIN_ATTACK', 'WORKSPACE_USER_DORMANT_FOR_X_DAYS')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['OPEN', 'ACCEPTED', 'RESOLVED']): + raise ValueError("must be one of enum values ('OPEN', 'ACCEPTED', 'RESOLVED')") + return value + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['INFO', 'LOW', 'MEDIUM', 'HIGH']): + raise ValueError("must be one of enum values ('INFO', 'LOW', 'MEDIUM', 'HIGH')") + return value + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['USER_MANAGEMENT', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT']): + raise ValueError("must be one of enum values ('USER_MANAGEMENT', 'APPROVAL_GROUP_MANAGEMENT', 'POLICY_ENGINE_UTILIZATION', 'WORKSPACE_CONFIGURATION', 'DEFI_ACCESS', 'FLEET_MANAGEMENT')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecurityFindingDetailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in compliance_reqs (list) + _items = [] + if self.compliance_reqs: + for _item_compliance_reqs in self.compliance_reqs: + if _item_compliance_reqs: + _items.append(_item_compliance_reqs.to_dict()) + _dict['complianceReqs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecurityFindingDetailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "status": obj.get("status"), + "severity": obj.get("severity"), + "category": obj.get("category"), + "createdAt": obj.get("createdAt"), + "title": obj.get("title"), + "statusUpdatedAt": obj.get("statusUpdatedAt"), + "statusUpdatedByUserId": obj.get("statusUpdatedByUserId"), + "statusUpdatedReason": obj.get("statusUpdatedReason"), + "info": obj.get("info"), + "complianceReqs": [ComplianceRequirement.from_dict(_item) for _item in obj["complianceReqs"]] if obj.get("complianceReqs") is not None else None, + "riskExplanation": obj.get("riskExplanation"), + "mitigationGuidance": obj.get("mitigationGuidance") + }) + return _obj + + diff --git a/fireblocks/models/update_finding_external_request.py b/fireblocks/models/update_finding_external_request.py new file mode 100644 index 00000000..2fd975d8 --- /dev/null +++ b/fireblocks/models/update_finding_external_request.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Fireblocks API + + Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + + The version of the OpenAPI document: 1.6.2 + Contact: developers@fireblocks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from fireblocks.models.accept_finding_request import AcceptFindingRequest +from fireblocks.models.reopen_finding_request import ReopenFindingRequest +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +UPDATEFINDINGEXTERNALREQUEST_ONE_OF_SCHEMAS = ["AcceptFindingRequest", "ReopenFindingRequest"] + +class UpdateFindingExternalRequest(BaseModel): + """ + Request to update the status of a FSPM finding. Only OPEN (reopen) and ACCEPTED (accept) are settable; findings become RESOLVED via automated detection, not through this API. `statusUpdatedReason` is required when accepting a finding and ignored when reopening. + """ + # data type: AcceptFindingRequest + oneof_schema_1_validator: Optional[AcceptFindingRequest] = None + # data type: ReopenFindingRequest + oneof_schema_2_validator: Optional[ReopenFindingRequest] = None + actual_instance: Optional[Union[AcceptFindingRequest, ReopenFindingRequest]] = None + one_of_schemas: Set[str] = { "AcceptFindingRequest", "ReopenFindingRequest" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = UpdateFindingExternalRequest.model_construct() + error_messages = [] + match = 0 + # validate data type: AcceptFindingRequest + if not isinstance(v, AcceptFindingRequest): + error_messages.append(f"Error! Input type `{type(v)}` is not `AcceptFindingRequest`") + else: + match += 1 + # validate data type: ReopenFindingRequest + if not isinstance(v, ReopenFindingRequest): + error_messages.append(f"Error! Input type `{type(v)}` is not `ReopenFindingRequest`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in UpdateFindingExternalRequest with oneOf schemas: AcceptFindingRequest, ReopenFindingRequest. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in UpdateFindingExternalRequest with oneOf schemas: AcceptFindingRequest, ReopenFindingRequest. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AcceptFindingRequest + try: + instance.actual_instance = AcceptFindingRequest.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ReopenFindingRequest + try: + instance.actual_instance = ReopenFindingRequest.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into UpdateFindingExternalRequest with oneOf schemas: AcceptFindingRequest, ReopenFindingRequest. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into UpdateFindingExternalRequest with oneOf schemas: AcceptFindingRequest, ReopenFindingRequest. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AcceptFindingRequest, ReopenFindingRequest]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/pyproject.toml b/pyproject.toml index 086584e0..08a27f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireblocks" -version = "27.0.0" +version = "0.0.0" description = "Fireblocks API" authors = ["Fireblocks "] license = "MIT License" diff --git a/setup.py b/setup.py index 4ebf5261..8e55f57b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "fireblocks" -VERSION = "27.0.0" +VERSION = "0.0.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/test_accept_finding_request.py b/test/test_accept_finding_request.py new file mode 100644 index 00000000..5586a59d --- /dev/null +++ b/test/test_accept_finding_request.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.accept_finding_request import AcceptFindingRequest + + +class TestAcceptFindingRequest(unittest.TestCase): + """AcceptFindingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AcceptFindingRequest: + """Test AcceptFindingRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `AcceptFindingRequest` + """ + model = AcceptFindingRequest() + if include_optional: + return AcceptFindingRequest( + status = 'ACCEPTED', + status_updated_reason = 'Risk accepted - compensating controls are in place' + ) + else: + return AcceptFindingRequest( + status = 'ACCEPTED', + status_updated_reason = 'Risk accepted - compensating controls are in place', + ) + """ + + def testAcceptFindingRequest(self): + """Test AcceptFindingRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_add_connected_account_request.py b/test/test_add_connected_account_request.py index ed19c232..bfd323d9 100644 --- a/test/test_add_connected_account_request.py +++ b/test/test_add_connected_account_request.py @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> AddConnectedAccountRequest: return AddConnectedAccountRequest( provider_id = 'BINANCE', display_name = 'My Binance Account', - creds = '[B@7f57df26', + creds = '[B@2670b08d', api_key = 'api_key_abc123', main_account_id = 'acc-parent-001', account_id = 'provider-acc-001', @@ -47,7 +47,7 @@ def make_instance(self, include_optional) -> AddConnectedAccountRequest: else: return AddConnectedAccountRequest( provider_id = 'BINANCE', - creds = '[B@7f57df26', + creds = '[B@2670b08d', api_key = 'api_key_abc123', ) """ diff --git a/test/test_compliance_requirement.py b/test/test_compliance_requirement.py new file mode 100644 index 00000000..4ce657bf --- /dev/null +++ b/test/test_compliance_requirement.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.compliance_requirement import ComplianceRequirement + + +class TestComplianceRequirement(unittest.TestCase): + """ComplianceRequirement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ComplianceRequirement: + """Test ComplianceRequirement + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ComplianceRequirement` + """ + model = ComplianceRequirement() + if include_optional: + return ComplianceRequirement( + id = '19894318-338e-4304-848f-9388d140e703', + standard = 'SOC 2', + criteria = 'CC7.1', + description = 'Continuous monitoring and configuration baselines' + ) + else: + return ComplianceRequirement( + id = '19894318-338e-4304-848f-9388d140e703', + standard = 'SOC 2', + criteria = 'CC7.1', + ) + """ + + def testComplianceRequirement(self): + """Test ComplianceRequirement""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_reopen_finding_request.py b/test/test_reopen_finding_request.py new file mode 100644 index 00000000..e5e2933b --- /dev/null +++ b/test/test_reopen_finding_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.reopen_finding_request import ReopenFindingRequest + + +class TestReopenFindingRequest(unittest.TestCase): + """ReopenFindingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ReopenFindingRequest: + """Test ReopenFindingRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ReopenFindingRequest` + """ + model = ReopenFindingRequest() + if include_optional: + return ReopenFindingRequest( + status = 'OPEN', + status_updated_reason = 'False positive - reviewed and confirmed no risk' + ) + else: + return ReopenFindingRequest( + status = 'OPEN', + ) + """ + + def testReopenFindingRequest(self): + """Test ReopenFindingRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_security_finding_detailed.py b/test/test_security_finding_detailed.py new file mode 100644 index 00000000..f949fc38 --- /dev/null +++ b/test/test_security_finding_detailed.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.security_finding_detailed import SecurityFindingDetailed + + +class TestSecurityFindingDetailed(unittest.TestCase): + """SecurityFindingDetailed unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SecurityFindingDetailed: + """Test SecurityFindingDetailed + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `SecurityFindingDetailed` + """ + model = SecurityFindingDetailed() + if include_optional: + return SecurityFindingDetailed( + id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2', + type = 'API_COSIGNER_WITH_NO_CALLBACK', + status = 'OPEN', + severity = 'HIGH', + category = 'USER_MANAGEMENT', + created_at = '2026-07-28T11:37:05Z', + title = 'The API user 'Security admin api' is paired with a co-signer and has no callback', + status_updated_at = '2026-08-16T08:52:57Z', + status_updated_by_user_id = '00d77437-3e7a-4e39-8482-55115a7a0892', + status_updated_reason = 'False positive, callback is configured via a different mechanism', + info = {"apiKey":"e7c3f18c-3060-3748-3563-19c3dbb3fa88","apiUserName":"Security admin api","cosignerId":"02f53cfa-34a3-4393-a451-e13dfab3c157","cosignerName":"Production Co-Signer"}, + compliance_reqs = [], + risk_explanation = 'An API user that is paired with a co-signer and does not have a callback implementation is vulnerable to auto-approving, allowing malicious transactions to proceed without review.', + mitigation_guidance = 'Add a callback implementation to the API user. Alternatively, if the API user is no longer needed, you can delete it. To do so, go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select Delete. Note that by default this action can only be performed by the workspace owner.' + ) + else: + return SecurityFindingDetailed( + id = 'd7ca6101-a65e-4a9c-b6c1-b8bd697e0cd2', + type = 'API_COSIGNER_WITH_NO_CALLBACK', + status = 'OPEN', + severity = 'HIGH', + category = 'USER_MANAGEMENT', + created_at = '2026-07-28T11:37:05Z', + title = 'The API user 'Security admin api' is paired with a co-signer and has no callback', + info = {"apiKey":"e7c3f18c-3060-3748-3563-19c3dbb3fa88","apiUserName":"Security admin api","cosignerId":"02f53cfa-34a3-4393-a451-e13dfab3c157","cosignerName":"Production Co-Signer"}, + compliance_reqs = [], + risk_explanation = 'An API user that is paired with a co-signer and does not have a callback implementation is vulnerable to auto-approving, allowing malicious transactions to proceed without review.', + mitigation_guidance = 'Add a callback implementation to the API user. Alternatively, if the API user is no longer needed, you can delete it. To do so, go to Developer Center > API Users, click the actions button (3 dots) next to the API user, and select Delete. Note that by default this action can only be performed by the workspace owner.', + ) + """ + + def testSecurityFindingDetailed(self): + """Test SecurityFindingDetailed""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/test_security_posture_management_api.py b/test/test_security_posture_management_api.py index d96a13f4..e6bb5b55 100644 --- a/test/test_security_posture_management_api.py +++ b/test/test_security_posture_management_api.py @@ -26,6 +26,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_get_security_finding_by_id(self) -> None: + """Test case for get_security_finding_by_id + + Get a FSPM security finding by ID + """ + pass + def test_get_security_findings(self) -> None: """Test case for get_security_findings @@ -33,6 +40,13 @@ def test_get_security_findings(self) -> None: """ pass + def test_update_security_finding_by_id(self) -> None: + """Test case for update_security_finding_by_id + + Update a FSPM security finding by ID + """ + pass + if __name__ == "__main__": unittest.main() diff --git a/test/test_update_finding_external_request.py b/test/test_update_finding_external_request.py new file mode 100644 index 00000000..41870d05 --- /dev/null +++ b/test/test_update_finding_external_request.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" +Fireblocks API + +Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) + +The version of the OpenAPI document: 1.6.2 +Contact: developers@fireblocks.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from fireblocks.models.update_finding_external_request import ( + UpdateFindingExternalRequest, +) + + +class TestUpdateFindingExternalRequest(unittest.TestCase): + """UpdateFindingExternalRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateFindingExternalRequest: + """Test UpdateFindingExternalRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `UpdateFindingExternalRequest` + """ + model = UpdateFindingExternalRequest() + if include_optional: + return UpdateFindingExternalRequest( + status = 'OPEN', + status_updated_reason = 'False positive - reviewed and confirmed no risk' + ) + else: + return UpdateFindingExternalRequest( + status = 'OPEN', + status_updated_reason = 'False positive - reviewed and confirmed no risk', + ) + """ + + def testUpdateFindingExternalRequest(self): + """Test UpdateFindingExternalRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == "__main__": + unittest.main()