Skip to content

Conversation

@ElienVandermaesenVITO
Copy link
Contributor

follow up on #411

@ElienVandermaesenVITO
Copy link
Contributor Author

@bossie bossie linked an issue Oct 27, 2025 that may be closed by this pull request
Copy link
Collaborator

@bossie bossie left a comment

Choose a reason for hiding this comment

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

Also add tests to make sure that these assets are actually downloadable (their hrefs have to work), for:

  • assets declared in the result Collection,
  • assets declared in the results item(s).

Check test_download* functions in test_views.py for inspiration.

)


if len(result_metadata.items) > 0 :
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if len(result_metadata.items) > 0 :
if result_metadata.items:

I would take the opportunity to replace this as it it shorter, safer and expresses the intent better.


resp = api110.get(f"/jobs/{job_id}/results", headers=self.AUTH_HEADER).assert_status_code(200)

assert "assets" in resp.json
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test the actual value of this assets property.

@EmileSonneveld
Copy link
Member

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1190 to +1195
if len(result_metadata.items) > 0 :
assets = {
item_key + "_" + asset_key: asset_metadata
for item_key, item_metadata in result_items.items()
for asset_key, asset_metadata in item_metadata.get("assets").items()
}

Choose a reason for hiding this comment

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

P1 Badge Build STAC 1.1 assets without URL signing

When items are present the collection’s assets are now rebuilt straight from result_metadata.items (item_metadata.get("assets").items()) without calling _asset_object. In the STAC 1.0 path each asset is wrapped by _asset_object, which injects signed/absolute hrefs and honours the asset flag. The new branch therefore returns raw backend metadata for STAC 1.1, which can omit href entirely or contain unsigned/internal paths, breaking download links for backends that rely on asset_url.build_url or URL signing. This regression only manifests for jobs producing STAC 1.1 items and makes the collection response unusable for clients expecting valid asset URLs.

Useful? React with 👍 / 👎.

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.

assets field in collection

4 participants