From 706b0ef03692e523faa748dd4c474cf0651fd3d4 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 b79056d..2bedea8 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