32 Commits

Author SHA1 Message Date
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
HawkveltGiteaAdmin f856aa5aea Merge pull request #37 from CoryHawkless/oidc-uplift
OIDC uplift
2026-05-19 14:48:58 +09:30
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 adfeb1bd0f fix: remove redundant unique constraints on id columns from all migrations
Remove UniqueConstraint('id') from all create_table calls in the initial
migration (40 occurrences) and the bulk constraint additions from the
superadmin migration (43 create + 43 drop). These were redundant with
PrimaryKeyConstraint('id') which already guarantees uniqueness.

Also removes duplicate unique enforcement on superadmins.email and
superadmin_sessions.token (kept the unique indexes, dropped the
table-level UniqueConstraints).

Fixes the root cause in BaseModel by removing unique=True from the id
column definition, which was causing Alembic autogenerate to produce
these redundant constraints.

Renames idx_cert_audit_org to ix_certificate_audit_logs_organization_id
to follow Alembic naming conventions.
2026-04-26 06:41:33 +00:00
coryHawkvelt 0fb98b4b38 Migration fix 2026-04-26 06:22:05 +00:00
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 1778dd85d5 Add superadmin routes to API 2026-04-21 17:11:03 +09:30
nexgen_mirrors 2f2a20adfb refactor(db): consolidate migrations into single initial migration
Replace 35 incremental migration files with one comprehensive initial
migration that captures the complete database schema. This simplifies
the migration history and eliminates complex dependency chains between
migrations.

The new migration (6a4c4ed4a5c6) includes all tables for:
- Users, organizations, and authentication
- SSH CA and certificate management
- ZeroTier network integration
- OIDC/OAuth providers
- Security policies and audit logging
2026-04-04 16:50:48 +10:30
JamesBhattarai 2b6f7e15af Feat(Fix): Multi-Tenant Zerotier Org Setups
Imports Network From Zerotier
Async Emails
Migration guardrails
Admin to see all approvals states
2026-03-31 12:33:56 +05:45
JamesBhattarai 05eb092228 Fix: DB Migration 2026-03-31 12:33:56 +05:45
JamesBhattarai 42ff4f2f4f Fix: Migration Heads 2026-03-22 16:06:14 +05:45
JamesBhattarai f334000da3 Feat: Implemented SUDO Department & API Key, CA Serial 2026-03-22 16:06:12 +05:45
nexgen_mirrors 1789590167 feat(zerotier): add ZeroTier network governance module
Add comprehensive ZeroTier integration for managing network access:

- Portal networks: manager-created ZeroTier network bindings
- Device registration: user-owned ZeroTier node endpoints
- Approval workflows: request/approve/revoke network access
- Activation sessions: time-limited network authorization
- Kill switch: emergency access revocation
- Reconciliation job: sync portal state with ZeroTier controller

Includes ZeroTier client SDK supporting both Central and self-hosted
controller APIs, with full CRUD operations for networks and members.
2026-03-20 21:50:20 +10:30
JamesBhattarai 7cb522b590 Feat(Chore, Fix): Refractor, Half Baked Deletion + Admin Privilege
Refractor Codes into sub file/folders
Admin can remove users'/members mfa/2fa, unlink account from  oauth provider
Admin can  add/reset password
Different Email (OIDC + Manual)-Same Account; (Block Linking and authorize if available)
2026-03-04 18:49:04 +05:45
JamesBhattarai 34f2dc070c Fix: CA host Sign via web 2026-03-03 18:02:45 +05:45
JamesBhattarai 5250d18eb0 Fix(Feat): CA, Audits, Rte Limit
CA Encryption, Serials, Rate Limiter, Account suspension blocks login
Transfer Ownership & Delete Account
2026-03-02 23:53:51 +05:45
JamesBhattarai a0d4e59c24 Feat(Chore): Verify Flow, Invites, Suspend, Depart Cert Policy
feat: add password reset and email verification flow
feat: add org invite listing, cancellation, and invite link fallback
feat: add user suspend/unsuspend with audit logging
feat: add department certificate policy (expiry, extensions)
feat: enforce dept cert policy on SSH certificate signing
feat: wire up OIDC consent and token flow (replace mocks)
feat: rework CLI auth bridge to use frontend login flow
feat: add admin OAuth provider management (CRUD)
chore: refactor model import paths after module reorganisation
chore: clean up config, decorators, and dev tooling
2026-03-01 20:42:48 +05:45
JamesBhattarai e79c584c50 Feat(Fix): Key Timezone, Expiry, Depart Link 2026-02-28 23:48:07 +05:45
JamesBhattarai b2212ab4d6 Feat: Added CA-merged with Securid-Principals, Depart, Client-CLI 2026-02-27 21:59:01 +05:45
JamesBhattarai 92fd57447d Chore(Feat): added principal,depart RBAC 2026-02-27 10:03:05 +05:45
JamesBhattarai 1ba5738d52 Feat: OIDC UI bridge, Microsoft SSO,, and schema session flaws
- OAuth Callback to Use Gatehouse UI to login instead of Backend Served dull ui
- Setup Autoregister of user + org, on oauth
- Microsoft Oauth Support
- OIDCRefreshToken.access_token_id  had a narrow Column increased to VAR(255) and remove FK to sessions.id which had no use
- client_id and client.id mismatch ,backup-code consumption
2026-02-26 23:18:31 +05:45
nexgen_mirrors f1fff22f3e tidy up 2026-02-23 13:25:17 +10:30
nexgen_mirrors cbdf6185b6 remove junk 2026-02-23 13:25:05 +10:30
coryHawkvelt 7637d7df45 migrations 2026-01-28 14:20:48 +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
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