wrote 1st ver of task-brief
This commit is contained in:
112
sources/project-5-task-brief.md
Normal file
112
sources/project-5-task-brief.md
Normal file
@@ -0,0 +1,112 @@
|
||||
### 1. Task Description
|
||||
|
||||
NearBeach is a Django/Vue project management tool that currently has task detail views and task creation, but lacks a general task list view for users to see all their tasks across projects. Users must navigate through individual projects or kanban boards to find tasks, which is inefficient for project managers overseeing multiple projects. This task adds a dedicated 'tasks' page with filtering (status, assignee, project, date range), sortable columns, and pagination.
|
||||
|
||||
---
|
||||
|
||||
### 2. How to Judge Completion
|
||||
|
||||
Run the NearBeach setup commands (install, migrate, create superuser, runserver), log in as admin/password, and navigate to 'tasks' - a paginated table of tasks the user has permission to view should appear.
|
||||
|
||||
Test filtering by status, assignee, project, and date range; verify column headers toggle ascending/descending sort; confirm page size selector (10/25/50/100) and page navigation work.
|
||||
|
||||
- Run `python3 manage.py test NearBeach.tests.tests_views.tests_task` - 10+ new tests covering filtering, sorting, pagination, and permissions should pass.
|
||||
- Create a second user without access to a project, log in as them, and verify they cannot see tasks from that project.
|
||||
|
||||
---
|
||||
|
||||
### 3. Other Notes for Reviewer
|
||||
|
||||
NearBeach uses a group-based permission system via ObjectAssignment - users only see tasks from projects their groups are assigned to. The implementation must filter the queryset at the database level (not in templates) following the existing pattern in 'sprint_list' view. Superusers bypass all filters. The task touches Django views, templates, URL routing, forms, and requires comprehensive tests to ensure permission filtering works correctly across all filter/sort/pagination combinations.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Implementation Essentials (for Model)
|
||||
|
||||
**View & Template:**
|
||||
- Server-rendered Django template (no Vue component): `NearBeach/templates/NearBeach/tasks/task_list.html`
|
||||
- URL: `path("tasks/", views.task_list, name="task_list")`
|
||||
- Follows `sprint_list` pattern for permission filtering via `ObjectAssignment` → `UserGroup` → `Group`
|
||||
- All state (filters, sort, page, page_size) lives in the query string; every link rebuilds it
|
||||
|
||||
**Filter Sidebar (GET form, `action="/tasks/"`):**
|
||||
| Param | Control | Query |
|
||||
|-------|---------|-------|
|
||||
| `status` (repeatable) | Checkboxes; value = `task_status_id` | `task_status_id__in=[...]` |
|
||||
| `assignee` | Select; value = user `id` (0 = Unassigned) | `task_assigned_to=<id>` / `task_assigned_to__isnull=True` |
|
||||
| `project` | Select; value = `project_id` | Tasks linked via `ObjectAssignment` |
|
||||
| `start_date` | `<input type="date">`, optional | `task_start_date__gte=value` |
|
||||
| `end_date` | `<input type="date">`, optional | `task_end_date__lte=value` |
|
||||
|
||||
- Status options from `ListOfTaskStatus` ordered by `task_status_sort_order`
|
||||
- Assignee options: "All", users with task access in accessible projects, "Unassigned" (0)
|
||||
- Project options: "All", projects user can reach through their groups
|
||||
- Clear Filters = link to `/tasks/` (drops all params); Apply = form submit
|
||||
- Hidden `sort` input in form carries current sort; hidden `page_size` dropdown in form
|
||||
|
||||
**Table (9 columns):**
|
||||
| Column | Sort Field | Rendering |
|
||||
|--------|------------|-----------|
|
||||
| Title | `task_short_description` | Bold description + `#T-{task_id}` small |
|
||||
| Status | `task_status__task_status_sort_order` | Badge: `badge-{{ higher_order_status\|lower }}` |
|
||||
| Priority | `task_priority` | 8px dot + `{{ get_task_priority_display }}` |
|
||||
| Assignee | `task_assigned_to__username` | Username or `-` |
|
||||
| Project | `first_project_name` (annotated) | Via `ObjectAssignment` subquery |
|
||||
| Start Date | `task_start_date` | `Y-m-d` |
|
||||
| End Date | `task_end_date` | `Y-m-d` |
|
||||
| Created | `date_created` | `Y-m-d` (default sort: `-date_created`) |
|
||||
| Actions | — | "View" → `{% url 'task_information' task.task_id %}` |
|
||||
|
||||
**Status Badges** (4 classes by `task_higher_order_status`):
|
||||
- `badge-backlog` (New, Backlog) — yellow
|
||||
- `badge-normal` (In Progress, Test/Review) — blue
|
||||
- `badge-blocked` (Blocked) — red
|
||||
- `badge-closed` (Closed) — green
|
||||
|
||||
**Priority** (3 color groups):
|
||||
- `priority-high` (0=Highest, 1=High) — red
|
||||
- `priority-normal` (2=Normal) — orange
|
||||
- `priority-low` (3=Low, 4=Lowest) — blue
|
||||
|
||||
**Sorting:**
|
||||
- `?sort=field` = ASC (▲), `?sort=-field` = DESC (▼)
|
||||
- Click active column → toggle; click different column → ASC
|
||||
- Allowed fields: the 8 above only; invalid falls back to default
|
||||
- Header links keep all other params, reset `page=1`
|
||||
- Hidden `sort` input in filter form persists current sort
|
||||
|
||||
**Pagination:**
|
||||
- `page_size`: 10/25/50/100 (default 25); invalid → 25; dropdown in filter form, auto-submits
|
||||
- `page`: `Paginator.get_page()` (safe); elided range: `on_each_side=2, on_ends=1`
|
||||
- Prev/Next: disabled (`<span>`) on first/last page
|
||||
- All page links preserve filters, sort, page_size; change only `page`
|
||||
- Apply / sort click / page_size change / Clear Filters → reset to `page=1`
|
||||
- Results: `Showing {{ page_obj.start_index }}–{{ page_obj.end_index }} of {{ paginator.count }} tasks`
|
||||
|
||||
**Actions Column:** Pinned right (`th:last-child, td:last-child { position: sticky; right: 0; }`); other columns scroll sideways inside container
|
||||
|
||||
**Empty State:** `{% empty %}` row with `colspan="9"`, centered "No tasks found"; count shows "0–0 of 0"
|
||||
|
||||
**Permissions (DB-level, not template):**
|
||||
- Queryset limited to tasks from projects user's groups can reach via `ObjectAssignment`
|
||||
- Superusers see all
|
||||
- `user_level` = max task permission across groups
|
||||
- "+ New Task" button: `user_level >= 3`
|
||||
- "View" button: `user_level >= 1`
|
||||
- Filter sidebar: always visible
|
||||
|
||||
**Styling:**
|
||||
- New partial: `src/sass/components/_task_list.scss` → imported in `main.scss`
|
||||
- Add `--nb-*` tokens for new colors in both `_light_theme.scss` and `_dark_theme.scss`
|
||||
- Reuse: `btn btn-primary`, `btn btn-secondary`, `form-control`, `badge`, card/spacing styles
|
||||
- Layout: desktop = sidebar (~280px) + table; <1024px = stacked
|
||||
- Table cells: 12px 16px padding
|
||||
- Badge text + background readable in both themes
|
||||
|
||||
**Tests:** 12 test methods in `NearBeach/tests/tests_views/tests_task/test_task_list.py`
|
||||
Binary file not shown.
@@ -1,112 +1,170 @@
|
||||
### 1. Task Description
|
||||
|
||||
NearBeach is a Django/Vue project management tool that currently has task detail views and task creation, but lacks a general task list view for users to see all their tasks across projects. Users must navigate through individual projects or kanban boards to find tasks, which is inefficient for project managers overseeing multiple projects. This task adds a dedicated 'tasks' page with filtering (status, assignee, project, date range), sortable columns, and pagination.
|
||||
Build a Django Security Configuration Auditor — a CLI tool that scans Django settings files for production readiness issues. The tool parses Django settings (including `settings.py`, `local_settings.py`, and environment-based configurations) and runs 50+ security checks across categories: DEBUG/SECRET_KEY exposure, security headers (CSP, HSTS, X-Frame-Options), password validators, token/session expiry, CORS, file upload limits, SSL/HTTPS settings, and more. Output formats include human-readable table, JSON, and SARIF for CI/CD integration with exit codes for pipeline gating.
|
||||
|
||||
This is a genuine security tool that Django projects need. The NearBeach audit itself revealed exactly the kinds of issues this tool would catch (hardcoded SECRET_KEY, DEBUG=True, missing security headers, non-expiring tokens). Existing tools like `django-check-secrets` or `bandit` don't do Django-specific settings analysis comprehensively.
|
||||
|
||||
---
|
||||
|
||||
### 2. How to Judge Completion
|
||||
|
||||
Run the NearBeach setup commands (install, migrate, create superuser, runserver), log in as admin/password, and navigate to 'tasks' - a paginated table of tasks the user has permission to view should appear.
|
||||
**Primary check (NearBeach test case):**
|
||||
1. Mount the NearBeach zip and run the auditor against its `local/settings.py`:
|
||||
```bash
|
||||
python -m djangosecauditor /path/to/nearbeach/local/settings.py --format table
|
||||
```
|
||||
2. The tool should report **17+ findings** including at minimum:
|
||||
- CRITICAL: `DEBUG = True`
|
||||
- CRITICAL: Hardcoded `SECRET_KEY`
|
||||
- HIGH: Missing `SECURE_SSL_REDIRECT`, `SECURE_HSTS_SECONDS`, `SECURE_CONTENT_TYPE_NOSNIFF`
|
||||
- HIGH: Missing `X_FRAME_OPTIONS` or set to `SAMEORIGIN` instead of `DENY`
|
||||
- HIGH: Missing CSP headers (`CONTENT_SECURITY_POLICY`)
|
||||
- MEDIUM: Weak/absent password validators
|
||||
- MEDIUM: Missing/short token expiry (`REST_FRAMEWORK` token settings, `SIMPLE_JWT` settings)
|
||||
- MEDIUM: `ALLOWED_HOSTS` too permissive or `['*']`
|
||||
- MEDIUM: Missing `SECURE_REFERRER_POLICY`, `SECURE_CROSS_ORIGIN_OPENER_POLICY`
|
||||
|
||||
Test filtering by status, assignee, project, and date range; verify column headers toggle ascending/descending sort; confirm page size selector (10/25/50/100) and page navigation work.
|
||||
**Hardened settings check:**
|
||||
3. Create a minimal hardened Django settings file (or fix NearBeach's settings) and run again:
|
||||
```bash
|
||||
python -m djangosecauditor /path/to/hardened/settings.py --format json
|
||||
```
|
||||
Should report **0 findings** (exit code 0).
|
||||
|
||||
- Run `python3 manage.py test NearBeach.tests.tests_views.tests_task` - 10+ new tests covering filtering, sorting, pagination, and permissions should pass.
|
||||
- Create a second user without access to a project, log in as them, and verify they cannot see tasks from that project.
|
||||
**CI/CD integration check:**
|
||||
4. Run with SARIF output and verify valid SARIF 2.1.0:
|
||||
```bash
|
||||
python -m djangosecauditor /path/to/settings.py --format sarif --output results.sarif
|
||||
```
|
||||
Validate with `jq` or a SARIF viewer — each finding should have `ruleId`, `level`, `message`, `locations`.
|
||||
|
||||
**Test suite:**
|
||||
5. Run the project's test suite:
|
||||
```bash
|
||||
python -m pytest tests/ -v
|
||||
```
|
||||
Should pass with 50+ test cases covering rule logic, settings parsing (various formats), output formats, and edge cases.
|
||||
|
||||
**Exit codes:**
|
||||
6. Verify exit codes: `0` = clean, `1` = findings present, `2` = error (invalid settings, parse failure).
|
||||
|
||||
---
|
||||
|
||||
### 3. Other Notes for Reviewer
|
||||
|
||||
NearBeach uses a group-based permission system via ObjectAssignment - users only see tasks from projects their groups are assigned to. The implementation must filter the queryset at the database level (not in templates) following the existing pattern in 'sprint_list' view. Superusers bypass all filters. The task touches Django views, templates, URL routing, forms, and requires comprehensive tests to ensure permission filtering works correctly across all filter/sort/pagination combinations.
|
||||
|
||||
|
||||
This tool automates the manual Django security audit I just performed on NearBeach, which uncovered 17 production-readiness issues. The problem it solves: Django projects ship with insecure defaults, and developers often miss settings that must be explicitly hardened for production. Existing tools (`bandit`, `django-check-secrets`, `safety`) focus on code vulnerabilities or dependency scanning, not Django-specific configuration analysis.
|
||||
|
||||
**Why this matters:** A single misconfigured setting (e.g., `DEBUG=True`, weak `SECRET_KEY`, missing HSTS) can lead to full compromise. This tool makes "secure by default" enforceable in CI/CD.
|
||||
|
||||
**Architecture:** Pure static analysis — no Django runtime, no database, no network calls. Parses settings as Python AST (handles `from .base import *`, environment variables via `os.environ.get()`, `django-environ`, `python-decouple`). Rule engine is extensible: each check is a class with `check(settings_dict) -> List[Finding]`.
|
||||
|
||||
**Scope:** Django settings only. Not scanning `requirements.txt`/`pyproject.toml` for vulnerable dependencies (that's a separate tool's job).
|
||||
|
||||
**Safety:** No credentials, no external API calls, no code execution beyond AST parsing. Safe to share and run on any codebase.
|
||||
|
||||
---
|
||||
|
||||
### Implementation Essentials (for Model)
|
||||
|
||||
**View & Template:**
|
||||
- Server-rendered Django template (no Vue component): `NearBeach/templates/NearBeach/tasks/task_list.html`
|
||||
- URL: `path("tasks/", views.task_list, name="task_list")`
|
||||
- Follows `sprint_list` pattern for permission filtering via `ObjectAssignment` → `UserGroup` → `Group`
|
||||
- All state (filters, sort, page, page_size) lives in the query string; every link rebuilds it
|
||||
**Project Structure:**
|
||||
```
|
||||
djangosecauditor/
|
||||
├── pyproject.toml # Typer CLI, pytest, rich for table output
|
||||
├── src/djangosecauditor/
|
||||
│ ├── __init__.py
|
||||
│ ├── __main__.py # Entry point: `python -m djangosecauditor`
|
||||
│ ├── cli.py # Typer app, commands: scan, rules, version
|
||||
│ ├── parser/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── settings_parser.py # AST-based parser for settings.py + env
|
||||
│ │ └── env_resolver.py # Resolves os.environ.get(), django-environ, decouple
|
||||
│ ├── rules/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── registry.py # RuleRegistry: discover, load, run rules
|
||||
│ │ ├── base.py # BaseRule, Finding, Severity(CRITICAL/HIGH/MEDIUM/LOW/INFO)
|
||||
│ │ ├── debug.py # DEBUG, SECRET_KEY rules
|
||||
│ │ ├── headers.py # Security headers (HSTS, CSP, X-Frame, etc.)
|
||||
│ │ ├── auth.py # Password validators, token/session expiry
|
||||
│ │ ├── cors.py # CORS_ORIGIN_ALLOW_ALL, CORS_ALLOW_CREDENTIALS
|
||||
│ │ ├── ssl.py # SECURE_SSL_REDIRECT, SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE
|
||||
│ │ ├── uploads.py # FILE_UPLOAD_MAX_MEMORY_SIZE, DATA_UPLOAD_MAX_MEMORY_SIZE
|
||||
│ │ └── misc.py # ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS, etc.
|
||||
│ ├── output/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── formatter.py # BaseFormatter + TableFormatter, JSONFormatter, SARIFFormatter
|
||||
│ │ └── sarif.py # SARIF 2.1.0 schema builder
|
||||
│ └── utils/
|
||||
│ ├── __init__.py
|
||||
│ └── exit_codes.py # ExitCode enum
|
||||
├── tests/
|
||||
│ ├── test_parser.py
|
||||
│ ├── test_rules_debug.py
|
||||
│ ├── test_rules_headers.py
|
||||
│ ├── test_rules_auth.py
|
||||
│ ├── test_rules_cors.py
|
||||
│ ├── test_rules_ssl.py
|
||||
│ ├── test_rules_uploads.py
|
||||
│ ├── test_rules_misc.py
|
||||
│ ├── test_output_table.py
|
||||
│ ├── test_output_json.py
|
||||
│ ├── test_output_sarif.py
|
||||
│ ├── test_cli.py
|
||||
│ └── fixtures/
|
||||
│ ├── vulnerable_settings.py
|
||||
│ ├── hardened_settings.py
|
||||
│ ├── env_based_settings.py
|
||||
│ └── multi_file_settings/
|
||||
└── README.md
|
||||
```
|
||||
|
||||
**Filter Sidebar (GET form, `action="/tasks/"`):**
|
||||
| Param | Control | Query |
|
||||
|-------|---------|-------|
|
||||
| `status` (repeatable) | Checkboxes; value = `task_status_id` | `task_status_id__in=[...]` |
|
||||
| `assignee` | Select; value = user `id` (0 = Unassigned) | `task_assigned_to=<id>` / `task_assigned_to__isnull=True` |
|
||||
| `project` | Select; value = `project_id` | Tasks linked via `ObjectAssignment` |
|
||||
| `start_date` | `<input type="date">`, optional | `task_start_date__gte=value` |
|
||||
| `end_date` | `<input type="date">`, optional | `task_end_date__lte=value` |
|
||||
**Core Rules (50+ checks, grouped):**
|
||||
|
||||
- Status options from `ListOfTaskStatus` ordered by `task_status_sort_order`
|
||||
- Assignee options: "All", users with task access in accessible projects, "Unassigned" (0)
|
||||
- Project options: "All", projects user can reach through their groups
|
||||
- Clear Filters = link to `/tasks/` (drops all params); Apply = form submit
|
||||
- Hidden `sort` input in form carries current sort; hidden `page_size` dropdown in form
|
||||
| Category | Rules (examples) |
|
||||
|----------|------------------|
|
||||
| **Debug/Secrets** | DEBUG=True, SECRET_KEY hardcoded/weak/short, SECRET_KEY_FALLBACKS |
|
||||
| **Security Headers** | SECURE_HSTS_SECONDS>=31536000, SECURE_HSTS_INCLUDE_SUBDOMAINS, SECURE_HSTS_PRELOAD, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_REFERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, X_FRAME_OPTIONS=DENY, CONTENT_SECURITY_POLICY present |
|
||||
| **SSL/HTTPS** | SECURE_SSL_REDIRECT, SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, SECURE_PROXY_SSL_HEADER |
|
||||
| **Auth/Tokens** | AUTH_PASSWORD_VALIDATORS (4+ validators), REST_FRAMEWORK token expiry, SIMPLE_JWT access/refresh lifetime, PASSWORD_RESET_TIMEOUT |
|
||||
| **CORS** | CORS_ORIGIN_ALLOW_ALL=False, CORS_ALLOW_CREDENTIALS=False, CORS_ALLOWED_ORIGINS explicit |
|
||||
| **Hosts/Origins** | ALLOWED_HOSTS not ['*'], CSRF_TRUSTED_ORIGINS explicit, CSRF_COOKIE_SAMESITE=Lax/Strict |
|
||||
| **Uploads** | FILE_UPLOAD_MAX_MEMORY_SIZE reasonable, DATA_UPLOAD_MAX_MEMORY_SIZE reasonable, FILE_UPLOAD_PERMISSIONS |
|
||||
| **Sessions** | SESSION_COOKIE_AGE, SESSION_COOKIE_HTTPONLY, SESSION_COOKIE_SAMESITE, SESSION_EXPIRE_AT_BROWSER_CLOSE |
|
||||
| **CSP** | CONTENT_SECURITY_POLICY dict with default-src, script-src, style-src, img-src, connect-src, frame-ancestors |
|
||||
|
||||
**Table (9 columns):**
|
||||
| Column | Sort Field | Rendering |
|
||||
|--------|------------|-----------|
|
||||
| Title | `task_short_description` | Bold description + `#T-{task_id}` small |
|
||||
| Status | `task_status__task_status_sort_order` | Badge: `badge-{{ higher_order_status\|lower }}` |
|
||||
| Priority | `task_priority` | 8px dot + `{{ get_task_priority_display }}` |
|
||||
| Assignee | `task_assigned_to__username` | Username or `-` |
|
||||
| Project | `first_project_name` (annotated) | Via `ObjectAssignment` subquery |
|
||||
| Start Date | `task_start_date` | `Y-m-d` |
|
||||
| End Date | `task_end_date` | `Y-m-d` |
|
||||
| Created | `date_created` | `Y-m-d` (default sort: `-date_created`) |
|
||||
| Actions | — | "View" → `{% url 'task_information' task.task_id %}` |
|
||||
**CLI Interface:**
|
||||
```bash
|
||||
djangosecauditor scan [PATH] --format [table|json|sarif] --output [FILE] --severity [critical|high|medium|low|info] --ignore-rules [RULE_IDS] --config [FILE]
|
||||
djangosecauditor rules # List all rules with IDs, severity, description
|
||||
djangosecauditor version
|
||||
```
|
||||
|
||||
**Status Badges** (4 classes by `task_higher_order_status`):
|
||||
- `badge-backlog` (New, Backlog) — yellow
|
||||
- `badge-normal` (In Progress, Test/Review) — blue
|
||||
- `badge-blocked` (Blocked) — red
|
||||
- `badge-closed` (Closed) — green
|
||||
**Settings Parsing Strategy:**
|
||||
- Parse `settings.py` as AST (don't execute — avoids side effects, import loops, missing deps)
|
||||
- Handle: `from .base import *`, `from .production import *`, `os.environ.get('KEY', 'default')`, `env('KEY')` (django-environ), `config('KEY')` (python-decouple)
|
||||
- Recursively resolve imported modules up to 3 levels
|
||||
- Return merged dict: `{setting_name: value}` with unresolved env vars marked as `EnvVar('KEY', default)`
|
||||
|
||||
**Priority** (3 color groups):
|
||||
- `priority-high` (0=Highest, 1=High) — red
|
||||
- `priority-normal` (2=Normal) — orange
|
||||
- `priority-low` (3=Low, 4=Lowest) — blue
|
||||
**Output Formats:**
|
||||
- **Table** (default): Rich table with columns: Severity, Rule ID, Setting, Message, File:Line
|
||||
- **JSON**: Array of findings with `rule_id`, `severity`, `setting`, `message`, `file`, `line`, `value` (redacted for secrets)
|
||||
- **SARIF**: 2.1.0 schema, each finding = `result` with `ruleId`, `level` (error/warning/note), `message`, `locations` (physicalLocation with uri, region)
|
||||
|
||||
**Sorting:**
|
||||
- `?sort=field` = ASC (▲), `?sort=-field` = DESC (▼)
|
||||
- Click active column → toggle; click different column → ASC
|
||||
- Allowed fields: the 8 above only; invalid falls back to default
|
||||
- Header links keep all other params, reset `page=1`
|
||||
- Hidden `sort` input in filter form persists current sort
|
||||
**Testing:**
|
||||
- Fixture: `vulnerable_settings.py` (NearBeach-like, 17+ issues)
|
||||
- Fixture: `hardened_settings.py` (0 issues)
|
||||
- Fixture: `env_based_settings.py` (uses os.environ, django-environ)
|
||||
- Fixture: `multi_file_settings/` (base.py + production.py + local.py)
|
||||
- Each rule: unit test with positive/negative cases
|
||||
- CLI: integration tests for each format, exit codes, filtering
|
||||
|
||||
**Pagination:**
|
||||
- `page_size`: 10/25/50/100 (default 25); invalid → 25; dropdown in filter form, auto-submits
|
||||
- `page`: `Paginator.get_page()` (safe); elided range: `on_each_side=2, on_ends=1`
|
||||
- Prev/Next: disabled (`<span>`) on first/last page
|
||||
- All page links preserve filters, sort, page_size; change only `page`
|
||||
- Apply / sort click / page_size change / Clear Filters → reset to `page=1`
|
||||
- Results: `Showing {{ page_obj.start_index }}–{{ page_obj.end_index }} of {{ paginator.count }} tasks`
|
||||
**Config File (optional, stretch):**
|
||||
- `djangosecauditor.toml` or `pyproject.toml` `[tool.djangosecauditor]`
|
||||
- `ignore_rules = ["DJANGO-SEC-001"]`
|
||||
- `severity_threshold = "high"`
|
||||
- `custom_rules_path = "./my_rules/"`
|
||||
|
||||
**Actions Column:** Pinned right (`th:last-child, td:last-child { position: sticky; right: 0; }`); other columns scroll sideways inside container
|
||||
|
||||
**Empty State:** `{% empty %}` row with `colspan="9"`, centered "No tasks found"; count shows "0–0 of 0"
|
||||
|
||||
**Permissions (DB-level, not template):**
|
||||
- Queryset limited to tasks from projects user's groups can reach via `ObjectAssignment`
|
||||
- Superusers see all
|
||||
- `user_level` = max task permission across groups
|
||||
- "+ New Task" button: `user_level >= 3`
|
||||
- "View" button: `user_level >= 1`
|
||||
- Filter sidebar: always visible
|
||||
|
||||
**Styling:**
|
||||
- New partial: `src/sass/components/_task_list.scss` → imported in `main.scss`
|
||||
- Add `--nb-*` tokens for new colors in both `_light_theme.scss` and `_dark_theme.scss`
|
||||
- Reuse: `btn btn-primary`, `btn btn-secondary`, `form-control`, `badge`, card/spacing styles
|
||||
- Layout: desktop = sidebar (~280px) + table; <1024px = stacked
|
||||
- Table cells: 12px 16px padding
|
||||
- Badge text + background readable in both themes
|
||||
|
||||
**Tests:** 12 test methods in `NearBeach/tests/tests_views/tests_task/test_task_list.py`
|
||||
**Dependencies:**
|
||||
- `typer` + `rich` (CLI/table)
|
||||
- `pydantic` (settings models, SARIF)
|
||||
- `pytest` (testing)
|
||||
- No Django dependency (pure AST parsing)
|
||||
Reference in New Issue
Block a user