towerops/lib/towerops
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
..
accounts moduledocs 2026-01-17 15:08:49 -06:00
admin Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
agents Add agent rename functionality 2026-01-17 15:48:47 -06:00
alerts moduledocs 2026-01-17 15:08:49 -06:00
api_tokens refactor: use API token auth for profile imports instead of session cookies 2026-01-18 09:30:21 -06:00
device_profiles feat: add profile export/import workflow via API 2026-01-18 09:23:38 -06:00
devices feat: allow device name to be populated from SNMP sysName 2026-01-17 16:28:43 -06:00
mobile_sessions Fix datetime truncation for mobile session schemas 2026-01-15 16:17:05 -06:00
monitoring Always use ICMP ping for latency monitoring, not SNMP checks 2026-01-17 17:02:51 -06:00
organizations moduledocs 2026-01-17 15:08:49 -06:00
proto rename equipment to device 2026-01-17 14:48:46 -06:00
sites moduledocs 2026-01-17 15:08:49 -06:00
snmp fix: comprehensive ePMP/dynamic profile discovery improvements 2026-01-18 09:05:03 -06:00
workers feat: add profile export/import workflow via API 2026-01-18 09:23:38 -06:00
accounts.ex Streamline login flow and fix test failures 2026-01-13 13:08:24 -06:00
admin.ex rename equipment to device 2026-01-17 14:48:46 -06:00
agents.ex Add agent rename functionality 2026-01-17 15:48:47 -06:00
alerts.ex rename equipment to device 2026-01-17 14:48:46 -06:00
api_tokens.ex refactor: use API token auth for profile imports instead of session cookies 2026-01-18 09:30:21 -06:00
application.ex feat: add database-driven SNMP device profiles 2026-01-17 18:13:53 -06:00
device_profiles.ex refactor: remove all references to external project names 2026-01-17 18:31:41 -06:00
devices.ex credo cleanup 2026-01-17 15:00:52 -06:00
log_filter.ex Add comprehensive Dialyzer type specifications 2026-01-17 10:52:02 -06:00
mailer.ex moduledocs 2026-01-17 15:08:49 -06:00
mobile_sessions.ex credo cleanup 2026-01-17 15:00:52 -06:00
monitoring.ex feat: add latency graph for ICMP ping monitoring 2026-01-17 16:02:35 -06:00
organizations.ex rename equipment to device 2026-01-17 14:48:46 -06:00
release.ex fix dialyzer things 2026-01-03 12:56:40 -06:00
repo.ex moduledocs 2026-01-17 15:08:49 -06:00
sites.ex rename equipment to device 2026-01-17 14:48:46 -06:00
snmp.ex more renames 2026-01-17 15:13:56 -06:00