Commit Graph

67 Commits

Author SHA1 Message Date
nexgen_mirrors aaec6af6ad feat(audit): add audit logging for organization invites
Log ORG_INVITE_SENT action when a user sends an organization invite,
capturing the invited email and role in the audit metadata.
2026-04-20 16:57:37 +09:30
nexgen_mirrors 7550940934 feat(api): return 403 when attempting to remove last owner
Handle edge case where removing a member would leave an organization
without any owners. Service layer raises ValueError for this scenario,
which the API endpoint catches and converts to a forbidden response
with actionable error message about transferring ownership.
2026-04-20 16:37:04 +09:30
nexgen_mirrors b2c2acc84f feat(org): add organization limit per user
Add 10 organization limit per user to prevent abuse. Includes
graceful fallback if count service is unavailable.

- Add get_user_org_count method to OrganizationService
- Check org count before allowing new organization creation
- Improve invite email mismatch error message for logged-in users
2026-04-20 15:04:44 +09:30
nexgen_mirrors 69f39dfa04 feat(auth): add authenticated resend verification endpoint
Add new /auth/me/resend-verification endpoint that allows logged-in users
to request a new email verification link. Includes rate limiting configuration
to prevent abuse of the verification email functionality.
2026-04-20 13:12:38 +09:30
nexgen_mirrors 29d54ca109 feat(api): add contact form endpoint for website enquiries
Add POST /api/v1/contact endpoint to handle contact form submissions
from the marketing website. Includes:
- ContactSchema for validation with HTML sanitization
- Honeypot field for spam protection
- Rate limiting (5 per hour)
- Email notification to info@secuird.tech via NotificationService
2026-04-17 15:55:19 +09:30
nexgen_mirrors 7480e9d62b fix(user): filter out soft-deleted memberships and organizations
Add get_active_memberships() method to User model that filters out
soft-deleted memberships and memberships of deleted organizations.
Update all usages of organization_memberships to use this method,
ensuring consistent handling of soft-deleted records across the
codebase. Also add deleted_at filters to CA queries in SSH helpers.
2026-04-10 00:39:44 +09:30
nexgen_mirrors f16bb88ad2 feat(scripts): add generic job runner for scheduled tasks
Add a configurable job runner script that executes Flask CLI commands
at specified intervals within Docker containers. Supports graceful
shutdown via SIGTERM/SIGINT signals and includes built-in job commands
for ZeroTier reconciliation and MFA compliance checks.
2026-04-10 00:37:38 +09:30
nexgen_mirrors ab967e8ec0 checkpoint: spiral-unknown-1775746582535 2026-04-10 00:26:22 +09:30
nexgen_mirrors 2a8b1b0d5b Bugfix - Enable admin to see users webauthn methods 2026-04-09 22:57:03 +09:30
nexgen_mirrors 04e3293b30 Docker maintenance 2026-04-07 20:03:11 +09:30
nexgen_mirrors d212ebe688 refactor(oidc): move OIDC module to versioned API path
- Move OIDC endpoints from gatehouse_app/api/oidc.py to gatehouse_app/api/v1/oidc.py
- Register OIDC discovery endpoint directly on app instead of separate blueprint
- Update service name from authy2-backend to secuird-backend in health check
2026-04-07 00:36:19 +09:30
nexgen_mirrors b567b7a518 refactor(oidc): move OIDC endpoints to versioned API path
Separate OIDC discovery endpoint into its own blueprint registered at
root level (required by OIDC spec for .well-known path). Move all other
OIDC endpoints to /api/v1/oidc to conform to API versioning standard.

BREAKING CHANGE: OIDC endpoint URLs changed from /oidc/* to /api/v1/oidc/*
2026-04-07 00:24:18 +09:30
nexgen_mirrors 1a4b4b220b bug fix 2026-04-06 23:56:03 +09:30
nexgen_mirrors 51b89fb885 refactor(auth): remove redirect_uri from OAuth flow initiation
Remove redirect_uri parameter from initiate_login_flow,
initiate_register_flow, and initiate_link_flow functions.
2026-04-06 23:50:20 +09:30
coryHawkvelt 6325d60097 feat(email): use HTML templates for all transactional emails
- Update org invite, password reset, email verification, and account activation emails to use HTML templates
- Update MFA deadline reminder and suspension notifications to use HTML templates
- Add html_body parameter to _send_email_async for rich email content
2026-04-05 15:44:22 +00:00
coryHawkvelt f2386ed1da fix(docker): align database config between docker-compose and .env
- Move POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB to .env
- Update docker-compose.yml to reference env vars instead of hardcoding
- Fix db healthcheck to use correct credentials from .env
- Update .env.example with matching placeholder values
- Update DATABASE_URL to use variable interpolation
2026-04-05 13:58:48 +00:00
HawkveltGiteaAdmin f1a6e40319 Merge pull request #19 from CoryHawkless/email-uplift
Email uplift
2026-04-05 14:18:06 +09:30
nexgen_mirrors 41bbdb4bef feat(email): add provider abstraction and HTML templates
Add pluggable email provider system supporting SMTP, Mailgun, and SendGrid
with factory pattern for runtime provider selection. Includes branded HTML
email templates for verification, password reset, MFA notifications, and
organization invites.

Also rebrands all email content from Gatehouse to Secuird, adds email
provider configuration options, and fixes duplicate log handlers in
development mode.
2026-04-04 16:55:00 +10:30
nexgen_mirrors d90a06437e feat(docker): add Docker deployment configuration
Add production-ready Docker setup with multi-stage Dockerfile, docker-compose
orchestration for API, PostgreSQL, Redis, and Nginx services. Includes
health checks, non-root user execution, and proper networking.

- Add multi-stage Dockerfile with gunicorn/gevent workers
- Add docker-compose.yml with api, db, redis, nginx services
- Add nginx reverse proxy configuration with security headers
- Update .env.example with Docker and production variables
- Add email provider configuration (Mailgun, SendGrid)
- Add requests dependency for HTTP client support
- Update documentation with Docker deployment guide
- Rebrand project name from Gatehouse to Secuird
2026-04-04 16:51:19 +10: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
nexgen_mirrors 6e96bdde81 chore: update gitignore to exclude opencode and swarm files
Add patterns for .opencode/, .swarm/, and SWARM_PLAN.* to gitignore.
Remove tracked flask_session binary file.
2026-04-03 23:53:29 +10:30
HawkveltGiteaAdmin 2036938c1d Merge pull request #13 from jamesii-b/gatehouse/secuird-CA-merge-v2.01
Gatehouse/secuird ca merge v2.01
2026-04-03 10:18:10 +10:30
JamesBhattarai 78c2ee5c5a Feat:Added Update Client 2026-03-31 13:45:07 +05:45
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 a7915c9328 Fix: SSH key verification — accept raw armor + base64, clearer error messages 2026-03-22 16:06:14 +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
JamesBhattarai ff976ee1cc Fix: Serial uniqueness 2026-03-22 16:05:52 +05:45
JamesBhattarai 7492c40668 Fix: Admin Expiry Hours 2026-03-22 16:05:52 +05:45
JamesBhattarai 16d04bd5f7 Chore: Setup and Env 2026-03-22 16:04:29 +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
HawkveltGiteaAdmin 49e724222f Merge pull request #7 from jamesii-b/gatehouse/secuird-CA-merge-v2.01
Gatehouse/secuird ca merge v2.01
2026-03-05 16:55:58 +10:30
JamesBhattarai cc9dc5064e Fix: Migration
oidc_jwks_keys table doesn't exist
uix_org_provider_type constraint multiple use
transaction abort/never rolled back
2026-03-05 11:35:09 +05:45
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 ea1bacc794 Fix: Deletion Deadlocks (Owner, User) 2026-03-03 23:22:50 +05:45
JamesBhattarai 34f2dc070c Fix: CA host Sign via web 2026-03-03 18:02:45 +05:45
HawkveltGiteaAdmin 98350323a5 Merge pull request #2 from jamesii-b/gatehouse/secuird-CA-merge-v2.01
Gatehouse with secuird CA Merge (Gatehouse Isolated)
2026-03-03 13:52:52 +10:30
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 be87fd90b1 Feat(Fix): CA manage Host/User Key 2026-03-01 20:42:48 +05:45
JamesBhattarai 9875216861 Feat(Fix): User & Org Setup Initial (Invite + Create on own) & Fix: User Suspension 2026-03-01 20:42:48 +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 07193a2d2e Chore: Refractor Models into organized file/folder 2026-03-01 20:42:48 +05:45
James Bhattarai 58432da1c8 Merge branch 'CoryHawkless:main' into gatehouse/secuird-CA-merge-v2.01 2026-02-28 23:48:54 +05:45
JamesBhattarai e79c584c50 Feat(Fix): Key Timezone, Expiry, Depart Link 2026-02-28 23:48:07 +05:45
JamesBhattarai 8fdc362216 Chore(Fix): Package dependency 2026-02-28 19:19:42 +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
HawkveltGiteaAdmin d5a32cd59f Merge pull request #1 from jamesii-b/oidc/v1.01
Feat: OIDC UI bridge, Microsoft SSO,, and schema session flaws
2026-02-27 14:35:58 +10:30
JamesBhattarai c623824738 Chore(Feat): added gatehouse-cli 2026-02-27 07:48:55 +05:45