Sync shared snapshot from c9737d1
Docker / Docker Build & Push (push) Successful in 3m18s

This commit is contained in:
Gabriel20xx committed 2026-09-13 12:30:47 +02:00
1 parent 5b18c38fc0
commit 899223270a
1 file changed
+16
+16
View File
@@ -345,6 +345,22 @@ func (s *Service) enabled() bool {
return s.authGuard != nil
}
// SetAuthGuardBaseURL retargets the AuthGuard base URL this Service's
// internal authclient.Client calls, taking effect on its very next call -
// wire it as a coreconfig.Store's OnUpdate callback (see
// ProjectConfigurator/README.md's "Pushing core service info to other
// projects" section) so a live authguard_url change applies without a
// restart, the same as a project holding its own *authclient.Client
// directly. A no-op if this Service was constructed in auth-disabled mode
// (AUTHGUARD_URL unset at startup - see the "Auth-disabled mode" section):
// there is no client to retarget, and this package has no path to start
// authenticating requests it previously always let through.
func (s *Service) SetAuthGuardBaseURL(baseURL string) {
if s.authGuard != nil {
s.authGuard.SetBaseURL(baseURL)
}
}
func UserFromContext(ctx context.Context) *User {
value, _ := ctx.Value(userContextKey).(*User)
return value