Add AUTH_DISABLED opt-out for sharedauth's new pending mode
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:
1 parent
a018f3da4c
commit
f723afa369
7 files changed
+84
-38
No files matched your search
+16
-7
@@ -102,13 +102,22 @@ func (s collabTableAuthStore) UnclaimSetup(ctx context.Context) error {
|
||||
}
|
||||
|
||||
// newAuthService builds CollabTable's sharedauth.Service. authGuardURL is
|
||||
// AUTHGUARD_URL; empty means auth-disabled mode (see the package doc comment
|
||||
// above and sharedauth's own "Auth-disabled mode" section). "collabtable" is
|
||||
// CollabTable's projectKey, letting an AuthGuard administrator restrict which
|
||||
// accounts may log into CollabTable specifically -- handled entirely
|
||||
// server-side by AuthGuard once passed here.
|
||||
func newAuthService(database *DB, authGuardURL string, secureCookies bool) *sharedauth.Service {
|
||||
return sharedauth.NewWithStore(collabTableAuthStore{db: database}, legacySessionCookieName, secureCookies, authGuardURL, "collabtable")
|
||||
// AUTHGUARD_URL, an optional bootstrap/override value: empty now means
|
||||
// "pending" (see the package doc comment above and sharedauth's own
|
||||
// "Auth-disabled mode" section) rather than disabled. authDisabled is
|
||||
// AUTH_DISABLED, the explicit opt-out for local development or a standalone
|
||||
// deployment that wants no AuthGuard integration at all -- it passes
|
||||
// sharedauth.Disabled(), matching CollabTable's old unset-AUTHGUARD_URL
|
||||
// behavior. "collabtable" is CollabTable's projectKey, letting an AuthGuard
|
||||
// administrator restrict which accounts may log into CollabTable
|
||||
// specifically -- handled entirely server-side by AuthGuard once passed
|
||||
// here.
|
||||
func newAuthService(database *DB, authGuardURL string, secureCookies bool, authDisabled bool) *sharedauth.Service {
|
||||
var opts []sharedauth.ServiceOption
|
||||
if authDisabled {
|
||||
opts = append(opts, sharedauth.Disabled())
|
||||
}
|
||||
return sharedauth.NewWithStore(collabTableAuthStore{db: database}, legacySessionCookieName, secureCookies, authGuardURL, "collabtable", opts...)
|
||||
}
|
||||
|
||||
// --- Device-sync API bearer token (unrelated to AuthGuard) ------------------
|
||||
|
||||
Reference in new issue
Block a user