From b81648380b3addc925ea739260bf957997b7b601 Mon Sep 17 00:00:00 2001 From: Kvlil Date: Thu, 17 Oct 2024 10:40:49 +0200 Subject: [PATCH] feat: update driver execution to get access token and add it to authorization header --- trino/trino.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trino/trino.go b/trino/trino.go index 8ca10a0..848f96a 100644 --- a/trino/trino.go +++ b/trino/trino.go @@ -921,6 +921,14 @@ func (st *driverStmt) exec(ctx context.Context, args []driver.NamedValue) (*stmt continue } + if arg.Name == accessTokenConfig { + if st.conn.forwardAuthorizationHeader { + token := arg.Value.(string) + hs.Add(authorizationHeader, getAuthorization(token)) + } + continue + } + s, err := Serial(arg.Value) if err != nil { return nil, err