Skip to content

Implement configurable identifiers for access control #142

Closed

Description

@kushagra189

Access control uses the default function generate_id for creating identifiers for new objects. We need to support configurable parameters for the same. Currently, we are using the default support that foca provides. We need to add parameters as a part of AccessControlConfig in order to give user more accessibility.

Activity

  1. self-assigned this
    on Sep 2, 2022
  2. added
    priority: critical
    status: triage
    type: bug
    type: maintenance
    workload: hours
    on Sep 2, 2022
  3. added
    priority: low
    and removed
    priority: critical
    on Sep 2, 2022
  4. uniqueg commented on Sep 2, 2022

    @uniqueg
    Member

    Updated the priority: app devs probably don't care too much what the permission resources are called like, and actual users will likely never have to see/deal with them. And IF app devs really want to enforce other naming for the resources (when using the default API and controllers), they can do so via the PUT /permissions/{id} endpoint.

  5. added
    flag: good 1st issue
    type: feature
    and removed
    type: bug
    type: maintenance
    on Sep 2, 2022
  6. kushagra189 commented on Nov 9, 2022

    @kushagra189
    ContributorAuthor
  7. moved this to Todo access control in FOCA releaseon Dec 2, 2023
  8. added this to the v1.0.0 milestone on Dec 2, 2023
  9. uniqueg commented on Oct 18, 2026

    @uniqueg
    Member

    Refined proposal

    Since #268, generate_id(charset, length) uses secrets.choice and takes plain arguments, so this is now small. We would:

    • Add security.access_control.id_charset (default: ASCII letters and digits) and id_length (default 6, range 4 to 64), validated in AccessControlConfig, and pass them to generate_id in Adapter.save_policy_line.
    • Add a unique index on id in the policy collection and retry with a new ID on a duplicate key error (a few attempts), so collisions cannot overwrite rules.
    • Validate IDs supplied via PUT /permissions/{id} against the same charset and length (400 otherwise).

    Acceptance criteria

    • Config fields with validation and docs.
    • Tests: generated IDs follow the configured charset/length; duplicate key triggers a retry; invalid PUT IDs yield 400.

    Breaking changes
    PUT /permissions/{id} rejects IDs that do not match the configured charset/length; check existing custom IDs before upgrading.

    Planned PR
    4 (refactor(access-control): tidy permissions API).

  10. moved this from Todo access control to Done in FOCA releaseon Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowstatus: triagetype: featureworkload: hours

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions