Skip to content

Conversation

@cyouri-csgroup
Copy link
Contributor

Description:
The goal of this PR is to update to the latest version of stac-fastapi 3.0.0.

  • Reworks middlewares signature to solve the breaking changes (#442 - allow user to pass middleware options).
  • Adapts the new link "queryable".
  • Reworks tests: status_code output (200 --> 201 when posting a new collection/item) and new queryable link.

@@ -1,4 +1,15 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.

Check warning

Code scanning / Trivy

urllib3: proxy-authorization request header is not stripped during cross-origin redirects

Package: urllib3 Installed Version: 2.0.7 Vulnerability CVE-2024-37891 Severity: MEDIUM Fixed Version: 1.26.19, 2.2.2 Link: [CVE-2024-37891](https://avd.aquasec.com/nvd/cve-2024-37891)
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@github-actions
Copy link

github-actions bot commented Sep 5, 2024

SonarQube Quality Gate Result

  • Result: ✅ OK
  • Branch: 484/merge
  • Triggered by @cyouri-csgroup on pull_request
Metric Status Value Error Threshold
New reliability rating ✅ OK 1 > 1
New security rating ✅ OK 1 > 1
New maintainability rating ✅ OK 1 > 1
New coverage ✅ OK 94.20 < 80
New duplicated lines density ✅ OK 0 > 3

View on SonarQube

updated: 9/18/2024, 14:36:01 (UTC+0)


# Don't forward responses that fail
if response.status_code != 200:
if response.status_code not in [200, 201]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use if not response.is_success instead ? @Padeanu what do you think ?

    @property
    def is_success(self) -> bool:
        """
        A property which is `True` for 2xx status codes, `False` otherwise.
        """
        return codes.is_success(self.status_code)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i would be nice


if path == "/collections":
return CATALOG_COLLECTION
new_path = CATALOG_COLLECTION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use a new_path variable, why can't you just return as before ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for the code readability + easier to manipulate in case of debugging.

@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.

Check warning

Code scanning / Trivy

urllib3: proxy-authorization request header is not stripped during cross-origin redirects

Package: urllib3 Installed Version: 2.0.7 Vulnerability CVE-2024-37891 Severity: MEDIUM Fixed Version: 1.26.19, 2.2.2 Link: [CVE-2024-37891](https://avd.aquasec.com/nvd/cve-2024-37891)
@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.

Check warning

Code scanning / Trivy

urllib3: proxy-authorization request header is not stripped during cross-origin redirects

Package: urllib3 Installed Version: 2.0.7 Vulnerability CVE-2024-37891 Severity: MEDIUM Fixed Version: 1.26.19, 2.2.2 Link: [CVE-2024-37891](https://avd.aquasec.com/nvd/cve-2024-37891)
@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.

Check warning

Code scanning / Trivy

urllib3: proxy-authorization request header is not stripped during cross-origin redirects

Package: urllib3 Installed Version: 2.0.7 Vulnerability CVE-2024-37891 Severity: MEDIUM Fixed Version: 1.26.19, 2.2.2 Link: [CVE-2024-37891](https://avd.aquasec.com/nvd/cve-2024-37891)
@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.

Check warning

Code scanning / Trivy

urllib3: proxy-authorization request header is not stripped during cross-origin redirects

Package: urllib3 Installed Version: 2.0.7 Vulnerability CVE-2024-37891 Severity: MEDIUM Fixed Version: 1.26.19, 2.2.2 Link: [CVE-2024-37891](https://avd.aquasec.com/nvd/cve-2024-37891)
@cyouri-csgroup cyouri-csgroup merged commit 160b69a into develop Sep 18, 2024
@Padeanu Padeanu deleted the feat-rspy197/update_to_stac-fastapi_3.0.0 branch September 19, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants