Skip to content

Commit

Permalink
Merge pull request #10 from FiniteStateInc/v0.1.0
Browse files Browse the repository at this point in the history
v0.1.0
  • Loading branch information
nickvido authored Oct 26, 2023
2 parents d6a2c01 + 25b5501 commit b65b414
Show file tree
Hide file tree
Showing 8 changed files with 1,307 additions and 1,217 deletions.
35 changes: 35 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Finite State Python SDK RELEASE NOTES

# v0.1.0

Updated minor version due to breaking change.

## New Features
N/A

## Bug Fixes
N/A

## Breaking Changes

* GraphQL queries that fail will now raise an Exception with details about the exception

Your code should include try / except blocks for making calls, instead of relying on the API to return a potentially unexpected JSON document with an `errors` field.


# v0.0.8

## New Features
* Updated TOKEN_URL endpoint
* Added get_asset_versions method
* Updated Asset Versions query to have group information
* Added cve_id filter for Get Findings variables
* Added generate_download_sbom_url and queries and variables to support CycloneDX and SPDX downloads
* Added download_sbom helper function
* Added download_sboms.py example

## Bug Fixes
* N/A

## Breaking Changes
* N/A
898 changes: 454 additions & 444 deletions docs/finite_state_sdk.html

Large diffs are not rendered by default.

1,424 changes: 732 additions & 692 deletions docs/finite_state_sdk/queries.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/finite_state_sdk/token_cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h2>API Documentation</h2>
</ul>


<footer>finite-state-sdk-python v0.0.8</footer>
<footer>finite-state-sdk-python v0.1.0</footer>

<a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev" target="_blank">
built with <span class="visually-hidden">pdoc</span><img
Expand Down
2 changes: 1 addition & 1 deletion docs/search.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions finite_state_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ def generate_sbom_download_url(token, organization_context, sbom_type=None, sbom
if verbose:
print('Polling every 5 seconds for export job to complete')
total_time = 0
sleep_time = 5
sleep_time = 10
while True:
time.sleep(sleep_time)
total_time += sleep_time
Expand Down Expand Up @@ -1478,7 +1478,12 @@ def send_graphql_query(token, organization_context, query, variables=None):
response = requests.post(API_URL, headers=headers, json=data)

if response.status_code == 200:
return response.json()
thejson = response.json()

if "errors" in thejson:
raise Exception(f"Error: {thejson['errors']}")

return thejson
else:
raise Exception(f"Error: {response.status_code} - {response.text}")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "finite-state-sdk"
version = "0.0.8"
version = "0.1.0"
authors = [
"Finite State, Inc. <[email protected]>"
]
Expand Down
Loading

0 comments on commit b65b414

Please sign in to comment.