-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
199 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
allow-parallel-runners: true | ||
run: | ||
timeout: 5m | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
- goimports | ||
- unused | ||
- gosec | ||
linters-settings: | ||
gosec: | ||
# To select a subset of rules to run. | ||
# Available rules: https://github.com/securego/gosec#available-rules | ||
includes: | ||
- G103 # Audit the use of unsafe block | ||
- G104 # Audit errors not checked | ||
- G106 # Audit the use of ssh.InsecureIgnoreHostKey | ||
- G108 # Profiling endpoint automatically exposed on /debug/pprof | ||
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 | ||
- G110 # Potential DoS vulnerability via decompression bomb | ||
- G111 # Potential directory traversal | ||
- G112 # Potential slowloris attack | ||
# - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G203 # Use of unescaped data in HTML templates | ||
- G204 # Audit use of command execution | ||
- G301 # Poor file permissions used when creating a directory | ||
- G302 # Poor file permissions used with chmod | ||
- G303 # Creating tempfile using a predictable path | ||
- G304 # File path provided as taint input | ||
- G305 # File traversal when extracting zip/tar archive | ||
- G306 # Poor file permissions used when writing to a new file | ||
- G307 # Poor file permissions used when creating a file with os.Create | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G501 # Import blocklist: crypto/md5 | ||
- G502 # Import blocklist: crypto/des | ||
- G503 # Import blocklist: crypto/rc4 | ||
- G504 # Import blocklist: net/http/cgi | ||
- G505 # Import blocklist: crypto/sha1 | ||
- G602 # Slice access out of bounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
VERSION --arg-scope-and-set --pass-args --use-function-keyword 0.7 | ||
|
||
ARG core=github.com/formancehq/earthly:v0.11.1 | ||
IMPORT $core AS core | ||
IMPORT ../.. AS stack | ||
|
||
FROM core+base-image | ||
|
||
go-sources: | ||
COPY events.go go.* base.yaml /src/ | ||
COPY --dir services /src/ | ||
WORKDIR /src | ||
SAVE ARTIFACT /src | ||
|
||
tidy: | ||
FROM core+builder-image | ||
COPY (+go-sources/*) /src | ||
WORKDIR /src | ||
DO --pass-args stack+GO_TIDY | ||
SAVE ARTIFACT go.* AS LOCAL ./ | ||
|
||
lint: | ||
FROM core+builder-image | ||
COPY (+go-sources/*) /src | ||
WORKDIR /src | ||
COPY --pass-args +tidy/go.* . | ||
DO --pass-args stack+GO_LINT | ||
SAVE ARTIFACT * AS LOCAL ./ | ||
|
||
generate: | ||
RUN apk add nodejs npm | ||
WORKDIR /src | ||
COPY package* . | ||
RUN npm install | ||
RUN mkdir generated | ||
COPY index.js base.yaml . | ||
COPY --dir services . | ||
RUN node index.js | ||
SAVE ARTIFACT generated AS LOCAL ./generated | ||
|
||
pre-commit: | ||
WAIT | ||
BUILD --pass-args +tidy | ||
END | ||
BUILD --pass-args +lint | ||
BUILD --pass-args +generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
libs/events/generated/ledger-v2.0.0-COMMITTED_TRANSACTIONS.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"ledger":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"},"reverted":{"type":"boolean"}},"required":["postings","reference","metadata","id","timestamp","reverted"]}}},"required":["ledger","transactions"]}},"required":["date","app","version","type","payload"]} | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"ledger":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"},"reverted":{"type":"boolean"}},"required":["postings","metadata","id","timestamp","reverted"]}}},"required":["ledger","transactions"]}},"required":["date","app","version","type","payload"]} |
2 changes: 1 addition & 1 deletion
2
libs/events/generated/ledger-v2.0.0-REVERTED_TRANSACTION.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"ledger":{"type":"string"},"revertedTransaction":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"},"reverted":{"type":"boolean"}},"required":["postings","reference","metadata","id","timestamp","reverted"]},"revertTransaction":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"}},"required":["postings","reference","metadata","id","timestamp"]}},"required":["ledger","revertedTransaction","revertTransaction"]}},"required":["date","app","version","type","payload"]} | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"ledger":{"type":"string"},"revertedTransaction":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"},"reverted":{"type":"boolean"}},"required":["postings","metadata","id","timestamp","reverted"]},"revertTransaction":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"destination":{"type":"string"},"amount":{"type":"number"},"asset":{"type":"string"}},"required":["source","destination","amount","asset"]}},"reference":{"type":"string"},"metadata":{"type":"object","properties":{},"required":[]},"id":{"type":"number"},"timestamp":{"type":"string"}},"required":["postings","metadata","id","timestamp"]}},"required":["ledger","revertedTransaction","revertTransaction"]}},"required":["date","app","version","type","payload"]} |
2 changes: 1 addition & 1 deletion
2
libs/events/generated/payments-v1.0.0-CONNECTOR_RESET.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"createdAt":{"type":"string"},"connector":{"type":"string"}},"required":["createdAt","connector"]}},"required":["date","app","version","type","payload"]} | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"createdAt":{"type":"string"},"connector":{"type":"string"}},"required":["createdAt","connectorId"]}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","createdAt"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"required":["date","app","version","type","payload"]} |
1 change: 1 addition & 0 deletions
1
libs/events/generated/payments-v1.0.0-DELETED_TRANSFER_INITIATION.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","createdAt"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","reference","createdAt","connectorId","provider","defaultAsset","accountName","type"],"properties":{"id":{"type":"string"},"reference":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"connectorId":{"type":"string"},"provider":{"type":"string"},"defaultAsset":{"type":"string"},"accountName":{"type":"string"},"type":{"type":"string","enum":["UNKNOWN","INTERNAL","EXTERNAL"]}}}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["accountID","connectorId","createdAt","asset","balance"],"properties":{"accountID":{"type":"string"},"connectorId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"asset":{"type":"string"},"balance":{"type":"number","format":"bigint"}}}},"required":["date","app","version","type","payload"]} |
1 change: 1 addition & 0 deletions
1
libs/events/generated/payments-v1.0.0-SAVED_BANK_ACCOUNT.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","createdAt","name","country"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"name":{"type":"string"},"country":{"type":"string"},"accountNumber":{"type":"string"},"iban":{"type":"string"},"swiftBicCode":{"type":"string"},"adjustments":{"type":["array","null"],"items":{"type":"object","required":["id","createdAt","accountID","connectorID","provider"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"accountID":{"type":"string"},"connectorID":{"type":"string"},"provider":{"type":"string"}}}}}}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","properties":{"provider":{"type":"string"},"reference":{"type":"string"},"scheme":{"type":"string","enum":["unknown","other","visa","mastercard","amex","diners","discover","jcb","unionpay","sepa debit","sepa credit","sepa","apple pay","google pay","a2a","ach debit","ach","rtp"]},"type":{"type":"string","enum":["PAY-IN","PAYOUT","TRANSFER","OTHER"]},"status":{"type":"string"},"id":{"type":"string"},"initialAmount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"}}}},"required":["date","app","version","type","payload"]} | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","reference","createdAt","connectorId","provider","type","status","scheme","asset","amount","initialAmount"],"properties":{"id":{"type":"string"},"reference":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"connectorId":{"type":"string"},"provider":{"type":"string"},"type":{"type":"string","enum":["PAY-IN","PAYOUT","TRANSFER","OTHER"]},"status":{"type":"string"},"scheme":{"type":"string","enum":["unknown","other","visa","mastercard","amex","diners","discover","jcb","unionpay","alipay","cup","sepa debit","sepa credit","sepa","apple pay","google pay","doku","dragonpay","maestro","molpay","a2a","ach debit","ach","rtp"]},"asset":{"type":"string"},"amount":{"type":"number","format":"bigint"},"initialAmount":{"type":"number","format":"bigint"},"sourceAccountId":{"type":"string"},"destinationAccountId":{"type":"string"},"links":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"uri":{"type":"string"}}}},"rawData":{"type":"object"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","name","createdAt","accountIDs"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"accountIDs":{"type":"array","items":{"type":"string"}}}}},"required":["date","app","version","type","payload"]} |
1 change: 1 addition & 0 deletions
1
libs/events/generated/payments-v1.0.0-SAVED_TRANSFER_INITIATION.yaml.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"object","properties":{"app":{"type":"string"},"version":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"ledger":{"type":"string"},"payload":{"type":"object","required":["id","createdAt","scheduledAt","connectorId","provider","description","type","destinationAccountId","amount","asset","attempts","status","error"],"properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"scheduledAt":{"type":"string","format":"date-time"},"connectorId":{"type":"string"},"provider":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["TRANSFER","PAYOUT"]},"sourceAccountId":{"type":"string"},"destinationAccountId":{"type":"string"},"amount":{"type":"number","format":"bigint"},"asset":{"type":"string"},"attempts":{"type":"number"},"status":{"type":"string","enum":["WAITING_FOR_VALIDATION","PROCESSING","PROCESSED","FAILED","REJECTED","VALIDATED","ASK_RETRIED","ASK_REVERSED","REVERSE_PROCESSING","REVERSE_FAILED","PARTIALLY_REVERSED","REVERSED"]},"error":{"type":"string"},"relatedPayments":{"type":["array","null"],"items":{"type":"object","required":["transferInitiationId","paymentId","createdAt","status","error"],"properties":{"transferInitiationId":{"type":"string"},"paymentId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"status":{"type":"string"},"error":{"type":"string"}}}}}}},"required":["date","app","version","type","payload"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
allow-parallel-runners: true | ||
run: | ||
timeout: 5m | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
- goimports | ||
- unused | ||
- gosec | ||
linters-settings: | ||
gosec: | ||
# To select a subset of rules to run. | ||
# Available rules: https://github.com/securego/gosec#available-rules | ||
includes: | ||
- G103 # Audit the use of unsafe block | ||
- G104 # Audit errors not checked | ||
- G106 # Audit the use of ssh.InsecureIgnoreHostKey | ||
- G108 # Profiling endpoint automatically exposed on /debug/pprof | ||
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 | ||
- G110 # Potential DoS vulnerability via decompression bomb | ||
- G111 # Potential directory traversal | ||
- G112 # Potential slowloris attack | ||
# - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G203 # Use of unescaped data in HTML templates | ||
- G204 # Audit use of command execution | ||
- G301 # Poor file permissions used when creating a directory | ||
- G302 # Poor file permissions used with chmod | ||
- G303 # Creating tempfile using a predictable path | ||
- G304 # File path provided as taint input | ||
- G305 # File traversal when extracting zip/tar archive | ||
- G306 # Poor file permissions used when writing to a new file | ||
- G307 # Poor file permissions used when creating a file with os.Create | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G501 # Import blocklist: crypto/md5 | ||
- G502 # Import blocklist: crypto/des | ||
- G503 # Import blocklist: crypto/rc4 | ||
- G504 # Import blocklist: net/http/cgi | ||
- G505 # Import blocklist: crypto/sha1 | ||
- G602 # Slice access out of bounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.