towerops/lib/towerops_web
Graham McIntire 56093bb493
refactor: use API token auth for profile imports instead of session cookies
Changes profile import endpoint to use standard API token authentication:

API Token Changes:
- Add user_id to api_tokens table (tracks who created the token)
- Update ApiTokens.verify_token/1 to return user along with org_id
- Update ApiAuth plug to assign current_user from token

Profile Import Changes:
- Move endpoint from /api/v1/admin/profiles/import to /api/v1/profiles/import
- Check user.is_superuser in controller instead of using RequireSuperuser plug
- Use api_v1 pipeline (Bearer token auth) instead of browser session
- Update documentation to show API token usage

Security:
- Only API tokens created by superusers can import profiles
- Returns 403 Forbidden if token user is not a superuser
- Logs import attempts with user email for audit trail

This provides a consistent API experience using Bearer tokens
instead of requiring browser session cookies.
2026-01-18 09:30:21 -06:00
..
channels Convert Task.* calls to Exq background workers 2026-01-17 16:46:36 -06:00
components rename equipment to device 2026-01-17 14:48:46 -06:00
controllers refactor: use API token auth for profile imports instead of session cookies 2026-01-18 09:30:21 -06:00
helpers Add build timestamp to footer with shared time formatting helpers 2026-01-17 11:10:50 -06:00
live feat: redirect to device page after triggering rediscovery 2026-01-17 18:20:24 -06:00
plugs refactor: use API token auth for profile imports instead of session cookies 2026-01-18 09:30:21 -06:00
endpoint.ex agent improvements and agent config 2026-01-16 17:26:51 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
router.ex refactor: use API token auth for profile imports instead of session cookies 2026-01-18 09:30:21 -06:00
telemetry.ex updates 2026-01-17 17:49:53 -06:00
user_auth.ex moduledocs 2026-01-17 15:08:49 -06:00