Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cmd/benchmark/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"time"

"github.com/specterops/dawgs"
"github.com/specterops/dawgs/drivers"
"github.com/specterops/dawgs/drivers/pg"
"github.com/specterops/dawgs/graph"
"github.com/specterops/dawgs/opengraph"
Expand All @@ -39,10 +40,11 @@ func main() {
driver = flag.String("driver", "pg", "database driver (pg, neo4j)")
connStr = flag.String("connection", "", "database connection string (or PG_CONNECTION_STRING)")
iterations = flag.Int("iterations", 10, "timed iterations per scenario")
output = flag.String("output", "", "markdown output file (default: stdout)")
datasetDir = flag.String("dataset-dir", "integration/testdata", "path to testdata directory")
output = flag.String("output", "", "markdown output file (default: stdout)")
datasetDir = flag.String("dataset-dir", "integration/testdata", "path to testdata directory")
localDataset = flag.String("local-dataset", "", "additional local dataset (e.g. local/phantom)")
onlyDataset = flag.String("dataset", "", "run only this dataset (e.g. diamond, local/phantom)")
dbcfg = drivers.DatabaseConfiguration{}
)

flag.Parse()
Expand All @@ -62,8 +64,10 @@ func main() {
ConnectionString: conn,
}

dbcfg.Connection = conn

if *driver == pg.DriverName {
pool, err := pg.NewPool(conn)
pool, err := pg.NewPool(dbcfg)
if err != nil {
fatal("failed to create pool: %v", err)
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/export/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

"github.com/specterops/dawgs/drivers"
"github.com/specterops/dawgs/drivers/pg"
"github.com/specterops/dawgs/opengraph"
"github.com/specterops/dawgs/util/size"
Expand All @@ -16,7 +17,10 @@ func main() {
connStr = "postgresql://bloodhound:bloodhoundcommunityedition@localhost:5432/bloodhound"
}

pool, err := pg.NewPool(connStr)
dbcfg := drivers.DatabaseConfiguration{}
dbcfg.Connection = connStr

pool, err := pg.NewPool(dbcfg)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to connect: %v\n", err)
os.Exit(1)
Expand Down
76 changes: 76 additions & 0 deletions drivers/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package drivers

import (
"context"
"fmt"
"log/slog"
"net"
"net/url"
"strings"

awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/rds/auth"
)

type DatabaseConfiguration struct {
Connection string `json:"connection"`
Address string `json:"addr"`
Database string `json:"database"`
Username string `json:"username"`
Secret string `json:"secret"`
MaxConcurrentSessions int `json:"max_concurrent_sessions"`
EnableRDSIAMAuth bool `json:"enable_rds_iam_auth"`
}

func (s DatabaseConfiguration) defaultPostgreSQLConnectionString() string {
if s.Connection != "" {
return s.Connection
}

return fmt.Sprintf("postgresql://%s:%s@%s/%s", s.Username, url.QueryEscape(s.Secret), s.Address, s.Database)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In Go's net/url package, is url.QueryEscape appropriate for encoding URL userinfo credentials, or should url.UserPassword/url.URL be used? Please include how spaces and reserved characters are encoded in each case.

💡 Result:

url.UserPassword/url.URL should be used for encoding URL userinfo credentials, not url.QueryEscape. url.UserPassword(username, password) creates a *Userinfo that, when used in a url.URL and stringified via u.String, properly encodes the username and password using the package's internal userinfo encoding rules (encodeUserPassword mode). This escapes only the characters that must be escaped in userinfo per RFC 3986 §3.2.1: '@', '/', '?', and ':' (to handle parsing). Other reserved characters like '&', '=', '+', ';', ',', '$' are left unescaped, and spaces are encoded as '+'. In contrast, url.QueryEscape is for query parameters (encodeQueryComponent mode). It escapes all reserved characters (including '&' as %26, '=' as %3D, etc.) and encodes spaces as '+'. Using QueryEscape for userinfo can produce incorrectly encoded URLs because it over-escapes characters safe in userinfo, potentially causing parsing issues or non-standard URLs. Official docs recommend UserPassword for constructing userinfo, noting it's for legacy sites but handles encoding correctly. Since Go 1.9.4, url.Parse requires userinfo to be percent-encoded if it contains invalid characters. Examples: For username="user name", password="pass&word?": - url.UserPassword: "user+name:pass%26word%3F" (spaces -> '+', '&'->%26, '?'->%3F; '+' and '=' unescaped if present) - url.QueryEscape on both then join: "user+name:pass%26word%3F" (same for these chars, but would escape '=' to %3D, which userinfo allows unescaped) Code snippet: package main import ( "fmt" "net/url" ) func main { u := &url.URL{ Scheme: "https", Host: "example.com", User: url.UserPassword("user name", "pass&word?"), } fmt.Println(u.String) // https://user+name:pass%26word%3F@example.com }

Citations:


🏁 Script executed:

fd -t f drivers/config.go

Repository: SpecterOps/DAWGS

Length of output: 42


🏁 Script executed:

fd -t f "config.go" || echo "Not found with default search"

Repository: SpecterOps/DAWGS

Length of output: 77


🏁 Script executed:

fd -t d "drivers" || echo "No drivers directory found"

Repository: SpecterOps/DAWGS

Length of output: 68


🏁 Script executed:

cat -n drivers/config.go | head -50

Repository: SpecterOps/DAWGS

Length of output: 1846


Use url.UserPassword() to properly encode URL credentials instead of url.QueryEscape().

Line 30 uses url.QueryEscape() for encoding credentials in the userinfo portion of the PostgreSQL URL, which is incorrect. url.QueryEscape is designed for query parameters and over-escapes characters that are safe in userinfo (like =, ;). Use url.UserPassword(username, password) with url.URL instead, which applies the correct userinfo encoding per RFC 3986.

🔧 Suggested fix
 func (s DatabaseConfiguration) defaultPostgreSQLConnectionString() string {
 	if s.Connection != "" {
 		return s.Connection
 	}
 
-	return fmt.Sprintf("postgresql://%s:%s@%s/%s", s.Username, url.QueryEscape(s.Secret), s.Address, s.Database)
+	u := &url.URL{
+		Scheme: "postgresql",
+		Host:   s.Address,
+		Path:   "/" + s.Database,
+	}
+	u.User = url.UserPassword(s.Username, s.Secret)
+	return u.String()
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@drivers/config.go` at line 30, Replace the manual fmt.Sprintf URL
construction that uses url.QueryEscape on credentials with proper URL building
using url.UserPassword and url.URL: create a url.Userinfo via
url.UserPassword(s.Username, s.Secret), set the Scheme to "postgresql", Host to
s.Address, and Path (or Opaque/RawPath as appropriate) to the database name
(s.Database), then call url.String() to produce the final DSN; update the return
in the function that currently uses fmt.Sprintf("postgresql://%s:%s@%s/%s",
s.Username, url.QueryEscape(s.Secret), s.Address, s.Database) to this
url.URL-based construction so userinfo is encoded per RFC 3986.

}

func (s DatabaseConfiguration) RDSIAMAuthConnectionString() string {
slog.Info("Loading RDS Configuration With IAM Auth")

if cfg, err := awsConfig.LoadDefaultConfig(context.TODO()); err != nil {
slog.Error("AWS Config Loading Error", slog.String("err", err.Error()))
} else {
host := s.Address

if hostCName, err := net.LookupCNAME(s.Address); err != nil {
slog.Warn("Error looking up CNAME for DB host. Using original address.", slog.String("err", err.Error()))
} else {
host = hostCName
}

endpoint := strings.TrimSuffix(host, ".") + ":5432"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hardcoded port 5432 may not match the configured address.

If s.Address contains a port (e.g., mydb.example.com:5433) or uses a non-standard port, this hardcoded :5432 will produce an incorrect endpoint. Consider parsing the port from Address or adding a Port field to DatabaseConfiguration.

🔧 Suggested approach
+func (s DatabaseConfiguration) getHostPort() (string, string) {
+	host := s.Address
+	port := "5432"
+	if h, p, err := net.SplitHostPort(s.Address); err == nil {
+		host = h
+		port = p
+	}
+	return host, port
+}

Then use it in RDSIAMAuthConnectionString:

-	endpoint := strings.TrimSuffix(host, ".") + ":5432"
+	_, port := s.getHostPort()
+	endpoint := strings.TrimSuffix(host, ".") + ":" + port
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@drivers/config.go` at line 47, The endpoint construction currently hardcodes
":5432" which breaks when s.Address already contains a port or a non-standard
port is required; update the logic in RDSIAMAuthConnectionString (where
endpoint, host and strings.TrimSuffix are used) to parse s.Address for an
existing port (e.g., via net.SplitHostPort) and use that port if present,
falling back to a Port field on DatabaseConfiguration (add Port if not present)
or to 5432 only as a final default, and ensure endpoint is built using the
chosen host and port rather than concatenating a fixed ":5432".


slog.Info("Requesting RDS IAM Auth Token")

if authenticationToken, err := auth.BuildAuthToken(context.TODO(), endpoint, cfg.Region, s.Username, cfg.Credentials); err != nil {
Comment on lines +36 to +51
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid repeated AWS config/DNS work on every connection attempt.

Lines 36-51 perform LoadDefaultConfig and CNAME lookup in a path that is invoked per new PG connection (via BeforeConnect). This can become a connection-latency bottleneck and create avoidable external-call load.

💡 Refactor direction
- if cfg, err := awsConfig.LoadDefaultConfig(context.TODO()); err != nil {
+ // load once (e.g., during pool initialization) and reuse:
+ // - aws.Config
+ // - normalized host/endpoint
+ // per-connection: only mint the IAM token
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@drivers/config.go` around lines 36 - 51, The code currently calls
awsConfig.LoadDefaultConfig and net.LookupCNAME inside the per-connection
BeforeConnect path; move those calls to one-time initialization and cache their
results (e.g., store awsCfg and resolvedHost/endpoint on the driver/connector
struct or package-level vars). Use a constructor or init function (or sync.Once)
to call awsConfig.LoadDefaultConfig and net.LookupCNAME once, compute endpoint
:= strings.TrimSuffix(resolvedHost, ".")+":5432", and then in BeforeConnect
reuse the cached awsCfg, region/credentials and endpoint when calling
auth.BuildAuthToken (instead of reloading config and re-resolving CNAME on each
connection). Ensure the cache is concurrency-safe and falls back to original
behavior if initialization fails.

slog.Error("RDS IAM Auth Token Request Error", slog.String("err", err.Error()))
} else {
slog.Info("RDS IAM Auth Token Created")
return fmt.Sprintf("postgresql://%s:%s@%s/%s", s.Username, url.QueryEscape(authenticationToken), endpoint, s.Database)
}
}

return s.defaultPostgreSQLConnectionString()
}
Comment on lines +33 to +60
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Silent error fallback may mask configuration issues.

When AWS config loading or IAM token generation fails, the function logs an error but silently falls back to defaultPostgreSQLConnectionString(). For IAM-auth-only deployments (where no static password exists), this fallback will produce an invalid connection string, causing authentication failures that are harder to diagnose.

Consider returning an error or making the fallback behavior explicit/configurable.

🔧 Suggested approach to surface errors
-func (s DatabaseConfiguration) RDSIAMAuthConnectionString() string {
+func (s DatabaseConfiguration) RDSIAMAuthConnectionString() (string, error) {
 	slog.Info("Loading RDS Configuration With IAM Auth")
 
 	if cfg, err := awsConfig.LoadDefaultConfig(context.TODO()); err != nil {
-		slog.Error("AWS Config Loading Error", slog.String("err", err.Error()))
+		return "", fmt.Errorf("failed to load AWS config: %w", err)
-	} else {
+	}
 		// ... rest of implementation
-	}
-
-	return s.defaultPostgreSQLConnectionString()
+	return connString, nil
 }

Then update PostgreSQLConnectionString() to propagate errors or handle the fallback decision explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@drivers/config.go` around lines 33 - 60, RDSIAMAuthConnectionString currently
logs AWS config or token errors (from awsConfig.LoadDefaultConfig and
auth.BuildAuthToken) then silently falls back to
defaultPostgreSQLConnectionString(), which hides failures for IAM-only
deployments; change the API to surface errors instead: modify
DatabaseConfiguration.RDSIAMAuthConnectionString to return (string, error) (or
add an explicit boolean/config flag) so failures during
awsConfig.LoadDefaultConfig or auth.BuildAuthToken are returned to the caller
rather than falling back, and update PostgreSQLConnectionString (or its callers)
to propagate/handle that error or decide explicitly when to fallback to
defaultPostgreSQLConnectionString.


func (s DatabaseConfiguration) PostgreSQLConnectionString() string {
if s.EnableRDSIAMAuth {
return s.RDSIAMAuthConnectionString()
}

return s.defaultPostgreSQLConnectionString()
}

func (s DatabaseConfiguration) Neo4jConnectionString() string {
if s.Connection == "" {
return fmt.Sprintf("neo4j://%s:%s@%s/%s", s.Username, s.Secret, s.Address, s.Database)
}

return s.Connection
}
Comment on lines +70 to +76
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Neo4jConnectionString does not URL-escape the secret.

Unlike defaultPostgreSQLConnectionString() (line 30), this method does not URL-escape s.Secret. If the secret contains special characters (e.g., @, /, #), the resulting URI will be malformed.

🔧 Proposed fix
 func (s DatabaseConfiguration) Neo4jConnectionString() string {
 	if s.Connection == "" {
-		return fmt.Sprintf("neo4j://%s:%s@%s/%s", s.Username, s.Secret, s.Address, s.Database)
+		return fmt.Sprintf("neo4j://%s:%s@%s/%s", s.Username, url.QueryEscape(s.Secret), s.Address, s.Database)
 	}
 
 	return s.Connection
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@drivers/config.go` around lines 70 - 76, Neo4jConnectionString currently
interpolates s.Secret directly which breaks URIs when the secret contains
special chars; update Neo4jConnectionString to URL-escape credentials (at
minimum s.Secret, and preferably s.Username too) before building the connection
string—mirror the approach used in defaultPostgreSQLConnectionString by using
Go's URL-encoding utilities (e.g., url.UserPassword or an appropriate escape
function) to produce a valid neo4j:// userinfo component when s.Connection is
empty.

23 changes: 18 additions & 5 deletions drivers/pg/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/specterops/dawgs"
"github.com/specterops/dawgs/cypher/models/pgsql"
"github.com/specterops/dawgs/drivers"
"github.com/specterops/dawgs/graph"
)

Expand Down Expand Up @@ -50,15 +51,12 @@ func afterPooledConnectionRelease(conn *pgx.Conn) bool {
return true
}

func NewPool(connectionString string) (*pgxpool.Pool, error) {
if connectionString == "" {
return nil, fmt.Errorf("graph connection requires a connection url to be set")
}
func NewPool(cfg drivers.DatabaseConfiguration) (*pgxpool.Pool, error) {

poolCtx, done := context.WithTimeout(context.Background(), poolInitConnectionTimeout)
defer done()

poolCfg, err := pgxpool.ParseConfig(connectionString)
poolCfg, err := pgxpool.ParseConfig(cfg.PostgreSQLConnectionString())
if err != nil {
return nil, err
}
Expand All @@ -73,6 +71,21 @@ func NewPool(connectionString string) (*pgxpool.Pool, error) {
poolCfg.AfterConnect = afterPooledConnectionEstablished
poolCfg.AfterRelease = afterPooledConnectionRelease

if cfg.EnableRDSIAMAuth {
// Only enable the BeforeConnect handler if RDS IAM Auth is enabled
poolCfg.BeforeConnect = func(ctx context.Context, connCfg *pgx.ConnConfig) error {
slog.Debug("New Connection RDS IAM Auth")

if newPoolCfg, err := pgxpool.ParseConfig(cfg.PostgreSQLConnectionString()); err != nil {
return err
} else {
connCfg.Password = newPoolCfg.ConnConfig.Password
}

return nil
}
}

pool, err := pgxpool.NewWithConfig(poolCtx, poolCfg)
if err != nil {
return nil, err
Expand Down
15 changes: 15 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ require (
)

require (
github.com/aws/aws-sdk-go-v2 v1.41.5 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.13 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect
github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.14 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 // indirect
github.com/aws/smithy-go v1.24.2 // indirect
github.com/cockroachdb/apd/v3 v3.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-metro v0.0.0-20250106013310-edb8663e5e33 // indirect
Expand Down
30 changes: 30 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ github.com/RoaringBitmap/roaring/v2 v2.16.0 h1:Kys1UNf49d5W8Tq3bpuAhIr/Z8/yPB+59
github.com/RoaringBitmap/roaring/v2 v2.16.0/go.mod h1:eq4wdNXxtJIS/oikeCzdX1rBzek7ANzbth041hrU8Q4=
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY=
github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o=
github.com/aws/aws-sdk-go-v2/config v1.32.13 h1:5KgbxMaS2coSWRrx9TX/QtWbqzgQkOdEa3sZPhBhCSg=
github.com/aws/aws-sdk-go-v2/config v1.32.13/go.mod h1:8zz7wedqtCbw5e9Mi2doEwDyEgHcEE9YOJp6a8jdSMY=
github.com/aws/aws-sdk-go-v2/credentials v1.19.13 h1:mA59E3fokBvyEGHKFdnpNNrvaR351cqiHgRg+JzOSRI=
github.com/aws/aws-sdk-go-v2/credentials v1.19.13/go.mod h1:yoTXOQKea18nrM69wGF9jBdG4WocSZA1h38A+t/MAsk=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 h1:NUS3K4BTDArQqNu2ih7yeDLaS3bmHD0YndtA6UP884g=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21/go.mod h1:YWNWJQNjKigKY1RHVJCuupeWDrrHjRqHm0N9rdrWzYI=
github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.21 h1:HFn8sVT87KWnGs2Q2gO/brPZc2bR0RXD++cYKRmABzk=
github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.21/go.mod h1:BGZ/K6gLGJt8K36j6gcsD7WVxmWt0MGBYtr57iLweio=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 h1:qYQ4pzQ2Oz6WpQ8T3HvGHnZydA72MnLuFK9tJwmrbHw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6/go.mod h1:O3h0IK87yXci+kg6flUKzJnWeziQUKciKrLjcatSNcY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 h1:5EniKhLZe4xzL7a+fU3C2tfUN4nWIqlLesfrjkuPFTY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7/go.mod h1:x0nZssQ3qZSnIcePWLvcoFisRXJzcTVvYpAAdYX8+GI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 h1:c31//R3xgIJMSC8S6hEVq+38DcvUlgFY0FM6mSI5oto=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21/go.mod h1:r6+pf23ouCB718FUxaqzZdbpYFyDtehyZcmP5KL9FkA=
github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 h1:QKZH0S178gCmFEgst8hN0mCX1KxLgHBKKY/CLqwP8lg=
github.com/aws/aws-sdk-go-v2/service/signin v1.0.9/go.mod h1:7yuQJoT+OoH8aqIxw9vwF+8KpvLZ8AWmvmUWHsGQZvI=
github.com/aws/aws-sdk-go-v2/service/sso v1.30.14 h1:GcLE9ba5ehAQma6wlopUesYg/hbcOhFNWTjELkiWkh4=
github.com/aws/aws-sdk-go-v2/service/sso v1.30.14/go.mod h1:WSvS1NLr7JaPunCXqpJnWk1Bjo7IxzZXrZi1QQCkuqM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 h1:mP49nTpfKtpXLt5SLn8Uv8z6W+03jYVoOSAl/c02nog=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw=
github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng=
github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/axiomhq/hyperloglog v0.2.6 h1:sRhvvF3RIXWQgAXaTphLp4yJiX4S0IN3MWTaAgZoRJw=
github.com/axiomhq/hyperloglog v0.2.6/go.mod h1:YjX/dQqCR/7QYX0g8mu8UZAjpIenz1FKM71UEsjFoTo=
github.com/bits-and-blooms/bitset v1.24.4 h1:95H15Og1clikBrKr/DuzMXkQzECs1M6hhoGXLwLQOZE=
Expand Down
6 changes: 5 additions & 1 deletion integration/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"testing"

"github.com/specterops/dawgs"
"github.com/specterops/dawgs/drivers"
"github.com/specterops/dawgs/drivers/pg"
"github.com/specterops/dawgs/graph"
"github.com/specterops/dawgs/opengraph"
Expand Down Expand Up @@ -79,8 +80,11 @@ func SetupDB(t *testing.T, datasets ...string) (graph.Database, context.Context)
ConnectionString: connStr,
}

dbcfg := drivers.DatabaseConfiguration{}
dbcfg.Connection = connStr

if driver == pg.DriverName {
pool, err := pg.NewPool(connStr)
pool, err := pg.NewPool(dbcfg)
if err != nil {
t.Fatalf("Failed to create PG pool: %v", err)
}
Expand Down
Loading