Skip to content
Merged
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
2 changes: 1 addition & 1 deletion easypg/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func newTableSnapshot(t *testing.T, db *sql.DB, tableName string, keyColumnNames
failOnErr(t, rows.Scan(scanTarget...))
row := make(rowSnapshot, len(columnNames))
for idx, columnName := range columnNames {
row[columnName] = scanTarget[idx].(*sqlValueSerializer).Serialized
row[columnName] = scanTarget[idx].(*sqlValueSerializer).Serialized //nolint:errcheck // this type assertion cannot fail because of how the slice is constructed
}
result.Rows[row.Key(result.KeyColumnNames)] = row
}
Expand Down
10 changes: 10 additions & 0 deletions gophercloudext/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ type ClientOpts struct {
// gophercloud.ProviderClient insists on taking ownership of whatever is
// given here, so we cannot just give http.DefaultClient here.
HTTPClient *http.Client

// CustomizeAuthOptions is a callback that can be used to modify the
// constructed AuthOptions before they are passed to the ProviderClient.
//
// This is used in rare special cases, e.g. when an application needs to
// spawn clients with different token scopes for specific operations.
CustomizeAuthOptions func(*gophercloud.AuthOptions)
}

// NewProviderClient authenticates with OpenStack using the credentials found
Expand Down Expand Up @@ -128,6 +135,9 @@ func NewProviderClient(ctx context.Context, optsPtr *ClientOpts) (*gophercloud.P
ApplicationCredentialID: os.Getenv(opts.EnvPrefix + "APPLICATION_CREDENTIAL_ID"),
ApplicationCredentialSecret: os.Getenv(opts.EnvPrefix + "APPLICATION_CREDENTIAL_SECRET"),
}
if opts.CustomizeAuthOptions != nil {
opts.CustomizeAuthOptions(&ao)
}

provider, err := openstack.NewClient(ao.IdentityEndpoint)
if err == nil {
Expand Down