Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
06cec40911 | ||
![]() |
ab4693d97f | ||
![]() |
a2b420c364 | ||
![]() |
dfd8fe97c5 | ||
![]() |
ada4af3b2a | ||
![]() |
2e27fef277 |
@@ -981,10 +981,23 @@ func (as *authStore) AuthInfoFromTLS(ctx context.Context) *AuthInfo {
|
||||
cn := chain.Subject.CommonName
|
||||
plog.Debugf("found common name %s", cn)
|
||||
|
||||
return &AuthInfo{
|
||||
ai := &AuthInfo{
|
||||
Username: cn,
|
||||
Revision: as.Revision(),
|
||||
}
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
// gRPC-gateway proxy request to etcd server includes Grpcgateway-Accept
|
||||
// header. The proxy uses etcd client server certificate. If the certificate
|
||||
// has a CommonName we should never use this for authentication.
|
||||
if gw := md["grpcgateway-accept"]; len(gw) > 0 {
|
||||
plog.Warningf("ignoring common name in gRPC-gateway proxy request %s", ai.Username)
|
||||
return nil
|
||||
}
|
||||
return ai
|
||||
}
|
||||
}
|
||||
|
||||
|
11
proxy/grpcproxy/cache/store.go
vendored
11
proxy/grpcproxy/cache/store.go
vendored
@@ -99,9 +99,12 @@ func (c *cache) Add(req *pb.RangeRequest, resp *pb.RangeResponse) {
|
||||
iv = c.cachedRanges.Find(ivl)
|
||||
|
||||
if iv == nil {
|
||||
c.cachedRanges.Insert(ivl, []string{key})
|
||||
val := map[string]struct{}{key: {}}
|
||||
c.cachedRanges.Insert(ivl, val)
|
||||
} else {
|
||||
iv.Val = append(iv.Val.([]string), key)
|
||||
val := iv.Val.(map[string]struct{})
|
||||
val[key] = struct{}{}
|
||||
iv.Val = val
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +144,8 @@ func (c *cache) Invalidate(key, endkey []byte) {
|
||||
|
||||
ivs = c.cachedRanges.Stab(ivl)
|
||||
for _, iv := range ivs {
|
||||
keys := iv.Val.([]string)
|
||||
for _, key := range keys {
|
||||
keys := iv.Val.(map[string]struct{})
|
||||
for key := range keys {
|
||||
c.lru.Remove(key)
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ import (
|
||||
var (
|
||||
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
|
||||
MinClusterVersion = "3.0.0"
|
||||
Version = "3.2.25"
|
||||
Version = "3.2.26"
|
||||
APIVersion = "unknown"
|
||||
|
||||
// Git SHA Value will be set during build
|
||||
|
Reference in New Issue
Block a user