Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: allow reflection endpoints (#6504)

Danny Xud6c40ee74cdc
diff --git a/backend/api/auth/config.go b/backend/api/auth/config.go
index f7bf330cbc..2f9db68654 100644
--- a/backend/api/auth/config.go
+++ b/backend/api/auth/config.go
@@ -1,5 +1,7 @@
package auth
+import "strings"
+
var authenticationAllowlistMethods = map[string]bool{
"/bytebase.v1.ActuatorService/GetActuatorInfo": true,
"/bytebase.v1.SubscriptionService/GetSubscription": true,
@@ -13,5 +15,10 @@ var authenticationAllowlistMethods = map[string]bool{
// IsAuthenticationAllowed returns whether the method is exempted from authentication.
func IsAuthenticationAllowed(fullMethodName string) bool {
// TODO(d): skips OpenAPI SQL endpoint.
+ // "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo" is used
+ // for reflection, but we'd rather to allow the whole reflection endpoint.
+ if strings.HasPrefix(fullMethodName, "/grpc.reflection") {
+ return true
+ }
return authenticationAllowlistMethods[fullMethodName]
}