Skip to content

Commit

Permalink
Merge branch 'master' into CIRCSTORE-377
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrVidinieiev authored Sep 13, 2023
2 parents d3d46c1 + 964e629 commit c77c5db
Show file tree
Hide file tree
Showing 70 changed files with 2,616 additions and 294 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM folioci/alpine-jre-openjdk11:latest
FROM folioci/alpine-jre-openjdk17:latest

# Install latest patch versions of packages: https://pythonspeed.com/articles/security-updates-in-docker/
USER root
RUN apk upgrade --no-cache
USER folio

ENV VERTICLE_FILE mod-circulation-storage-fat.jar

Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ buildMvn {
publishModDescriptor = 'yes'
mvnDeploy = 'yes'
doKubeDeploy = true
buildNode = 'jenkins-agent-java11'
buildNode = 'jenkins-agent-java17'

doDocker = {
buildJavaDocker {
publishMaster = 'yes'
healthChk = 'yes'
healthChkCmd = 'curl -sS --fail -o /dev/null http://localhost:8081/apidocs/ || exit 1'
healthChkCmd = 'wget --no-verbose --tries=1 --spider http://localhost:8081/admin/health || exit 1'
}
}
}
Expand Down
62 changes: 60 additions & 2 deletions descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,18 @@
}, {
"methods": ["POST"],
"pathPattern": "/request-policy-storage/request-policies",
"modulePermissions": [
"inventory-storage.service-points.item.get",
"inventory-storage.service-points.collection.get"
],
"permissionsRequired": ["circulation-storage.request-policies.item.post"]
}, {
"methods": ["PUT"],
"pathPattern": "/request-policy-storage/request-policies/{id}",
"modulePermissions": [
"inventory-storage.service-points.item.get",
"inventory-storage.service-points.collection.get"
],
"permissionsRequired": ["circulation-storage.request-policies.item.put"]
}, {
"methods": ["DELETE"],
Expand All @@ -333,7 +341,7 @@
},
{
"id": "actual-cost-record-storage",
"version": "0.7",
"version": "0.8",
"handlers": [
{
"methods": ["GET"],
Expand Down Expand Up @@ -569,6 +577,32 @@
}
]
},
{
"id": "checkout-lock-storage",
"version": "0.1",
"handlers": [
{
"methods": ["GET"],
"pathPattern": "/check-out-lock-storage",
"permissionsRequired": ["checkout-lock-storage.checkout-locks.collection.get"]
},
{
"methods": ["GET"],
"pathPattern": "/check-out-lock-storage/{lockId}",
"permissionsRequired": ["checkout-lock-storage.checkout-locks.item.get"]
},
{
"methods": ["POST"],
"pathPattern": "/check-out-lock-storage",
"permissionsRequired": ["checkout-lock-storage.checkout-locks.item.post"]
},
{
"methods": ["DELETE"],
"pathPattern": "/check-out-lock-storage/{lockId}",
"permissionsRequired": ["checkout-lock-storage.checkout-locks.item.delete"]
}
]
},
{
"id": "_timer",
"version": "1.0",
Expand Down Expand Up @@ -1023,7 +1057,11 @@
"actual-cost-record-storage.actual-cost-records.item.get",
"actual-cost-record-storage.actual-cost-records.item.post",
"actual-cost-record-storage.actual-cost-records.item.put",
"actual-cost-record-storage.actual-cost-records.item.delete"
"actual-cost-record-storage.actual-cost-records.item.delete",
"checkout-lock-storage.checkout-locks.item.post",
"checkout-lock-storage.checkout-locks.item.delete",
"checkout-lock-storage.checkout-locks.item.get",
"checkout-lock-storage.checkout-locks.collection.get"
]
},
{
Expand Down Expand Up @@ -1105,6 +1143,26 @@
"permissionName": "actual-cost-record-storage.actual-cost-records.item.delete",
"displayName": "Circulation storage - delete actual cost record",
"description": "Delete actual cost record"
},
{
"permissionName": "checkout-lock-storage.checkout-locks.item.post",
"displayName": "Circulation storage - create lock",
"description": "create lock for the userId"
},
{
"permissionName": "checkout-lock-storage.checkout-locks.item.delete",
"displayName": "Circulation storage - delete lock",
"description": "Delete lock for the userId"
},
{
"permissionName": "checkout-lock-storage.checkout-locks.item.get",
"displayName": "Circulation storage - get lock",
"description": "get lock for the userId"
},
{
"permissionName": "checkout-lock-storage.checkout-locks.collection.get",
"displayName": "Circulation storage - get locks",
"description": "get locks"
}
],
"launchDescriptor": {
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<version>1.18.28</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -236,7 +236,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
<release>17</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -284,13 +284,13 @@
</configuration>
</plugin>
<plugin>
<groupId>com.nickwongdev</groupId>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.12.6</version>
<version>1.13.1</version>
<configuration>
<verbose>true</verbose>
<showWeaveInfo>false</showWeaveInfo>
<complianceLevel>11</complianceLevel>
<release>17</release>
<includes>
<include>**/impl/*.java</include>
<include>**/*.aj</include>
Expand All @@ -316,12 +316,12 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.6</version>
<version>1.9.19</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.6</version>
<version>1.9.19</version>
</dependency>
</dependencies>
</plugin>
Expand Down
1 change: 0 additions & 1 deletion ramls/actual-cost-record.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
"required": [
"lossType",
"lossDate",
"expirationDate",
"user",
"loan",
"item",
Expand Down
13 changes: 13 additions & 0 deletions ramls/allowed-service-point-ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": ["array", "null"],
"description": "List of allowed pickup service point IDs",
"default": null,
"minItems": 1,
"uniqueItems": true,
"items": {
"description": "UUID string",
"type": "string",
"$ref": "raml-util/schemas/uuid.schema"
}
}
1 change: 1 addition & 0 deletions ramls/anonymize-storage-loans-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
},
"notAnonymizedLoans": {
"description": "Not anonymized loan IDs",
"type": "array",
"items": {
"description": "Collection of loans",
Expand Down
5 changes: 5 additions & 0 deletions ramls/cancellation-reason.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request cancellation reason",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"description": "Reason name",
"type": "string"
},
"description" : {
"description": "Internal reason description",
"type": "string"
},
"publicDescription": {
"description": "Public reason description",
"type": "string"
},
"requiresAdditionalInformation": {
"description": "Flag that indicates whether reason requires additional information",
"type": "boolean"
},
"source": {
Expand Down
15 changes: 15 additions & 0 deletions ramls/checkout-lock-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Checkout Lock",
"properties": {
"userId": {
"description": "ID of the patron the lock is created for",
"$ref": "raml-util/schemas/uuid.schema"
},
"ttlMs": {
"description": "Time to live for lock object",
"type": "integer"
}
}
}
98 changes: 98 additions & 0 deletions ramls/checkout-lock-storage.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#%RAML 1.0
title: Checkout Lock Storage
version: v1.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost:9130

documentation:
- title: Checkout Lock API
content: <b>Storage for checkout lock</b>

types:
checkout-lock: !include checkout-lock.json
checkout-locks: !include checkout-locks.json
checkout-lock-request: !include checkout-lock-request.json
errors: !include raml-util/schemas/errors.schema

traits:
validate: !include raml-util/traits/validation.raml

/check-out-lock-storage:
displayName: Checkout lock storage
get:
description: "Retrieve a list of checkout lock items"
queryParameters:
userId:
description: Filter locks by user ID.
type: string
offset:
description: The number of items to skip in the result set.
type: integer
limit:
description: The maximum number of locks to return.
type: integer
responses:
200:
description: "Returns a list of checkout lock items"
body:
application/json:
type: checkout-locks
422:
description: "Invalid Parameters"
body:
text/plain:
example: "Invalid Parameters"
post:
is: [validate]
description: "Create a lock for the given userid"
body:
application/json:
type: checkout-lock-request
example: !include examples/checkout-lock-request.json
responses:
201:
description: "Checkout lock is created"
body:
application/json:
type: checkout-lock
example: !include examples/checkout-lock.json
400:
description: "Bad Request"
body:
text/plain:
500:
description: "Internal server error"
body:
text/plain:
example: "Internal server error"
503:
description: "Failed to create lock for patron {userId}"
body:
text/plain:
example: "Failed to create lock for patron "
/{lockId}:
get:
description: "Get checkout lock"
responses:
200:
description: "Returns item with a given ID"
body:
application/json:
type: checkout-lock
example: !include examples/checkout-lock.json
400:
description: "Bad Request"
body:
text/plain:
404:
description: "Item with a given ID not found"
delete:
description: "Delete checkout lock"
responses:
204:
description: "Item deleted successfully"
500:
description: "Internal Server error"
body:
text/plain:
example: "Internal server error"
20 changes: 20 additions & 0 deletions ramls/checkout-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Checkout Lock",
"properties": {
"id": {
"description": "ID of the lock",
"$ref": "raml-util/schemas/uuid.schema"
},
"userId": {
"description": "ID of the patron the lock is created for",
"$ref": "raml-util/schemas/uuid.schema"
},
"creationDate": {
"description": "Date and time of lock creation",
"type": "string",
"format": "date-time"
}
}
}
23 changes: 23 additions & 0 deletions ramls/checkout-locks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of checkoutLocks",
"type": "object",
"properties": {
"checkoutLocks": {
"description": "List of checkoutLocks",
"id": "checkoutLocks",
"type": "array",
"items": {
"type": "object",
"$ref": "checkout-lock.json"
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"checkoutLocks",
"totalRecords"
]
}
Loading

0 comments on commit c77c5db

Please sign in to comment.