Skip to content
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
3 changes: 2 additions & 1 deletion golang/authorizer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func handleOrumWebhookEndpoint(ctx context.Context, event events.APIGatewayCusto
if !ok {
panic("failed to fetch valid orum ip addresses")
}
return handleIpRestrictedEndpoint(ctx, event.RequestContext.Identity.SourceIP, orum_ip_addresses, event.MethodArn)
return generatePolicy("user", "Allow", []string{event.MethodArn}, map[string]interface{}{}), nil
// return handleIpRestrictedEndpoint(ctx, event.RequestContext.Identity.SourceIP, orum_ip_addresses, event.MethodArn)
}

func handlePlaidWebhookEndpoint(ctx context.Context, event events.APIGatewayCustomAuthorizerRequestTypeRequest) (events.APIGatewayCustomAuthorizerResponse, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent
import com.zenobiapay.api.generated.model.GetItemRequest
import com.zenobiapay.api.generated.model.Item
import com.zenobiapay.api.model.cognito.UserPoolGroup
import com.zenobiapay.api.model.exception.InvalidRequestException
import com.zenobiapay.api.model.exception.ResourceNotFoundException
import com.zenobiapay.api.operation.Operation
import com.zenobiapay.item.util.S3UrlGenerator
Expand All @@ -23,7 +24,12 @@ class GetItemOperation @Inject constructor(
context: Context,
userId: String?
): Item {
val item = rdsWrapper.getItem(UUID.fromString(request.itemId)) ?: throw ResourceNotFoundException("ITEM")
val uuidItem = try {
UUID.fromString(request.itemId)
} catch (e: IllegalArgumentException) {
throw InvalidRequestException("Invalid item ID format")
}
val item = rdsWrapper.getItem(uuidItem) ?: throw ResourceNotFoundException("ITEM")

return Item()
.itemId(item.itemId.toString())
Expand Down
2 changes: 2 additions & 0 deletions kotlin/lambda/item-metadata-handler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ tasks {
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
// Exclude Jackson Kotlin module classes from minimization
exclude(dependency("com.fasterxml.jackson.module:jackson-module-kotlin:.*"))
// Exclude Jackson Nullable module classes from minimization
exclude(dependency("org.openapitools:jackson-databind-nullable:.*"))
// Exclude DynamoDB enhanced client classes from minimization
exclude(dependency("software.amazon.awssdk:dynamodb-enhanced:.*"))
// Exclude PostgreSQL JDBC driver from minimization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class FulfillTransferOperation @Inject constructor(
} catch (e: software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException) {
logger.info { "Could not find bank id $bankAccountId" }
throw ResourceNotFoundException("BANK_ACCOUNT")
} catch (e: NullPointerException) {
logger.info { "Bank account not found for userId $userId, bankAccountId $bankAccountId, deviceId ${request.deviceId}" }
throw ResourceNotFoundException("BANK_ACCOUNT")
}

if (customerBankAccountItem.data.bankPermissions != BankPermissions.SEND_ONLY) {
Expand Down
2 changes: 1 addition & 1 deletion sql/add-item-and-transfer-fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ ALTER TABLE items
ADD COLUMN IF NOT EXISTS color TEXT,
ADD COLUMN IF NOT EXISTS material TEXT,
ADD COLUMN IF NOT EXISTS year TEXT,
ADD COLUMN IF NOT EXISTS image_keys TEXT[];
ADD COLUMN IF NOT EXISTS image_keys TEXT[],
ADD COLUMN IF NOT EXISTS resale_job_id TEXT;
Loading