lidavidm commented on code in PR #387: URL: https://github.com/apache/arrow-adbc/pull/387#discussion_r1087090589
########## go/adbc/driver/flightsql/flightsql_adbc.go: ########## @@ -204,19 +227,16 @@ func (d *database) SetOptions(cnOptions map[string]string) error { } type bearerAuthMiddleware struct { - token string + hdrs metadata.MD } func (b *bearerAuthMiddleware) StartCall(ctx context.Context) context.Context { - if b.token != "" { - return metadata.AppendToOutgoingContext(ctx, "authorization", b.token) - } - - return ctx + md, _ := metadata.FromOutgoingContext(ctx) + return metadata.NewOutgoingContext(ctx, metadata.Join(md, b.hdrs)) } func getFlightClient(ctx context.Context, loc string, d *database) (*flightsql.Client, error) { - authMiddle := &bearerAuthMiddleware{} + authMiddle := &bearerAuthMiddleware{hdrs: d.hdrs.Copy()} Review Comment: Yeah, I'm just thinking whether this should work: 1. Set up database 2. Set up connection 3. Add a header at the database level 4. Does the connection in step 2 reflect the new header? I think it's OK if it doesn't so long as it's documented (so, copy on construct always) - keeps the implementation clean and avoids a bunch of shared state -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org