PolicySet: one file with a base policy and roles

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
42/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python, yaml
Domain
backend, security

Research direction

Start in src/sqlguardllm/policy_set.py, where PolicySet.from_file() needs to read a base policy plus roles and merge overrides and extends. Check tests/test_policy_set.py for existing Policy and Guard conventions, and look at examples/roles.yaml for the target file shape. Done when base/role merging, extends with cycle rejection as PolicyError, and cached for_role() lookups are covered by tests; the issue depends on #11, so confirm that work is merged first.

Written by the indexing model from the issue text.

Description

area:rls size:s type:feature
Goal

Keep every role's policy in one reviewed file instead of building them in code.

Acceptance criteria
  • PolicySet.from_file() with base and roles; a role overrides or extends lists and mappings of the base
  • extends: other_role for inheritance, with cycles rejected as PolicyError
  • policy_set.for_role(name) returns a Policy and caches the compiled Guard
  • Example file in examples/roles.yaml and tests for overrides, inheritance and unknown roles
Relevant files
  • src/sqlguardllm/policy_set.py
  • examples/roles.yaml
  • tests/test_policy_set.py
Size

S (up to half a day)

Notes
Dominant language
Python
Stars
0
Forks
0
Avg merge
1m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jmmana/sqlguardllm

All issues in jmmana/sqlguardllm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.