mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 19:52:25 -05:00 
			
		
		
		
	[chore] Update usage of OTEL libraries (#2725)
* otel to 1.24 * prometheus exporter to 0.46 * bunotel to 1.1.17 Also: * Use schemaless URL for metrics * Add software version to tracing schema
This commit is contained in:
		
					parent
					
						
							
								8e88ee8d9c
							
						
					
				
			
			
				commit
				
					
						5e871e81a8
					
				
			
		
					 126 changed files with 12940 additions and 2267 deletions
				
			
		
							
								
								
									
										75
									
								
								vendor/google.golang.org/grpc/credentials/tls.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										75
									
								
								vendor/google.golang.org/grpc/credentials/tls.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -44,10 +44,25 @@ func (t TLSInfo) AuthType() string { | |||
| 	return "tls" | ||||
| } | ||||
| 
 | ||||
| // cipherSuiteLookup returns the string version of a TLS cipher suite ID. | ||||
| func cipherSuiteLookup(cipherSuiteID uint16) string { | ||||
| 	for _, s := range tls.CipherSuites() { | ||||
| 		if s.ID == cipherSuiteID { | ||||
| 			return s.Name | ||||
| 		} | ||||
| 	} | ||||
| 	for _, s := range tls.InsecureCipherSuites() { | ||||
| 		if s.ID == cipherSuiteID { | ||||
| 			return s.Name | ||||
| 		} | ||||
| 	} | ||||
| 	return fmt.Sprintf("unknown ID: %v", cipherSuiteID) | ||||
| } | ||||
| 
 | ||||
| // GetSecurityValue returns security info requested by channelz. | ||||
| func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { | ||||
| 	v := &TLSChannelzSecurityValue{ | ||||
| 		StandardName: cipherSuiteLookup[t.State.CipherSuite], | ||||
| 		StandardName: cipherSuiteLookup(t.State.CipherSuite), | ||||
| 	} | ||||
| 	// Currently there's no way to get LocalCertificate info from tls package. | ||||
| 	if len(t.State.PeerCertificates) > 0 { | ||||
|  | @ -138,10 +153,39 @@ func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { | |||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // The following cipher suites are forbidden for use with HTTP/2 by | ||||
| // https://datatracker.ietf.org/doc/html/rfc7540#appendix-A | ||||
| var tls12ForbiddenCipherSuites = map[uint16]struct{}{ | ||||
| 	tls.TLS_RSA_WITH_AES_128_CBC_SHA:         {}, | ||||
| 	tls.TLS_RSA_WITH_AES_256_CBC_SHA:         {}, | ||||
| 	tls.TLS_RSA_WITH_AES_128_GCM_SHA256:      {}, | ||||
| 	tls.TLS_RSA_WITH_AES_256_GCM_SHA384:      {}, | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: {}, | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: {}, | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:   {}, | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:   {}, | ||||
| } | ||||
| 
 | ||||
| // NewTLS uses c to construct a TransportCredentials based on TLS. | ||||
| func NewTLS(c *tls.Config) TransportCredentials { | ||||
| 	tc := &tlsCreds{credinternal.CloneTLSConfig(c)} | ||||
| 	tc.config.NextProtos = credinternal.AppendH2ToNextProtos(tc.config.NextProtos) | ||||
| 	// If the user did not configure a MinVersion and did not configure a | ||||
| 	// MaxVersion < 1.2, use MinVersion=1.2, which is required by | ||||
| 	// https://datatracker.ietf.org/doc/html/rfc7540#section-9.2 | ||||
| 	if tc.config.MinVersion == 0 && (tc.config.MaxVersion == 0 || tc.config.MaxVersion >= tls.VersionTLS12) { | ||||
| 		tc.config.MinVersion = tls.VersionTLS12 | ||||
| 	} | ||||
| 	// If the user did not configure CipherSuites, use all "secure" cipher | ||||
| 	// suites reported by the TLS package, but remove some explicitly forbidden | ||||
| 	// by https://datatracker.ietf.org/doc/html/rfc7540#appendix-A | ||||
| 	if tc.config.CipherSuites == nil { | ||||
| 		for _, cs := range tls.CipherSuites() { | ||||
| 			if _, ok := tls12ForbiddenCipherSuites[cs.ID]; !ok { | ||||
| 				tc.config.CipherSuites = append(tc.config.CipherSuites, cs.ID) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	return tc | ||||
| } | ||||
| 
 | ||||
|  | @ -205,32 +249,3 @@ type TLSChannelzSecurityValue struct { | |||
| 	LocalCertificate  []byte | ||||
| 	RemoteCertificate []byte | ||||
| } | ||||
| 
 | ||||
| var cipherSuiteLookup = map[uint16]string{ | ||||
| 	tls.TLS_RSA_WITH_RC4_128_SHA:                "TLS_RSA_WITH_RC4_128_SHA", | ||||
| 	tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA:           "TLS_RSA_WITH_3DES_EDE_CBC_SHA", | ||||
| 	tls.TLS_RSA_WITH_AES_128_CBC_SHA:            "TLS_RSA_WITH_AES_128_CBC_SHA", | ||||
| 	tls.TLS_RSA_WITH_AES_256_CBC_SHA:            "TLS_RSA_WITH_AES_256_CBC_SHA", | ||||
| 	tls.TLS_RSA_WITH_AES_128_GCM_SHA256:         "TLS_RSA_WITH_AES_128_GCM_SHA256", | ||||
| 	tls.TLS_RSA_WITH_AES_256_GCM_SHA384:         "TLS_RSA_WITH_AES_256_GCM_SHA384", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:    "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:    "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA:          "TLS_ECDHE_RSA_WITH_RC4_128_SHA", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:     "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:      "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:      "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:   "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:   "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", | ||||
| 	tls.TLS_FALLBACK_SCSV:                       "TLS_FALLBACK_SCSV", | ||||
| 	tls.TLS_RSA_WITH_AES_128_CBC_SHA256:         "TLS_RSA_WITH_AES_128_CBC_SHA256", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:   "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", | ||||
| 	tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305:    "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", | ||||
| 	tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305:  "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", | ||||
| 	tls.TLS_AES_128_GCM_SHA256:                  "TLS_AES_128_GCM_SHA256", | ||||
| 	tls.TLS_AES_256_GCM_SHA384:                  "TLS_AES_256_GCM_SHA384", | ||||
| 	tls.TLS_CHACHA20_POLY1305_SHA256:            "TLS_CHACHA20_POLY1305_SHA256", | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue