Add AUTH_DISABLED opt-out for sharedauth's new pending mode
Docker / Docker Build & Push (push) Successful in 5m39s
Lint / Lint (push) Successful in 51s
Tests / Go backend (push) Successful in 1m12s
Tests / Dashboard checks (push) Successful in 1m11s

sharedauth.NewWithStore now treats an empty AUTHGUARD_URL as "pending"
(still gated, failing closed) rather than permanently disabled, so a
ProjectConfigurator-registered CollabTable no longer needs
AUTHGUARD_URL set at all. Add AUTH_DISABLED (default false) to opt
into the old fully-open behavior explicitly via sharedauth.Disabled(),
and update both READMEs/.env.example to document the three resulting
states.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-14 14:12:34 +02:00
1 parent a018f3da4c
commit f723afa369
7 files changed
+84 -38

No files matched your search

+12 -4
View File
@@ -42,10 +42,18 @@ func TestCollabTableAuthStoreSetLoginRequiredIsNoOp(t *testing.T) {
func TestNewAuthServiceBuildsAService(t *testing.T) {
// newAuthService must not panic given a nil *DB and no AuthGuard URL
// (auth-disabled mode) -- the store adapter's IsSetupClaimed/
// TryClaimSetup/UnclaimSetup only get called once a real request comes in
// and AuthGuard is enabled, so construction alone must be safe.
if service := newAuthService(nil, "", false); service == nil {
// ("pending" mode) -- the store adapter's IsSetupClaimed/TryClaimSetup/
// UnclaimSetup only get called once a real request comes in and AuthGuard
// is enabled, so construction alone must be safe.
if service := newAuthService(nil, "", false, false); service == nil {
t.Fatal("newAuthService() returned nil")
}
}
func TestNewAuthServiceBuildsADisabledService(t *testing.T) {
// authDisabled=true must also not panic given a nil *DB and no AuthGuard
// URL -- this is the explicit auth-disabled mode (sharedauth.Disabled()).
if service := newAuthService(nil, "", false, true); service == nil {
t.Fatal("newAuthService() returned nil")
}
}