Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3085)

Unified Diff: appengine/logdog/coordinator/endpoints/services/registerStream.go

Issue 1972753002: LogDog: Implement prefix expiration. (Closed) Base URL: https://github.com/luci/luci-go@logdog-butler-register-coordinator-impl
Patch Set: Updated patchset dependency Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/logdog/coordinator/endpoints/services/registerStream.go
diff --git a/appengine/logdog/coordinator/endpoints/services/registerStream.go b/appengine/logdog/coordinator/endpoints/services/registerStream.go
index 4511b3bf796cdf8f1f4d99e4880ee9f5a57ac1e0..7451e92c1e768c46c31de7b13a586f23a2bd79d1 100644
--- a/appengine/logdog/coordinator/endpoints/services/registerStream.go
+++ b/appengine/logdog/coordinator/endpoints/services/registerStream.go
@@ -119,7 +119,16 @@ func (s *server) RegisterStream(c context.Context, req *logdog.RegisterStreamReq
return nil, grpcutil.Internal
}
- // The prefix secret must match the request secret. If it does, we know this
+ // If we're past prefix's expiration, reject this stream.
+ if now := clock.Now(c); !now.Before(pfx.Expiration) {
nodir 2016/05/19 00:54:00 I am not sure how you do the migration (CL descrip
dnj (Google) 2016/05/19 02:06:19 Hmm good question. I have an idea: Since we're def
nodir 2016/05/19 03:06:33 Yeah, how you gonna fetch new configs without depl
dnj (Google) 2016/05/19 03:20:06 Oh that part's easy. I'll upload the new version,
+ log.Fields{
+ "prefix": pfx.Prefix,
+ "expiration": pfx.Expiration,
+ }.Errorf(c, "The log stream Prefix has expired.")
+ return nil, grpcutil.Errf(codes.FailedPrecondition, "prefix has expired")
+ }
+
+ // The prefix secret much match the request secret. If it does, we know this
nodir 2016/05/19 00:54:00 must
// is a legitimate registration attempt.
if subtle.ConstantTimeCompare(pfx.Secret, req.Secret) != 1 {
log.Errorf(c, "Request secret does not match prefix secret.")

Powered by Google App Engine
This is Rietveld 408576698