Skip to content

Non multi tenant - #19

Closed
apauthnull wants to merge 2 commits into
mainfrom
non-multi-tenant
Closed

Non multi tenant#19
apauthnull wants to merge 2 commits into
mainfrom
non-multi-tenant

Conversation

@apauthnull

Copy link
Copy Markdown
Contributor

Description

Changes

Testing

  • Unit tests pass (go test ./...)
  • go vet ./... clean
  • Manual testing (describe below)

Checklist

  • Code follows the project's style guidelines
  • Self-reviewed the diff
  • No secrets or credentials committed
  • Updated documentation if needed
  • Added/updated tests for new behaviour

amanpd7 added 2 commits April 29, 2026 23:02
…roservice

## Description

authsec is now a strict single-tenant service. All multi-tenant logic
(per-tenant DB creation, tenant resolution, dynamic DB switching) has
been extracted to the new mt-plugin gRPC microservice. authsec auto-
detects mt-plugin via a 15s heartbeat; when unavailable, second admin
registration returns HTTP 409.

## Changes

- Delete tenant middleware stack (resolution, validation, context)
- Delete services/tenant_db_service.go and database/tenant_db_service.go (moved to mt-plugin)
- Delete internal/migration/template_builder.go (moved to mt-plugin)
- Replace all GetConnectionDynamically() calls with config.DB (master)
- Add internal/mtplugin/client.go — gRPC client with heartbeat and MTPluginClientIface
- Add internal/mtplugin/proto/ — generated protobuf stubs
- Move vault/ → internal/vault/ to match folder structure architecture
- Add config.MTPluginClientIface + MT_PLUGIN_GRPC_ADDR env var
- Strip CreateTenantDB and tenant migration handlers from migration_controller.go
- Add single-tenant 409 guard in AdminRegister
- Move Python scripts from tests/ to scripts/
- Delete stale artifacts (bash.exe.stackdump, test_results.html, vault_renewal_script.go)
- Fix ValidateDomain regex to reject labels with trailing hyphens

## Testing

- [x] Unit tests pass (`go test -short ./tests/unit/`)
- [x] `go vet ./...` clean
- [x] Add label `run-integration` to this PR to trigger integration tests in CI

## Checklist

- [x] Code follows the project's style guidelines
- [x] Self-reviewed the diff
- [x] No secrets or credentials committed
- [x] Updated documentation if needed (README, API_DOCS, CONTRIBUTING, CODE_OF_CONDUCT)
- [x] Added/updated tests for new behaviour (8 new test files in tests/unit/)
…roservice

## Description

authsec is now a strict single-tenant service. All multi-tenant logic
(per-tenant DB creation, tenant resolution, dynamic DB switching) has
been extracted to the new mt-plugin gRPC microservice. authsec auto-
detects mt-plugin via a 15s heartbeat; when unavailable, second admin
registration returns HTTP 409.

## Changes

- Delete tenant middleware stack (resolution, validation, context)
- Delete services/tenant_db_service.go and database/tenant_db_service.go (moved to mt-plugin)
- Delete internal/migration/template_builder.go (moved to mt-plugin)
- Replace all GetConnectionDynamically() calls with config.DB (master)
- Add internal/mtplugin/client.go — gRPC client with heartbeat and MTPluginClientIface
- Add internal/mtplugin/proto/ — generated protobuf stubs
- Move vault/ → internal/vault/ to match folder structure architecture
- Add config.MTPluginClientIface + MT_PLUGIN_GRPC_ADDR env var
- Strip CreateTenantDB and tenant migration handlers from migration_controller.go
- Add single-tenant 409 guard in AdminRegister
- Move Python scripts from tests/ to scripts/
- Delete stale artifacts (bash.exe.stackdump, test_results.html, vault_renewal_script.go)
- Fix ValidateDomain regex to reject labels with trailing hyphens

## Testing

- [x] Unit tests pass (`go test -short ./tests/unit/`)
- [x] `go vet ./...` clean
- [x] Add label `run-integration` to this PR to trigger integration tests in CI

## Checklist

- [x] Code follows the project's style guidelines
- [x] Self-reviewed the diff
- [x] No secrets or credentials committed
- [x] Updated documentation if needed (README, API_DOCS, CONTRIBUTING, CODE_OF_CONDUCT)
- [x] Added/updated tests for new behaviour (8 new test files in tests/unit/)
@apauthnull apauthnull closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants