✨ feat(indexer): Execute sql migrations file on startup#7092
✨ feat(indexer): Execute sql migrations file on startup#7092roninjin10 wants to merge 5 commits intodevelopfrom
Conversation
roninjin10
commented
Sep 1, 2023
- Execute the migrations file on startup
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
|
Semgrep found 1
A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM). View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>indexer/database/db.go</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0("<b>[Line: 40]</b> #quot; password=%s#quot;")
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2("<b>[Line: 40]</b> dsn")
end
%% Sink
subgraph Sink
direction LR
v1("<b>[Line: 42]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br> SkipDefaultTransaction: true,<br> Logger: logger.Default.LogMode(logger.Silent),<br> })")
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
%% Clickable
click v0 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L40" "View in source" _blank
click v1 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L42" "View in source" _blank
click v2 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L40" "View in source" _blank
Semgrep found 1
The application uses an empty credential. This can lead to unauthorized access by either an internal or external malicious actor. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM). View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>indexer/database/db.go</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0("<b>[Line: 40]</b> #quot; password=%s#quot;")
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2("<b>[Line: 40]</b> dsn")
end
%% Sink
subgraph Sink
direction LR
v1("<b>[Line: 42]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br> SkipDefaultTransaction: true,<br> Logger: logger.Default.LogMode(logger.Silent),<br> })")
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
%% Clickable
click v0 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L40" "View in source" _blank
click v1 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L42" "View in source" _blank
click v2 href "https://github.com/ethereum-optimism/optimism/blob/b9e6a7a38f3d0e2e7ab87285105f559930114904/indexer/database/db.go#L40" "View in source" _blank
|
|
closes #71 |
|
Moving to draft because this looks like it breaks tests |
7cd6084 to
c9208e4
Compare
b9e6a7a to
02ab2de
Compare
02ab2de to
69a21d2
Compare
|
Hey @roninjin10! This PR has merge conflicts. Please fix them before continuing review. |
e47ea24 to
0c399aa
Compare
7318de6 to
d50c58f
Compare
d50c58f to
bbc8a8d
Compare

