Skip to content

Conversation

@norrisng-bc
Copy link
Contributor

@norrisng-bc norrisng-bc commented Sep 4, 2025

Description

This PR is a slight tweak to #312 .

When calling GET /object (search objects) without authentication, instead of whitelisting a limited subset of search parameters (bucketId, objectId, public, page, limit, sort), all parameters except for path are now allowed.

The other restrictions while no-auth remain; i.e. requiring a bucketId or objectId, ?public=true and redaction of some response fields.

No-auth object searches are already scoped by bucketId, so allowing other parameters is safe. However, path will still be blocked as it can potentially expose the underlying S3 bucket directory structure.

This allows the object filters in BCBox's <ObjectTable> to work without authentication (i.e. for displaying public folders).

Other tweaks:

  • Fix typos in the existing OpenAPI spec
  • GitHub Actions: temporarily disable Code Climate coverage, as Code Climate has turned their API off

https://apps.nrs.gov.bc.ca/int/jira/browse/SHOWCASE-3969

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

N/A

No-auth search is already scoped by requiring a bucketId, so allowing the other params is safe.
`path` is still blocked though, as it can expose the underlying S3 directory structure.
@github-actions
Copy link

github-actions bot commented Sep 4, 2025

Coverage Report

Totals Coverage
Statements: 55.34% ( 3057 / 5524 )
Methods: 45.67% ( 332 / 727 )
Lines: 61.99% ( 1833 / 2957 )
Branches: 48.48% ( 892 / 1840 )

@TimCsaky TimCsaky merged commit 77991bb into master Sep 4, 2025
13 checks passed
@norrisng-bc norrisng-bc deleted the chore/get-public-noauth-block-path-param branch September 4, 2025 21:50
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.

3 participants