Skip to content

Commit

Permalink
Merge pull request #8 from leylineL2/feat/add_request_time
Browse files Browse the repository at this point in the history
feat: add request time header
  • Loading branch information
soichirokodama authored Aug 22, 2024
2 parents c0196e6 + f9ce555 commit d501dc5
Show file tree
Hide file tree
Showing 18 changed files with 465 additions and 41 deletions.
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
FROM openjdk:8-jre
ENV WIREMOCK_VERSION 2.16.0
RUN mkdir -p /var/wiremock/lib/ \
&& wget https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/$WIREMOCK_VERSION/wiremock-standalone-$WIREMOCK_VERSION.jar \
-O /var/wiremock/lib/wiremock-standalone.jar
FROM wiremock/wiremock:3.8.0
COPY ./wiremock /home/wiremock
WORKDIR /home/wiremock
ENTRYPOINT ["java","-jar","/var/wiremock/lib/wiremock-standalone.jar"]
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ services:
build: .
ports:
- "8080:8080"
volumes:
- ./wiremock:/home/wiremock
31 changes: 29 additions & 2 deletions wiremock/mappings/private/assets/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -18,4 +45,4 @@
"status": 200,
"bodyFileName": "./private/assets/get.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/deposit/deposit_history_cc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -23,4 +50,4 @@
"status": 200,
"bodyFileName": "./private/deposit/deposit_history_cc.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/deposit/deposit_history_jpy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -23,4 +50,4 @@
"status": 200,
"bodyFileName": "./private/deposit/deposit_history_jpy.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/order/active_orders.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -18,4 +45,4 @@
"status": 200,
"bodyFileName": "./private/order/active_orders.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/order/cancel_order.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -26,4 +53,4 @@
"status": 200,
"bodyFileName": "./private/order/cancel_order.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/order/cancel_orders.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -26,4 +53,4 @@
"status": 200,
"bodyFileName": "./private/order/cancel_orders.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/order/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -23,4 +50,4 @@
"status": 200,
"bodyFileName": "./private/order/get.json"
}
}
}
31 changes: 29 additions & 2 deletions wiremock/mappings/private/order/orders_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@
"ACCESS-KEY": {
"matches": ".*"
},
"ACCESS-REQUEST-TIME": {
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-TIME-WINDOW": {
"or": [
{
"matches": "^(?:[1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|60000)$"
},
{
"absent": true
}
]
},
"ACCESS-NONCE": {
"matches": "[0-9]+"
"or": [
{
"matches": "[0-9]+"
},
{
"absent": true
}
]
},
"ACCESS-SIGNATURE": {
"matches": ".*"
Expand All @@ -23,4 +50,4 @@
"status": 200,
"bodyFileName": "./private/order/orders_info.json"
}
}
}
Loading

0 comments on commit d501dc5

Please sign in to comment.