Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/list Endpoint Does Not Filter Logs by User ID #200

Open
Alb11747 opened this issue Mar 21, 2024 · 0 comments
Open

/list Endpoint Does Not Filter Logs by User ID #200

Alb11747 opened this issue Mar 21, 2024 · 0 comments

Comments

@Alb11747
Copy link

Description

The /list endpoint in JustLog does not correctly filter logs by the userid parameter. Instead of returning logs specific to the provided user ID, it returns logs for the entire channel.

Steps to Reproduce

  1. Make a GET request to https://justlog.alb11747.com/list?channel=fobm4ster&userid=31062476.

    • Expected: Logs filtered by the specified user ID.
    • Actual: Logs for the entire channel.

    Sample Output:

    {
      "availableLogs": [
        {"year": "2024", "month": "3"},
        {"year": "2024", "month": "2"},
        {"year": "2024", "month": "1"},
        {"year": "2023", "month": "12"}
      ]
    }
  2. Make a GET request to https://justlog.alb11747.com/list?channelid=31062476&userid=31062476.

    • Expected: Logs filtered by the specified user ID.
    • Actual: Logs for the entire channel.

    Sample Output:

    {
      "availableLogs": [
        {"year": "2024", "month": "3"},
        {"year": "2024", "month": "2"},
        {"year": "2024", "month": "1"},
        {"year": "2023", "month": "12"}
      ]
    }
  3. Make a GET request to https://justlog.alb11747.com/list?username=fobm4ster&channelid=31062476.

    • This call correctly returns logs filtered by the username and channel ID.

    Sample Output:

    {
      "availableLogs": [
        {"year": "2023", "month": "12", "day": "23"},
        {"year": "2023", "month": "12", "day": "12"},
        {"year": "2023", "month": "12", "day": "24"}
      ]
    }

Expected Behavior

The /list endpoint should filter logs based on the userid parameter when provided, similar to how it filters based on the username and channelid parameters.

Actual Behavior

The /list endpoint ignores the userid parameter and returns logs for the entire channel.

Additional Information

  • JustLog version: ghcr.io/gempir/justlog:latest@sha256:b414506c7da33c958b831f29d0d7fc947a17bd9f55c09b79d05020b1c53765d4

Possible Solution

It appears that the userid parameter is not being properly handled in the query logic for the /list endpoint. A review of the parameter parsing and filtering logic may be necessary to resolve this issue.

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

No branches or pull requests

1 participant