27 Commits

Author SHA1 Message Date
coryHawkvelt a6d74d9316 fix: prevent ghost memberships from soft-deleted users 2026-06-10 05:30:24 +00:00
coryHawkvelt 05589ce442 cli: Add multi org support for issuing certs, add testing 2026-06-05 06:23:12 +00:00
coryHawkvelt 55f24ea9e5 feat: hide invite-only networks from non-admin users in listing 2026-05-30 06:40:49 +00:00
coryHawkvelt 2aad17f5e0 feat: add network-level kill switch endpoint 2026-05-30 06:32:26 +00:00
coryHawkvelt fed72f8bcd feat: add admin and user session listing endpoints with enriched device/network details 2026-05-29 05:30:51 +00:00
coryHawkvelt cade827b63 feat: return human-friendly names for network members 2026-05-28 10:19:20 +00:00
coryHawkvelt 2c8160d78e Updated ZeroTier network membership flow and logic 2026-05-28 05:42:04 +00:00
coryHawkvelt 2342a1aab6 Added OIDC client CORS attributes 2026-05-19 15:15:47 +00:00
Ubuntu 78bae3c2bb Improvments to logging\auditing 2026-05-19 10:38:26 +00:00
Ubuntu d100fdff3b feat: allow admins to bypass approval flow when joining networks 2026-05-07 20:04:08 +00:00
coryHawkvelt 803bf4f4f2 refactor: consolidate user and superadmin sessions into unified model 2026-04-28 20:54:15 +09:30
coryHawkvelt 63a3109a82 oidc-client mk1 2026-04-27 02:44:32 +09:30
coryHawkvelt d48e6b2f97 feat: add sliding session timeout with idle and absolute caps 2026-04-26 18:12:37 +09:30
coryHawkvelt 60799bbc52 fix(cors): handle wildcard origin with credentials and add unit tests
- Refactor CORS middleware to echo request origin when wildcard + credentials
  is configured (browsers reject Access-Control-Allow-Origin: * with
  Access-Control-Allow-Credentials: true)
- Add _is_origin_allowed() and _cors_origin_header() helpers
- Use CORS_SUPPORTS_CREDENTIALS config consistently
- Ensure consistent Access-Control-Allow-Headers in all CORS paths
- Fix redirect validation in get_token() to allow wildcard CORS origins
- Add 46 unit tests covering encryption round-trips, idempotency, key
  derivation, thread safety, CORS origin matching, and preflight responses
2026-04-26 01:12:39 +09:30
coryHawkvelt bb977aedf9 test: add API-level coverage for internal helpers, schemas, and service validation 2026-04-25 22:17:41 +09:30
coryHawkvelt 1de10323af Fixed SSH test cases 2026-04-25 11:01:00 +09:30
nexgen_mirrors de6f39e7e3 feat(ssh): change SSH key uniqueness to per-user scope
Previously, SSH key fingerprints were globally unique across all users,
preventing the same key from being registered by different users. This
change makes fingerprint uniqueness scoped to individual users.

- Remove global unique constraints on payload and fingerprint columns
- Add composite unique constraint on (user_id, fingerprint)
- Make add_ssh_key operation idempotent for same user
- Return tuple (SSHKey, is_new) from service to indicate creation status
- Update API to return 200 for existing keys, 201 for new keys

BREAKING CHANGE: API behavior changed - duplicate key addition now
returns 200 OK instead of 409 Conflict. Service method signature changed
from returning SSHKey to tuple[SSHKey, bool].
2026-04-25 06:22:08 +09:30
nexgen_mirrors cec04f3cb2 feat(ssh): add multi-organization support for certificate signing
Add support for users who belong to multiple organizations to select
which organization's CA should sign their SSH certificates.

Changes:
- CLI: Add --org-id and --list-orgs options for organization selection
- API: Return MULTIPLE_ORGS_AMBIGUOUS error when org selection needed
- API: Add /users/me/organizations/simple endpoint for CLI org listing
- DB: Add organization_id to certificate_audit_logs for better tracking
- Include organization_name in certificate response for clarity
2026-04-24 22:27:24 +09:30
nexgen_mirrors 015c622016 test: add comprehensive integration test suite for IAM platform
Add 162 integration tests covering authentication flows, TOTP MFA,
SSH key/certificate management, organization workflows, multi-org
access, self-service features, admin operations, authorization,
security edge cases, department/principal management, CA management,
policy compliance, WebAuthn passkeys, and ZeroTier network access.

Includes:
- Reusable API client library with session management
- Test fixtures for users, organizations, memberships, and CAs
- Helper functions for SSH key generation and verification
- Documentation for running and writing tests

Also update test configuration to disable conflicting maas plugins
and configure WebAuthn/session settings for localhost testing.
2026-04-23 15:41:37 +09:30
nexgen_mirrors 1778dd85d5 Add superadmin routes to API 2026-04-21 17:11:03 +09:30
nexgen_mirrors cbdf6185b6 remove junk 2026-02-23 13:25:05 +10:30
coryHawkvelt 4cf4a27c9a can link google accounts! 2026-01-20 15:54:00 +10:30
coryHawkvelt d063a0ca81 enable policies 2026-01-16 17:31:20 +10:30
coryHawkvelt 2c0aaf484b move app to gatehouse-app 2026-01-15 03:40:29 +10:30
coryHawkvelt cfd79190ee feat(auth): implement TOTP two-factor authentication with enrollment and verification
Adds TOTP (Time-based One-Time Password) two-factor authentication support including:
- New TOTP service with secret generation, QR code provisioning, and code verification
- New auth endpoints for enrollment, verification, status, and backup code management
- New TOTP authentication method type and user methods for TOTP management
- Backup codes generation and verification for account recovery
- Updated OIDC endpoints with timezone-aware datetime handling and RFC-compliant responses
- Added "roles" scope support for OIDC userinfo and ID tokens
- New pyotp dependency for TOTP operations
- Comprehensive unit tests for TOTP service
2026-01-14 18:06:17 +10:30
nexgen_mirrors 5e060f267d major checkpoint 2026-01-08 15:59:53 +10:30
nexgen_mirrors 211854ca0a inital 2026-01-08 01:00:26 +10:30