Skip to content

Filtering users by created at and/or last updated at #15570

@josegomezr

Description

@josegomezr

Is your feature request related to a problem? Please describe.

In a similar situation as in #15569, when interfacing authentik with other systems we want to limit the scope of syncing information out of authentik to only the users modified/created since a specific timestamp (ideally the last sync).

However the API does not expose such filter, upon further inspection there's no timestamps in the database table either :/

Describe the solution you'd like

Two fields:

  • created_at = DateTimeField(auto_now_add=True)
  • updated_at = DateTimeField(auto_now=True)

And the corresponding filters in the API that enable consumers to do:

  1. GET /api/v3/core/users/?updated_at__gt=%utc-timestamp%
  2. GET /api/v3/core/users/?created_at__gt=%utc-timestamp%

And returns (respectively)

  1. Users modified since %utc-timestamp%
  2. Users created since %utc-timestamp%

Describe alternatives you've considered
Again using an intermediate storage to keep track of the dates, but that's an extra moving part we don't enjoy having around.

Additional context
We have an implementation in #15571 *

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions