Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horizon: Modify tx submission system to work with RO database #4418

Merged
merged 16 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
#4418: add default pwd for pg read only user on db connections
  • Loading branch information
sreuland committed Jun 10, 2022
commit 84b48f97622c9822a132b7bbdcaeb63ce8128d48
10 changes: 0 additions & 10 deletions services/horizon/internal/test/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,6 @@ func (i *Test) configureCaptiveCore() {
}
}

func (i *Test) getWebParameter(argName, envName string) string {
if value, ok := i.config.HorizonEnvironment[envName]; ok {
return value
}
if value, ok := i.config.HorizonWebParameters[argName]; ok {
return value
}
return ""
}

func (i *Test) getIngestParameter(argName, envName string) string {
if value, ok := i.config.HorizonEnvironment[envName]; ok {
return value
Expand Down
4 changes: 2 additions & 2 deletions support/db/dbtest/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func checkReadOnly(t testing.TB, DSN string) {
require.NoError(t, err)

if !rows.Next() {
_, err = tx.Exec("CREATE ROLE user_ro LOGIN;")
_, err = tx.Exec("CREATE ROLE user_ro WITH LOGIN PASSWORD 'user_ro';")
require.NoError(t, err)
}

Expand All @@ -153,7 +153,7 @@ func Postgres(t testing.TB) *DB {

postgresDSN := fmt.Sprintf("postgres:https://%s@localhost/?sslmode=disable", pgUser)
result.DSN = fmt.Sprintf("postgres:https://%s@localhost/%s?sslmode=disable&timezone=UTC", pgUser, result.dbName)
result.RO_DSN = fmt.Sprintf("postgres:https://%s@localhost/%s?sslmode=disable&timezone=UTC", "user_ro", result.dbName)
result.RO_DSN = fmt.Sprintf("postgres:https://%s:%s@localhost/%s?sslmode=disable&timezone=UTC", "user_ro", "user_ro", result.dbName)

execStatement(t, fmt.Sprintf("CREATE DATABASE %s;", result.dbName), postgresDSN)
execStatement(t, fmt.Sprintf("GRANT CONNECT ON DATABASE %s TO PUBLIC;", result.dbName), postgresDSN)
Expand Down