Skip to content
Draft

Test #185

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
b791c4f
replace ioutil.ReadAll with io.ReadAll (#122)
Feb 15, 2023
59c55d1
fix go build on CI (#123)
saito-sv Feb 21, 2023
0f9e978
use zero logs instead of log (#124)
saito-sv Feb 21, 2023
1058102
STR-414 :: Transactions fail when made from an unknown device (#125)
alcalawil Feb 23, 2023
90d835c
Task/andrin/str 457 (#126)
Feb 24, 2023
c1bcc0f
change transaction subtype to 'Fiat to Crypto' in Unit21 (#127)
Feb 25, 2023
617fc42
update unit21 on email capture (#128)
Feb 25, 2023
9c1c14e
STR-415(sandbox core API) (#129)
saito-sv Feb 27, 2023
f816b39
send fingerprint and ipaddress (#130)
Feb 28, 2023
0506665
Provide customer name and email to Checkout (#131)
Mar 3, 2023
86e894d
do not abort transaction if user email is not found
Mar 3, 2023
92df2ae
Merge pull request #132 from String-xyz/fix/sean/emailNotFound
auroter Mar 3, 2023
1786896
Added quote precision safety to ensure consistent payload marshaling
Mar 3, 2023
bd11a6a
round up to the nearest cent
Mar 3, 2023
0f5bdc3
rename centCeiling
Mar 6, 2023
180db6d
Merge pull request #133 from String-xyz/fix/sean/quotePayloadFloatPre…
auroter Mar 6, 2023
01eb41a
Setup debugger (#134)
alcalawil Mar 9, 2023
eca5e36
ensure devices for new users are verified (#135)
Mar 10, 2023
8b9b2f1
only create a new card if none was provided (#137)
Mar 14, 2023
1f150f0
STR-473 :: Refactor string-api to use go-lib (#136)
alcalawil Mar 16, 2023
185fb64
make jwt cokie http only again (#138)
alcalawil Mar 20, 2023
84a7b3f
STR-467 :: Make string-api use keys generated by platform-api (#139)
alcalawil Mar 27, 2023
ed9b6dd
Persist Cardholder's Name in the db && optional debugging! (#141)
Mar 29, 2023
530f565
remove tracer stuff
Mar 29, 2023
a8729d6
remove private rpc from model
Mar 29, 2023
e8694ab
remove executor detritus
Mar 29, 2023
c898be5
remove private rpc from network repo
Mar 29, 2023
b1f9259
adding contract allows. need to get platformId from apikey header
Mar 30, 2023
33bf4d6
adding fallback usd oracle
Mar 31, 2023
2293857
Merge branch 'fix/sean/removeTracer' into task/sean/str-520
Mar 31, 2023
4bff60d
merge detritus
Mar 31, 2023
4b56163
fix migration, nil pointer
Mar 31, 2023
01f54af
use strconv
Mar 31, 2023
fe21b7d
Merge pull request #146 from String-xyz/task/sean/str-520
auroter Mar 31, 2023
623a7d3
core api sandbox deployment (#145)
saito-sv Mar 31, 2023
1a27284
STR-468 :: associate the user with a platform based on the api key (#…
alcalawil Mar 31, 2023
5136b09
seed allow test contract, require allow contract on Quote
Apr 2, 2023
0837fb4
Fix/andrin/baseurl (#147)
Apr 3, 2023
0e765f7
get platform ID to verify contract
Apr 3, 2023
888028a
Merge branch 'develop' into task/sean/str-518
Apr 3, 2023
104aa34
fix mismatched declarations from merge
Apr 3, 2023
17776a2
Get Checkout customer and instruments (#149)
Apr 3, 2023
8707f32
use 'platformId' for platform... not 'userId'
Apr 3, 2023
352c263
remove completed TODO
Apr 3, 2023
83bacd6
address feedback
Apr 4, 2023
a5ca1b5
function declaration styling
Apr 4, 2023
45a7785
Don't allowlist check deactivated contracts
Apr 4, 2023
1994642
Add bypassDevice param to login (#148)
frostbournesb Apr 4, 2023
c0cbeb2
move defer rows.close
Apr 4, 2023
d2d0d99
Merge pull request #150 from String-xyz/task/sean/str-518
auroter Apr 4, 2023
3c3e45f
STR-515 :: All error responses should be logged to datadog errors (#151)
alcalawil Apr 4, 2023
1ab60d8
Fix backup price oracle using failed oracle API name for coin
Apr 5, 2023
1088fa6
remove debug printf
Apr 5, 2023
fbd7b49
Merge pull request #152 from String-xyz/fix/sean/backupPriceOracle
auroter Apr 5, 2023
c670410
STR-471 :: Associate contact with platform based on the api key (#153)
alcalawil Apr 6, 2023
cdc9976
add secret to apikey model (#154)
alcalawil Apr 7, 2023
7456cc9
Task/sean/str 509 (#155)
auroter Apr 10, 2023
1de8745
hint should default to empty string (#157)
Apr 10, 2023
da8a000
:
Apr 10, 2023
8d2fde9
Merge pull request #158 from String-xyz/task/sean/str-510
auroter Apr 10, 2023
ce90c5c
rename to team_phone_numbers
ocasta181 Apr 11, 2023
7890eb0
add to sandbox
ocasta181 Apr 11, 2023
0432efb
spacing
ocasta181 Apr 11, 2023
91ab813
add iam role
ocasta181 Apr 11, 2023
ea8482a
simplify 'balance too low' logic to *always* alert if balance is belo…
Apr 11, 2023
e89306f
simplify 'balance too low' logic to *always* alert if balance is belo…
Apr 11, 2023
7e8900c
ensure we notify team if expected balance is going to be below threshold
Apr 11, 2023
093a39b
Merge pull request #161 from String-xyz/fix/sean/lowBalanceAlert
auroter Apr 11, 2023
4433a81
remove string platform placeholder id
ocasta181 Apr 11, 2023
b2c3e56
update iam roles content on dev and order on sandbox
ocasta181 Apr 11, 2023
a1f0d1b
removed phone numbers from dev infra since we don't want to be spamme…
ocasta181 Apr 11, 2023
c2afdd7
add prevalidated endpoint (#160)
alcalawil Apr 11, 2023
97493f6
Merge pull request #163 from String-xyz/task/andrin/deploy
Apr 11, 2023
fb5555b
add support for array params
Apr 12, 2023
48886b9
STR-517 :: Change API Updates from PUT to PATCH (#164)
alcalawil Apr 13, 2023
a112de0
Merge pull request #165 from String-xyz/task/sean/str-510
auroter Apr 13, 2023
6903de5
add "Name" field to /transact request and include it in receipt email
Apr 16, 2023
032598b
Return FORBIDDEN if Contract or Contract Function is not allowed by p…
Apr 16, 2023
94463f0
always check status of c.Get()
Apr 16, 2023
ddca7d6
rename refresh token to StringRefreshToken
Apr 16, 2023
63a45fd
move assetName into Quote request body
Apr 17, 2023
18c50b8
remove debug print
Apr 17, 2023
9db7309
use serror.Is()
Apr 17, 2023
bda3a25
Merge pull request #169 from String-xyz/task/sean/str-535
auroter Apr 17, 2023
8d7b886
Merge pull request #167 from String-xyz/task/sean/str-529
auroter Apr 17, 2023
6bbc043
use go lib errors
Apr 17, 2023
ea2a5c8
Merge pull request #170 from String-xyz/task/sean/str-534
auroter Apr 17, 2023
02b5bf4
update golib to 1.4.0
Apr 17, 2023
1f54120
Merge pull request #168 from String-xyz/task/sean/str-536
auroter Apr 17, 2023
e4d3fd0
Change our Outbound email address to stringxyz.com (#171)
alcalawil Apr 18, 2023
3183124
Enable transactions with saved cards (#142)
Apr 18, 2023
d1fdbf9
Sanitize Input for sql injection (#172)
alcalawil Apr 18, 2023
b35ad69
No more TxValue wildcard in QuoteCache (#173)
auroter Apr 20, 2023
1321348
ensure we use ctx Context in all instances from the request down to t…
alcalawil Apr 24, 2023
8815014
Add Organization as the root entity (#174)
Apr 25, 2023
ec100a6
Task/marlon/str 544 (#177)
saito-sv Apr 26, 2023
8be7ab4
Task/sean/str 568 (#183)
auroter Apr 26, 2023
1247362
If an env var is missing, panic and print all missing env vars (#184)
auroter Apr 27, 2023
6262828
Email Verification should not wait (#181)
frostbournesb Apr 27, 2023
e2b6820
Isolate Migrations (#175)
Apr 28, 2023
0d0df28
soft delete (#179)
alcalawil Apr 28, 2023
4a329e3
STR-245 (#186)
saito-sv May 9, 2023
3d7aaa6
add annotations; some cleanup (#188)
May 11, 2023
644c650
Add http response code to function names (#189)
May 12, 2023
bac7db8
Got (all but one) unit21 tests working (#190)
May 12, 2023
a6cc5e8
remove 'required,string' from annotations (#191)
May 17, 2023
a0c6405
make platform associated with email verification (#192)
May 18, 2023
0219d4e
handle platform deactivation (#193)
alcalawil May 20, 2023
da1fe1c
Update the transact endpoint for saved payment option (#195)
alcalawil May 23, 2023
8c2f340
STR-591 (#194)
saito-sv May 23, 2023
45ae151
[STR-598] Update Device Verification (#196)
frostbournesb May 23, 2023
c002716
Use HTML Templates for emails (#197)
May 30, 2023
04dfb84
Checkout Integration(STR-637) (#198)
saito-sv Jun 1, 2023
b9cb221
[STR-639] String Checkout 2.0 (#200)
frostbournesb Jun 6, 2023
c435f45
Fetch Saved Cards(STR-611) (#199)
saito-sv Jun 7, 2023
1e77730
Task/sean/str 616 (#203)
auroter Jun 13, 2023
d30967f
Task/sean/str 588 (#204)
auroter Jun 13, 2023
551e028
Task/sean/str 587 (#205)
auroter Jun 13, 2023
958da80
add platform name to sender name in email verification (#202)
auroter Jun 13, 2023
25bccb2
update golib (#206)
auroter Jun 18, 2023
ddb70f4
Checkout Webhooks(STR-539) (#207)
saito-sv Jun 20, 2023
6ff062a
create a mess (#211)
auroter Jun 26, 2023
fd993d6
prod env vars (#212)
saito-sv Jun 26, 2023
a3fdc9b
send device verification email upon unrecognized device!!!!! (#213)
auroter Jun 27, 2023
ef71942
added some missing env vars (#214)
saito-sv Jun 27, 2023
8f35e96
fixed some wrongly named env vars (#215)
saito-sv Jun 28, 2023
6cc91e3
Task/sean/str 657 (#209)
auroter Jun 29, 2023
d8b3c9e
Task/sean/str 674 (#216)
auroter Jul 5, 2023
5daf82c
added contract to platform (#218)
saito-sv Jul 10, 2023
5a3e061
update sandbox infra (#220)
Jul 10, 2023
cdb54fd
resolve RTR error (#223)
Jul 11, 2023
ef2d93d
docker tags and service name (#222)
saito-sv Jul 11, 2023
1f3a870
updating go lib (#224)
Jul 11, 2023
87f6b4b
deployment version (#225)
Jul 11, 2023
6a1bf5f
Deployment to Sandbox on July 11th 2023 (#226)
Jul 12, 2023
80df05f
cd for dev and sandbox (#227)
saito-sv Jul 13, 2023
0feb4f7
Task/sean/str 675 (#217)
auroter Jul 14, 2023
c79a59a
Add `asset_to_network` table (#231)
Jul 17, 2023
6c7fcc3
added prod CI (#232)
saito-sv Jul 18, 2023
9d7e465
Task/sean/str 695 (#229)
auroter Jul 18, 2023
3b7ed9e
Task/sean/str 698 (#234)
auroter Jul 19, 2023
1264b94
add type to contract (#233)
Jul 19, 2023
617696c
remove ssl from env.example (#236)
brianspierce Jul 23, 2023
536bcde
Added "transfer()" commands to token cost analysis (#235)
auroter Jul 24, 2023
7258548
Task/sean/str 204 (#237)
auroter Jul 25, 2023
11d4800
persona api wrapper (#221)
saito-sv Jul 25, 2023
790c2b6
clean up redundant import aliasing (#238)
auroter Jul 27, 2023
11f10c4
webhooks (#241)
saito-sv Jul 28, 2023
09a2ebe
Add KYC Service and enable getting user's persona accountId (#239)
Jul 28, 2023
a81139f
env vars (#242)
saito-sv Jul 28, 2023
c92c541
task/sean/str-678 (#240)
auroter Jul 31, 2023
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
37 changes: 37 additions & 0 deletions .air-debug.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
root = "."
testdata_dir = "pkg/test"
tmp_dir = "tmp"

[build]
args_bin = []
bin = "./tmp/main"
cmd = "go build -gcflags='all=-N -l' -o ./tmp/main ./cmd/app/main.go"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata", "test"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = "dlv exec --accept-multiclient --log --headless --continue --listen :2346 --api-version 2 ./tmp/main"
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html", "env"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
stop_on_error = true

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
time = false

[misc]
clean_on_exit = false

[screen]
clear_on_rebuild = false
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ tmp_dir = "tmp"
bin = "./tmp/main"
cmd = "go build -o ./tmp/main ./cmd/app/main.go"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata", "test"]
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html", "env"]
include_ext = ["go", "tpl", "tmpl", "html"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
Expand Down
20 changes: 15 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
BASE_URL=https://localhost:5555/
BASE_URL=http://localhost:5555/
ENV=local
PORT=5555

##### SET THIS TO YOUR WALLET FOR LOCAL TESTING
STRING_HOTWALLET_ADDRESS=0xb4D168E584dA81B6712412472F163bcf0Af5171C

COINGECKO_API_URL=https://api.coingecko.com/api/v3/
COINCAP_API_URL=https://api.coincap.io/v2/
OWLRACLE_API_URL=https://api.owlracle.info/v3/
OWLRACLE_API_KEY=
OWLRACLE_API_SECRET=
Expand Down Expand Up @@ -30,14 +35,19 @@ UNIT21_RTR_URL=https://rtr.sandbox2.unit21.com/evaluate
TWILIO_ACCOUNT_SID=AC034879a536d54325687e48544403cb4d
TWILIO_AUTH_TOKEN=
TWILIO_SMS_SID=MG367a4f51ea6f67a28db4d126eefc734f
DEV_PHONE_NUMBERS=+14088675309,+14155555555
TEAM_PHONE_NUMBERS=+14088675309,+14155555555
STRING_ENCRYPTION_KEY=secret_encryption_key_0123456789
SENDGRID_API_KEY=
IPSTACK_API_KEY=
FINGERPRINT_API_KEY=
FINGERPRINT_API_URL=https://api.fpjs.io/
STRING_INTERNAL_ID=00000000-0000-0000-0000-000000000000
STRING_WALLET_ID=00000000-0000-0000-0000-000000000001
STRING_BANK_ID=00000000-0000-0000-0000-000000000002
STRING_PLACEHOLDER_PLATFORM_ID=00000000-0000-0000-0000-000000000003
SERVICE_NAME=string_api
SERVICE_NAME=string_api
DEBUG_MODE=false
AUTH_EMAIL_ADDRESS=auth@stringxyz.com
RECEIPTS_EMAIL_ADDRESS=receipts@stringxyz.com
CARD_FAIL_PROBABILITY= [0.0 - 1.0]
WEBHOOK_SECRET_KEY=secret
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/<>/<>
PERSONA_API_KEY=
70 changes: 70 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: deploy to development
permissions:
id-token: write
contents: read
on:
push:
branches: [develop]
jobs:
deploy:
environment:
name: development
url: https://api.dev.string-api.xyz

name: build push and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: install deps
run: |
go mod download

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ASSUME_ROLE }}

- name: login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: build,tag and push to Amazon ECR
id: image-builder
env:
ECR_REPO: ${{ secrets.AWS_ACCT }}.dkr.ecr.us-west-2.amazonaws.com
SERVICE: api
IMAGE_TAG: ${{ github.sha }}
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go
docker build --platform linux/amd64 -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
docker push $ECR_REPO/$SERVICE:$IMAGE_TAG
echo "image=$ECR_REPO/$SERVICE:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: get latest task definition
run: |
aws ecs describe-task-definition --task-definition api --query taskDefinition > task-definition.json

- name: update task definition
id: task
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: api
image: ${{ steps.image-builder.outputs.image }}

- name: deploy
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task.outputs.task-definition }}
cluster: core
service: api
wait-for-service-stability: true
76 changes: 76 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: deploy
permissions:
id-token: write
contents: read
on:
push:
tags:
- "*"
jobs:
deploy-prod:
environment:
name: production
url: https://api.string-api.xyz
if: startsWith(github.ref, 'refs/tags/')
name: deploy to ECS - Production
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: install deps
run: |
go mod download

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.PROD_ASSUME_ROLE }}

- name: login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Extract tag
id: extract_tag
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- name: build,tag and push to Amazon ECR
id: image-builder
env:
ECR_REPO: ${{ secrets.PROD_AWS_ACCT }}.dkr.ecr.us-west-2.amazonaws.com
SERVICE: api
IMAGE_TAG: ${{ steps.extract_tag.tag }}
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go
docker build --platform linux/amd64 -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
docker push $ECR_REPO/$SERVICE:$IMAGE_TAG
echo "image=$ECR_REPO/$SERVICE:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: get latest task definition
run: |
aws ecs describe-task-definition --task-definition api --query taskDefinition > task-definition.json

- name: update task definition
id: task
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: api
image: ${{ steps.image-builder.outputs.image }}

- name: deploy
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task.outputs.task-definition }}
cluster: core
service: api
wait-for-service-stability: true
70 changes: 70 additions & 0 deletions .github/workflows/deploy-sandbox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: deploy to sandbox
permissions:
id-token: write
contents: read
on:
push:
branches: [sandbox]
jobs:
deploy:
environment:
name: sandbox
url: https://api.sandbox.string-api.xyz

name: build push and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: install deps
run: |
go mod download

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ASSUME_ROLE }}

- name: login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: build,tag and push to Amazon ECR
id: image-builder
env:
ECR_REPO: ${{ secrets.AWS_ACCT }}.dkr.ecr.us-west-2.amazonaws.com
SERVICE: sandbox-string-api
IMAGE_TAG: ${{ github.sha }}
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go
docker build --platform linux/amd64 -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
docker push $ECR_REPO/$SERVICE:$IMAGE_TAG
echo "image=$ECR_REPO/$SERVICE:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: get latest task definition
run: |
aws ecs describe-task-definition --task-definition sandbox-api --query taskDefinition > task-definition.json

- name: update task definition
id: task
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: api
image: ${{ steps.image-builder.outputs.image }}

- name: deploy
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task.outputs.task-definition }}
cluster: sandbox-core
service: api
wait-for-service-stability: true
58 changes: 0 additions & 58 deletions .github/workflows/dev-deploy.yml

This file was deleted.

Loading