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

Ziga/gateway verbose logging and bugfix #1884

Merged
merged 2 commits into from
Apr 26, 2024
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 .github/workflows/manual-deploy-obscuro-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ jobs:
&& docker run -d -p 80:80 -p 81:81 --name ${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }} \
-e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \
${{ vars.DOCKER_BUILD_TAG_GATEWAY }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR }} -verbose=true \
-logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"'
13 changes: 10 additions & 3 deletions tools/walletextension/httpapi/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func versionRequestHandler(walletExt *rpcapi.Services, userConn UserConn) {
}
}

// getMessageRequestHandler handles request to /get-message endpoint.
// getMessageRequestHandler handles request to /getmessage endpoint.
func getMessageRequestHandler(walletExt *rpcapi.Services, conn UserConn) {
// read the request
body, err := conn.ReadRequest()
Expand All @@ -351,8 +351,15 @@ func getMessageRequestHandler(walletExt *rpcapi.Services, conn UserConn) {

// get address from the request
encryptionToken, ok := reqJSONMap[common.JSONKeyEncryptionToken]
if !ok || len(encryptionToken.(string)) != common.MessageUserIDLen {
handleError(conn, walletExt.Logger(), fmt.Errorf("unable to read encryptionToken field from the request or it is not of correct length"))
if !ok {
handleError(conn, walletExt.Logger(), fmt.Errorf("encryptionToken field not found in the request"))
return
}
if tokenStr, ok := encryptionToken.(string); !ok {
handleError(conn, walletExt.Logger(), fmt.Errorf("encryptionToken field is not a string"))
return
} else if len(tokenStr) != common.MessageUserIDLen {
handleError(conn, walletExt.Logger(), fmt.Errorf("encryptionToken field is not of correct length"))
return
}

Expand Down
Loading