Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ef0e804
feat: add basic OAuth flow
jeastham1993 Jul 9, 2025
7b70e62
feat: add OAuth 2 flow to user service
jeastham1993 Jul 9, 2025
0ade4b6
feat: fix integration test issue
jeastham1993 Jul 9, 2025
5eb0c38
chore: clippy fix + build warnings
jeastham1993 Jul 9, 2025
f3a11f9
feat: update auth flow and add OAuth to MCP server
jeastham1993 Jul 14, 2025
3ea4ca1
feat: add IaC examples for MCP server
jeastham1993 Jul 15, 2025
dab6eec
fix: update Postgres datatypes
jeastham1993 Jul 15, 2025
805f0e7
feat: add OAuth endpoints to Terraform
jeastham1993 Jul 15, 2025
dad6d3a
feat: add OAuth endpoints to TF and SAM
jeastham1993 Jul 15, 2025
a8d9bfd
feat: update login form styling
jeastham1993 Jul 15, 2025
6024944
chore: update DDB table name
jeastham1993 Jul 15, 2025
cd5a54e
chore: update packaging script for additional functions
jeastham1993 Jul 15, 2025
529f199
feat: add build step to tf-apply
jeastham1993 Jul 15, 2025
184489d
fix: update Terraform and SAM templates
jeastham1993 Jul 15, 2025
752911f
fix: add build sub command to SAM deploy
jeastham1993 Jul 15, 2025
0c25e6b
chore: add log message for email under test
jeastham1993 Jul 16, 2025
54ddf8d
fix: resolve TF and SAM DDB definition issues
jeastham1993 Jul 16, 2025
0a4fd32
fix: resolve compilation issue
jeastham1993 Jul 16, 2025
f8cbcce
fix: update template DDB definition
jeastham1993 Jul 16, 2025
8e4b234
chore: updates to load sims and packages
jeastham1993 Jul 17, 2025
b18c5ed
feat: fix integration tests for user service
jeastham1993 Jul 17, 2025
e7b8920
feat: removed unused referecens
jeastham1993 Jul 17, 2025
e0fe90e
fix: integration test compilation errors
jeastham1993 Jul 23, 2025
b5f7a09
Merge branch 'main' into feat/add-oauth
jeastham1993 Jul 23, 2025
f36255f
feat: add poetry export command
jeastham1993 Jul 23, 2025
b31b529
feat: fix TF example API stages
jeastham1993 Jul 23, 2025
294cdea
feat: update SAM template to use cargo lambda build
jeastham1993 Jul 23, 2025
de802ea
fix: resolve issue with SAM template permissions
jeastham1993 Jul 23, 2025
9303c55
fix: resolve integration test issues
jeastham1993 Jul 23, 2025
87916d1
chore: update SAM template to use pre-built
jeastham1993 Jul 23, 2025
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
16 changes: 13 additions & 3 deletions cdk-deploy-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ cdk deploy --require-approval never
popd

# Service deployments in parallel
pushd src/inventory-service/cdk
pushd src/inventory-service
mvn clean package -DskipTests -q
popd
pushd src/inventory-service/cdk
cdk deploy --require-approval never &>../../../deployment-logs/inventory-service.log &
popd

Expand Down Expand Up @@ -41,8 +43,16 @@ cdk deploy --require-approval never &>../../deployment-logs/loyalty-point-servic
popd

pushd src/activity-service
npm i
./package.sh
pip install --upgrade pip pre-commit poetry
pre-commit install
poetry config --local virtualenvs.in-project true
poetry install --no-root
npm ci
poetry export --only=dev --format=requirements.txt > dev_requirements.txt
poetry export --without=dev --format=requirements.txt > lambda_requirements.txt
rm -rf .build
mkdir -p .build/lambdas ; cp -r activity_service .build/lambdas
mkdir -p .build/common_layer ; poetry export --without=dev --format=requirements.txt > .build/common_layer/requirements.txt
cdk deploy --require-approval=never &>../../deployment-logs/activity-service.log &
popd

Expand Down
9 changes: 9 additions & 0 deletions loadtest/Dockerfile-longrunning
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:22-alpine

WORKDIR /usr/app
COPY ./ /usr/app
RUN npm install -g artillery@latest
RUN npm install
RUN chmod +x start.sh

CMD ["./start.sh"]
15 changes: 15 additions & 0 deletions loadtest/docker-compose-long-running.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.8"

services:
loadtest:
restart: always
build:
context: .
dockerfile: Dockerfile-longrunning
environment:
- ENV=${ENV}
- PRODUCT_API_ENDPOINT=${PRODUCT_API_ENDPOINT}
- USER_API_ENDPOINT=${USER_API_ENDPOINT}
- ORDER_API_ENDPOINT=${ORDER_API_ENDPOINT}
- INVENTORY_API_ENDPOINT=${INVENTORY_API_ENDPOINT}
- LOYALTY_API_ENDPOINT=${LOYALTY_API_ENDPOINT}
2 changes: 0 additions & 2 deletions loadtest/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ module.exports = {
Math.random() * context.vars.products.length
);

console.log(context.vars.products[randomIndex]);

context.vars.OrderProducts = [context.vars.products[randomIndex].productId];

return done();
Expand Down
145 changes: 145 additions & 0 deletions loadtest/loadsimulator-low.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
config:
target: "https://"
http:
timeout: 60
processor: "generator.js"
phases:
# Arrival count is a fixed number of requests to be sent over the duration
# Over the course of 10 seconds, 2 requests will be sent
- duration: 10
arrivalCount: 2
- duration: 90
arrivalCount: 20
- duration: 120
arrivalCount: 5
- duration: 30
arrivalCount: 10
- duration: 10
arrivalCount: 10

scenarios:
- name: "User create order"
flow:
- function: "generateEmailAddress"
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/user"
headers:
Content-Type: "application/json"
json:
email_address: "{{ Email }}"
first_name: "Test"
last_name: "User"
password: "{{ Password }}"
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "{{ Email }}"
password: "{{ Password }}"
capture:
json: "$.data.token"
as: jwt
- get:
url: "{{ $processEnvironment.PRODUCT_API_ENDPOINT }}/product"
capture:
json: "$.data"
as: products
- function: setOrderProducts
- post:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders"
headers:
Content-Type: "application/json"
Authorization: "Bearer {{jwt}}"
json:
products: "{{ OrderProducts }}"
capture:
json: "$.data.orderId"
as: OrderId
- name: "Admin complete order"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- get:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders/confirmed"
headers:
Authorization: "Bearer {{adminJwt}}"
capture:
json: "$"
as: confirmedOrders
- function: getLatestConfirmedOrder
- post:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders/{{ ConfirmedOrderId }}/complete"
ifTrue: 'ConfirmedOrderId'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
orderId: "{{ ConfirmedOrderId }}"
userId: "{{ ConfirmedOrderUserId }}"
- name: "Admin re-stock products"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- get:
url: "{{ $processEnvironment.PRODUCT_API_ENDPOINT }}/product"
capture:
json: "$.data"
as: products
- function: setOutOfStockProductId
- get:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/inventory/{{ ProductId }}"
ifTrue: 'ProductId'
headers:
Authorization: "Bearer {{adminJwt}}"
capture:
json: "$.data.currentStockLevel"
as: currentStockLevel
- function: generateRestockAmount
- post:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/inventory"
ifTrue: 'ProductId'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
productId: "{{ProductId}}"
stockLevel: "{{NewStockLevel}}"
- name: "Admin create products"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- function: generateProductName
- post:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/product"
ifTrue: 'ProductName'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
name: "{{ProductName}}"
price: "{{Price}}"
2 changes: 2 additions & 0 deletions loadtest/loadsimulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ config:
timeout: 60
processor: "generator.js"
phases:
# Arrival count is a fixed number of requests to be sent over the duration
# Over the course of 10 seconds, 10 requests will be sent
- duration: 10
arrivalCount: 10
- duration: 30
Expand Down
139 changes: 139 additions & 0 deletions loadtest/loadsimulator_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
config:
target: "https://"
http:
timeout: 60
processor: "generator.js"
phases:
# Arrival count is a fixed number of requests to be sent over the duration
# Over the course of 10 seconds, 10 requests will be sent
- duration: 10
arrivalCount: 10
- duration: 30
arrivalCount: 10

scenarios:
- name: "User create order"
flow:
- function: "generateEmailAddress"
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/user"
headers:
Content-Type: "application/json"
json:
email_address: "{{ Email }}"
first_name: "Test"
last_name: "User"
password: "{{ Password }}"
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "{{ Email }}"
password: "{{ Password }}"
capture:
json: "$.data.token"
as: jwt
- get:
url: "{{ $processEnvironment.PRODUCT_API_ENDPOINT }}/product"
capture:
json: "$.data"
as: products
- function: setOrderProducts
- post:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders"
headers:
Content-Type: "application/json"
Authorization: "Bearer {{jwt}}"
json:
products: "{{ OrderProducts }}"
capture:
json: "$.data.orderId"
as: OrderId
- name: "Admin complete order"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- get:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders/confirmed"
headers:
Authorization: "Bearer {{adminJwt}}"
capture:
json: "$"
as: confirmedOrders
- function: getLatestConfirmedOrder
- post:
url: "{{ $processEnvironment.ORDER_API_ENDPOINT }}/orders/{{ ConfirmedOrderId }}/complete"
ifTrue: 'ConfirmedOrderId'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
orderId: "{{ ConfirmedOrderId }}"
userId: "{{ ConfirmedOrderUserId }}"
- name: "Admin re-stock products"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- get:
url: "{{ $processEnvironment.PRODUCT_API_ENDPOINT }}/product"
capture:
json: "$.data"
as: products
- function: setOutOfStockProductId
- get:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/inventory/{{ ProductId }}"
ifTrue: 'ProductId'
headers:
Authorization: "Bearer {{adminJwt}}"
capture:
json: "$.data.currentStockLevel"
as: currentStockLevel
- function: generateRestockAmount
- post:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/inventory"
ifTrue: 'ProductId'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
productId: "{{ProductId}}"
stockLevel: "{{NewStockLevel}}"
- name: "Admin create products"
flow:
- post:
url: "{{ $processEnvironment.USER_API_ENDPOINT }}/login"
headers:
Content-Type: "application/json"
json:
email_address: "[email protected]"
password: "Admin!23"
capture:
json: "$.data.token"
as: adminJwt
- function: generateProductName
- post:
url: "{{ $processEnvironment.INVENTORY_API_ENDPOINT }}/product"
ifTrue: 'ProductName'
headers:
Content-Type: "application/json"
Authorization: "Bearer {{adminJwt}}"
json:
name: "{{ProductName}}"
price: "{{Price}}"
Loading
Loading