hasBootstrapToken reports whether a bootstrap token is currently configured. Lock-aware — safe to call without holding s.bootstrapMu. Used by handleSessionCheck to decide whether to advertise setup_method=logs_token.
()
| 155 | // Used by handleSessionCheck to decide whether to advertise |
| 156 | // setup_method=logs_token. |
| 157 | func (s *Server) hasBootstrapToken() bool { |
| 158 | s.bootstrapMu.Lock() |
| 159 | defer s.bootstrapMu.Unlock() |
| 160 | return !s.bootstrapToken.IsZero() |
| 161 | } |
| 162 | |
| 163 | // checkBootstrapToken validates the X-Bootstrap-Token header on r against |
| 164 | // the in-memory token using a constant-time comparison. Returns false if |