Skip to content

Legal API: "GET business" V2 endpoint should check authorization before returning slim response #30274

Open

Description

@severinbeauvais

In the following endpoint code, if the request is "slim" then data is returned, even if the current account is not authorized.

I think authorization should be checked before returning data.

https://github.com/bcgov/lear/blob/bc3f073d696561f2bcd258f728906e655d58dc7d/legal-api/src/legal_api/resources/v2/business/business.py#L58

Activity

  1. added
    Entities Team
    bug
    on Aug 19, 2025
  2. vysakh-menon-aot commented on Aug 19, 2025

    @vysakh-menon-aot
    Contributor

    @kialj876 any impact on business/person search updates if we do this?

  3. argush3 commented on Aug 19, 2025

    @argush3
    Contributor

    Pretty sure slim version of GET business endpoint still needs to be open for search

  4. severinbeauvais commented on Aug 19, 2025

    @severinbeauvais
    CollaboratorAuthor

    Pretty sure slim version of GET business endpoint still needs to be open for search

    It would be great to drop a code comment in there explaining this, because it looks wrong, haha.

  5. argush3 commented on Aug 19, 2025

    @argush3
    Contributor

    yeah, we can drop a comment in the code as soon as we get confirmation from Kial.

  6. severinbeauvais commented on Aug 20, 2025

    @severinbeauvais
    CollaboratorAuthor

    Current status: waiting for Kial to advise on whether the current code order is correct. If it is, we should add a code comment with an explanation. If not then we should switch the code order.

  7. severinbeauvais commented on Oct 23, 2025

    @severinbeauvais
    CollaboratorAuthor

    According to this comment in a LEAR PR, all data in the slim response is legally valid to show to a public user.

    Hence, THIS ticket is not needed and can be closed.

    @kialj876 Is my analysis correct? Thanks!

  8. TVWerdal commented on Feb 5, 2026

    @TVWerdal
    Collaborator

    @kialj876 Just wanted to bump this ticket back into discussion, is @severinbeauvais analysis correct? Could this ticket be closed?

    @mbertucci FYI.

  9. kialj876 commented on May 15, 2026

    @kialj876
    Collaborator

    Sorry I didn't see this till now. I originally added the 'slim' response for the search use case and it started as public only data. Since then we've added a new business public accessible endpoint that search was updated to use so this can be closed over with auth now (note: the code needs to be turned on for the non slim auth as well which could be part of this ticket)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities Teambugtechdebt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions