diff --git a/travis/integration_tests.sh b/.github/bin/integration_tests.sh
similarity index 100%
rename from travis/integration_tests.sh
rename to .github/bin/integration_tests.sh
diff --git a/.github/bin/waitHttp.sh b/.github/bin/waitHttp.sh
new file mode 100755
index 00000000..88f85737
--- /dev/null
+++ b/.github/bin/waitHttp.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+http_code=100
+while [ "$http_code" != "200" ]
+do
+ sleep 5
+ http_code=`curl --write-out %{http_code} --silent --output /dev/null "$1"`
+ echo "$http_code";
+done
+
+
diff --git a/.github/workflows/elastic.yml b/.github/workflows/elastic.yml
new file mode 100644
index 00000000..57e663dd
--- /dev/null
+++ b/.github/workflows/elastic.yml
@@ -0,0 +1,23 @@
+name: Elastic
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v2
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+ cache: maven
+ - name: Starting ElasticSearch
+ run: docker compose -f docker/sas-elastic/compose.yaml --project-directory . up -d elastic
+ - name: Wait for Elastic to start
+ run: .github/bin/waitHttp.sh "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=50s"
+ - name: Run Tests
+ run: export "config=elastic.properties" && mvn test
+
diff --git a/.github/workflows/jena.yml b/.github/workflows/jena.yml
new file mode 100644
index 00000000..a9aa9bed
--- /dev/null
+++ b/.github/workflows/jena.yml
@@ -0,0 +1,22 @@
+name: Jena
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v2
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+ cache: maven
+
+ - name: Selecting Jena config
+ run: export "config=Jena.properties"
+
+ - name: Run Tests
+ run: mvn test
diff --git a/.github/workflows/solr-cloud.yml b/.github/workflows/solr-cloud.yml
new file mode 100644
index 00000000..b8422c02
--- /dev/null
+++ b/.github/workflows/solr-cloud.yml
@@ -0,0 +1,21 @@
+name: SOLR Cloud
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Starting SOLR
+ run: docker compose -f docker/sas-solr-cloud/compose.yaml --project-directory . up -d
+
+ - name: Wait for SOLR to start
+ run: docker exec -t solr1 /opt/docker-solr/scripts/wait-for-solr.sh --max-attempts 10 --wait-seconds 5 --solr-url http://0.0.0.0:8983/
+
+ # Due to the way docker-compose and SOLR works we can't access the SOLR cloud
+ # from this machine. Instead we have to run the test within the cluster
+ - name: Run Tests
+ run: docker exec --workdir /usr/src/sas simpleannotationserver_web_1 /usr/bin/mvn -q test
diff --git a/.github/workflows/solr.yml b/.github/workflows/solr.yml
new file mode 100644
index 00000000..1125511d
--- /dev/null
+++ b/.github/workflows/solr.yml
@@ -0,0 +1,27 @@
+name: SOLR
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v2
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+ cache: maven
+ - name: Starting SOLR
+ run: mkdir solr-data && chmod 777 solr-data && docker compose -f docker/sas-solr/compose.yaml --project-directory . up -d solr
+
+ - name: checking docker
+ run: docker ps && docker logs sas_solr
+
+ - name: Wait for SOLR to start
+ run: docker exec -t sas_solr /opt/docker-solr/scripts/wait-for-solr.sh --max-attempts 10 --wait-seconds 10 --solr-url http://0.0.0.0:8983/
+
+ - name: Run Tests
+ run: export "config=solr.properties" && mvn test
diff --git a/.gitignore b/.gitignore
index 3d69a653..c0f2ff03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,10 @@ src/main/webapp/demo.html
/data
cache
index-2.6.1.html
-src/main/webapp/stats
+src/main/webapp/stats/*.json
.aws-credentials
+auth.json
+*auth.json
+node
+node_modules
+solr-data
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 63417712..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-dist: xenial
-language: java
-jdk:
- - openjdk11
-script: chmod 755 ./travis/integration_tests.sh && ./travis/integration_tests.sh
diff --git a/buildspec.yml b/buildspec.yml
index 0841a873..60d873fb 100644
--- a/buildspec.yml
+++ b/buildspec.yml
@@ -6,6 +6,8 @@ phases:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
+ - echo Logging in to Docker Hub...
+ - echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin
- IMAGE_NAME="sas"
- REPOSITORY_URI=082101253860.dkr.ecr.eu-west-2.amazonaws.com/sas
- IMAGE_TAG=prod_$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
@@ -14,13 +16,13 @@ phases:
- echo Build started on `date`
- echo Building the Docker image...
- echo Image_tag $IMAGE_TAG
- - docker build -t $REPOSITORY_URI:$IMAGE_TAG -f docker/sas-tomcat/Dockerfile .
- - docker tag $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:latest
+ - docker build --build-arg AUTH_JSON_LOCATION=$AUTH_JSON_LOCATION --build-arg AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION --build-arg AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI -t $REPOSITORY_URI:$IMAGE_TAG -t $REPOSITORY_URI:latest -f docker/sas-auth/Dockerfile .
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- - docker push $REPOSITORY_URI
+ - docker push $REPOSITORY_URI:latest
+ - docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"SAS","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
artifacts:
diff --git a/doc/Auth.md b/doc/Auth.md
new file mode 100644
index 00000000..ab559e47
--- /dev/null
+++ b/doc/Auth.md
@@ -0,0 +1,143 @@
+# Authentication
+
+The SimpleAnnotationServer now supports Authentication through OAuth. This allows users to login using Google, GitHub or other OAuth provider and to work on a private workspace of Annotations, Manifests and Collections.
+
+## Configuration
+
+The presence of a file called `auth.json` in the `src/main/webapp/WEB-INF` is enough for SAS to know that it should use authentication for all requests. The `auth.json` file has settings for OAuth providers and should be kept secret and outside of GitHub. An example configuration for Google is shown below:
+
+```
+[{
+ "id":"google",
+ "class": "com.github.scribejava.apis.GoogleApi20",
+ "clientId": "**google_client_id**",
+ "clientSecret": "**google_client_secret",
+ "scope": "profile email",
+ "additionalParam": {
+ "access_type": "offline"
+ },
+ "button": {
+ "logo": "/images/GoogleLogo.svg",
+ "text": "Sign in with Google"
+ },
+ "userMapping": {
+ "endpoint": "https://www.googleapis.com/oauth2/v3/userinfo",
+ "responseKeys": {
+ "id":"sub",
+ "name": "name",
+ "email": "email",
+ "pic": "picture"
+ }
+ }
+}]
+```
+
+The file is split into three sections; OAuth settings, button config and userMappings and details for each section can be seen below. To offer multiple login options it is possible to add extra configs to this file as the root of the JSON is a list.
+
+### OAuth Settings
+
+The OAuth settings from above are copied below for convenience:
+
+```
+"id":"google",
+"class": "com.github.scribejava.apis.GoogleApi20",
+"clientId": "**google_client_id**",
+"clientSecret": "**google_client_secret",
+"scope": "profile email",
+"additionalParam": {
+ "access_type": "offline"
+},
+```
+
+The files are:
+
+ * __id__ this should be unique in the file and be used to identify the authentication method
+ * __class__ this is the [ScribeJava](https://github.com/scribejava/scribejava) OAuth library class which implements this authentication method. The ScribeJava github site gives examples with lots of different OAuth providers.
+ * __clientId__ and __clientSecret__ these are generated by Google and you can apply for a set of keys by going to the [Google Developer Console](https://console.developers.google.com/apis/credentials). When you apply for keys you will need to add a Authorized redirect URI to the SAS system. This is the URL google will return the user if they authenticated correctly. The redirect URI should be:
+
+https://example.com/login-callback
+
+where example.com is the public domain name you are using to host SAS.
+
+ * __scope__ this is the information SAS is asking the user to give permission for. To find out what is required for your OAuth provider check the ScribeJava examples.
+ * __additionalParam__ some OAuth providers also require extra parameters. Again check ScribeJava to see if this is required.
+
+### Button config
+When you login to SAS it will present you with a login page where users are asked to choose which login service they would like to register with. The button config allows customisation of the logo and text that is offered to the user for this authentication method:
+
+```
+"button": {
+ "logo": "/images/GoogleLogo.svg",
+ "text": "Sign in with Google"
+},
+```
+
+### User Mapping
+Once a user has been authenticated then SAS will request the name, email and profile picture from the OAuth provider. This is usually done using a standard API that returns a JSON list of keys. The Key mapping configuration maps the OAuth User JSON to SAS's users.
+
+```
+"userMapping": {
+ "endpoint": "https://www.googleapis.com/oauth2/v3/userinfo",
+ "responseKeys": {
+ "id":"sub",
+ "name": "name",
+ "email": "email",
+ "pic": "picture"
+ }
+}
+```
+
+## Extra customisation
+
+As well as the general configuration above its also possible to customise the authentication in the following ways.
+
+
+
+## Deployment with Docker
+
+If you are working with SAS in the cloud you will need to make sure the that the auth.json doesn't end up in GitHub where it will be public. There is an example [Dockerfile](../docker/sas-auth/Dockerfile) in the sas-auth directory which will work with a `auth.json` held in an Amazon S3 bucket. To get this to work you will need to ensure the Code Pipeline role has the following permissions:
+
+
+Codepipeline Service role to access s3:
+
+Build project -> build details -> Service role ARN
+
+Ensure ROLE has this:
+```
+{
+ "Action": [
+ "s3:GetObject",
+ "s3:GetObjectVersion",
+ "s3:GetBucketVersioning"
+ ],
+ "Resource": [
+ "arn:aws:s3:::sasconfig*"
+ ],
+ "Effect": "Allow"
+},
+{
+ "Effect": "Allow",
+ "Action": [
+ "kms:Decrypt",
+ "kms:GenerateDataKey",
+ "kms:GenerateDataKeyWithoutPlaintext",
+ "kms:GenerateDataKeyPairWithoutPlaintext",
+ "ssm:GetParameters",
+ "kms:GenerateDataKeyPair",
+ "ssm:GetParameter"
+ ],
+ "Resource": [
+ "arn:aws:kms:$REGION:$AWS_ACCOUNT_ID:key/$ENCRYPT_KEY",
+ "arn:aws:ssm:$REGION:$AWS_ACCOUNT_ID:parameter/$PARAM_KEYS/*"
+ ]
+}
+```
+
+To find the relevant service role you can navigate to your Code Builder project where you can see the history of your build. At the top there is a tab called 'Build Details'. Click this then scroll down until you see a clickable link for the "Service role".
+
+For your configuration you to will need to change `$REGION`, `$AWS_ACCOUNT_ID`, `$ENCRYPT_KEY` and $PARAM_KEYS to fit your AWS account details. To setup the required parameters there is a great write up here:
+
+https://medium.com/rockedscience/fixing-docker-hub-rate-limiting-errors-in-ci-cd-pipelines-ea3c80017acb
+
+## Migrating from previous versions of SAS
+SAS previously hasn't had the concept of users or Authentication so this version will be a breaking change and any annotations created using previous versions of SAS will no longer be accessible because they are not associated with a user. Ensure you have backed up any annotations you would like to keep and it is advisable to use a new ElasticSearch or SOLR index to run this version of SAS.
diff --git a/docker/sas-auth/Dockerfile b/docker/sas-auth/Dockerfile
new file mode 100644
index 00000000..23a32815
--- /dev/null
+++ b/docker/sas-auth/Dockerfile
@@ -0,0 +1,28 @@
+# build stage
+FROM maven:3-jdk-11 AS buildstage
+WORKDIR /usr/src/sas
+COPY . /usr/src/sas
+ARG MVN_ARGS="-DskipTests"
+# build SAS using maven
+RUN mvn $MVN_ARGS package
+
+# runnable container stage
+FROM tomcat:9-jre11 AS runstage
+ARG AWS_DEFAULT_REGION
+ARG AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
+ARG AUTH_JSON_LOCATION
+# remove tomcat default webapps and create data directory
+RUN rm -rf /usr/local/tomcat/webapps/*
+# copy SAS from build image
+COPY --from=buildstage /usr/src/sas/target/simpleAnnotationStore /usr/local/tomcat/webapps/ROOT
+# copy properties
+COPY docker/sas-auth/sas.properties /usr/local/tomcat/webapps/ROOT/WEB-INF
+
+# Download auth config
+# Install the AWS CLI
+RUN apt-get update && \
+ apt-get -y install awscli
+RUN aws --region eu-west-2 s3 cp $AUTH_JSON_LOCATION /usr/local/tomcat/webapps/ROOT/WEB-INF/
+# For testing locally:
+#COPY docker/sas-auth/auth.json /usr/local/tomcat/webapps/ROOT/WEB-INF/
+# use default port and entrypoint
diff --git a/docker/sas-auth/compose.yaml b/docker/sas-auth/compose.yaml
new file mode 100644
index 00000000..db0026c0
--- /dev/null
+++ b/docker/sas-auth/compose.yaml
@@ -0,0 +1,20 @@
+version: '3'
+services:
+ web:
+ container_name: sas
+ build:
+ context: .
+ dockerfile: docker/sas-auth/Dockerfile
+ ports:
+ - "8888:8080"
+ elastic:
+ image: "elasticsearch:7.8.1"
+ container_name: elasticsearch
+ environment:
+ - discovery.type=single-node
+ ulimits:
+ memlock:
+ soft: -1
+ hard: -1
+ ports:
+ - 9200:9200
diff --git a/docker/sas-auth/sas.properties b/docker/sas-auth/sas.properties
new file mode 100644
index 00000000..e875b597
--- /dev/null
+++ b/docker/sas-auth/sas.properties
@@ -0,0 +1,36 @@
+# Generic properties
+# ==================
+
+# Uncomment this if you are behind a proxy or want a public URI
+# baseURI=http://dev.llgc.org.uk/annotation/
+
+# Uncomment this if you would like to use an encoder which will work on
+# the annotation before its stored in the triplestore
+# encoder=uk.org.llgc.annotation.store.encoders.BookOfPeaceEncode
+
+# if you are using Mirador versions greater than 2.1.4 then you need to uncomment the following
+# as the annotation structure changed between versions
+#encoder=uk.org.llgc.annotation.store.encoders.Mirador214
+
+# Store configuration
+# ==================
+
+# Uncomment this if you would like to use Jena as a backend
+#store=jena
+#data_dir=/annotation-data
+
+# Uncomment the following if you want to use Sesame
+# store=sesame
+# repo_url=http://localhost:8080/openrdf-sesame/repositories/test-anno
+
+# Uncomment the following if you want to use SOLR cores
+#store=solr
+#solr_connection=http://solr:8983/solr/annotations
+
+# Uncomment the following if you want to use SOLR collections (Cloud)
+#store=solr-cloud
+#solr_connection=http://solr:8983/solr,http://solr:7574/solr
+#solr_collection=annotations
+
+store=elastic
+elastic_connection=http://elasticsearch:9200/annotations
diff --git a/docker/sas-elastic/Dockerfile b/docker/sas-elastic/Dockerfile
index 25fc81a6..e1b87d8a 100644
--- a/docker/sas-elastic/Dockerfile
+++ b/docker/sas-elastic/Dockerfile
@@ -9,11 +9,11 @@ RUN mvn $MVN_ARGS package
# runnable container stage
FROM tomcat:9-jre11 AS runstage
# remove tomcat default webapps and create data directory
-RUN rm -r /usr/local/tomcat/webapps/* && \
+RUN rm -rf /usr/local/tomcat/webapps/* && \
mkdir /annotation-data
# copy SAS from build image
COPY --from=buildstage /usr/src/sas/target/simpleAnnotationStore /usr/local/tomcat/webapps/ROOT
# copy properties
-COPY docker/sas-tomcat/sas.properties /usr/local/tomcat/webapps/ROOT/WEB-INF
+COPY docker/sas-elastic/sas.properties /usr/local/tomcat/webapps/ROOT/WEB-INF
# use default port and entrypoint
diff --git a/docker/sas-elastic/docker-compose.yml b/docker/sas-elastic/compose.yaml
similarity index 100%
rename from docker/sas-elastic/docker-compose.yml
rename to docker/sas-elastic/compose.yaml
diff --git a/docker/sas-elastic/sas.properties b/docker/sas-elastic/sas.properties
index 7f9cf125..b9ac0d3a 100644
--- a/docker/sas-elastic/sas.properties
+++ b/docker/sas-elastic/sas.properties
@@ -24,8 +24,10 @@
# repo_url=http://localhost:8080/openrdf-sesame/repositories/test-anno
# Uncomment the following if you want to use SOLR cores
-store=solr
-solr_connection=http://solr:8983/solr/annotations
+store=elastic
+elastic_connection=http://elasticsearch:9200/annotations
+
+admin=glen.robson@gmail.com
# Uncomment the following if you want to use SOLR collections (Cloud)
#store=solr-cloud
diff --git a/docker/sas-solr-cloud/Dockerfile b/docker/sas-solr-cloud/Dockerfile
index 84d333bc..9461320b 100644
--- a/docker/sas-solr-cloud/Dockerfile
+++ b/docker/sas-solr-cloud/Dockerfile
@@ -2,14 +2,14 @@
FROM maven:3-jdk-11 AS buildstage
WORKDIR /usr/src/sas
COPY . /usr/src/sas
-ARG MVN_ARGS="-DskipTests"
+ARG MVN_ARGS="-DskipTests -q"
# build SAS using maven
RUN mvn $MVN_ARGS package
# runnable container stage
-FROM tomcat:9-jre11 AS runstage
+FROM tomcat:9-jdk11-temurin AS runstage
# remove tomcat default webapps and create data directory
-RUN rm -r /usr/local/tomcat/webapps/*
+RUN rm -rf /usr/local/tomcat/webapps/*
# copy SAS from build image
COPY --from=buildstage /usr/src/sas/target/simpleAnnotationStore /usr/local/tomcat/webapps/ROOT
# copy properties
@@ -17,7 +17,7 @@ COPY docker/sas-solr-cloud/sas.properties /usr/local/tomcat/webapps/ROOT/WEB-INF
# Used for testing:
COPY . /usr/src/sas
-RUN apt-get update && apt-get -y install maven
+RUN apt-get update && apt-get -y install maven npm
COPY docker/sas-solr-cloud/sas.properties /usr/src/sas/src/test/resources/test.properties
# use default port and entrypoint
diff --git a/docker/sas-solr-cloud/docker-compose.yml b/docker/sas-solr-cloud/compose.yaml
similarity index 100%
rename from docker/sas-solr-cloud/docker-compose.yml
rename to docker/sas-solr-cloud/compose.yaml
diff --git a/docker/sas-solr/docker-compose.yml b/docker/sas-solr/compose.yaml
similarity index 68%
rename from docker/sas-solr/docker-compose.yml
rename to docker/sas-solr/compose.yaml
index 086430c8..4182d100 100644
--- a/docker/sas-solr/docker-compose.yml
+++ b/docker/sas-solr/compose.yaml
@@ -9,12 +9,13 @@ services:
- "8888:8080"
solr:
container_name: sas_solr
- image: "solr:latest"
+ image: "solr:8"
ports:
- "8983:8983"
volumes:
- "./src/main/resources/solr:/tmp/config:ro"
+ - "./solr-data:/var/solr/data"
entrypoint:
- bash
- "-c"
- - "precreate-core testannotations /tmp/config; precreate-core annotations /tmp/config; exec solr -f"
+ - "solr-precreate testannotations /tmp/config; solr-precreate annotations /tmp/config; exec solr -f"
diff --git a/docker/sas-tomcat/Dockerfile b/docker/sas-tomcat/Dockerfile
index 25fc81a6..97020f0f 100644
--- a/docker/sas-tomcat/Dockerfile
+++ b/docker/sas-tomcat/Dockerfile
@@ -9,7 +9,7 @@ RUN mvn $MVN_ARGS package
# runnable container stage
FROM tomcat:9-jre11 AS runstage
# remove tomcat default webapps and create data directory
-RUN rm -r /usr/local/tomcat/webapps/* && \
+RUN rm -rf /usr/local/tomcat/webapps/* && \
mkdir /annotation-data
# copy SAS from build image
COPY --from=buildstage /usr/src/sas/target/simpleAnnotationStore /usr/local/tomcat/webapps/ROOT
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 00000000..2b4b3681
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,110 @@
+{
+ "requires": true,
+ "lockfileVersion": 1,
+ "dependencies": {
+ "balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
+ },
+ "jasmine": {
+ "version": "3.9.0",
+ "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.9.0.tgz",
+ "integrity": "sha512-JgtzteG7xnqZZ51fg7N2/wiQmXon09szkALcRMTgCMX4u/m17gVJFjObnvw5FXkZOWuweHPaPRVB6DI2uN0wVA==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.6",
+ "jasmine-core": "~3.9.0"
+ }
+ },
+ "jasmine-core": {
+ "version": "3.9.0",
+ "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.9.0.tgz",
+ "integrity": "sha512-Tv3kVbPCGVrjsnHBZ38NsPU3sDOtNa0XmbG2baiyJqdb5/SPpDO6GVwJYtUryl6KB4q1Ssckwg612ES9Z0dreQ==",
+ "dev": true
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..156e6a0a
--- /dev/null
+++ b/package.json
@@ -0,0 +1,8 @@
+{
+ "scripts": {
+ "test": "jasmine --config=src/test/javascript/jasmine.json"
+ },
+ "devDependencies": {
+ "jasmine": "^3.9.0"
+ }
+}
diff --git a/pom.xml b/pom.xml
index 9eb8ca9a..7f3a0d8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,17 +43,17 @@
org.apache.jena
jena-core
- 3.16.0
+ 4.3.1
org.apache.jena
jena-tdb
- 3.16.0
+ 4.3.1
org.apache.jena
jena-arq
- 3.16.0
+ 4.3.1
org.apache.jena
@@ -68,12 +68,17 @@
commons-codec
commons-codec
- 1.14
+ 1.15
+
+
+ commons-fileupload
+ commons-fileupload
+ 1.4
com.github.jsonld-java
jsonld-java
- 0.13.0
+ 0.13.4
org.apache.httpcomponents
@@ -88,7 +93,7 @@
org.jdom
jdom2
- 2.0.6
+ 2.0.6.1
jaxen
@@ -103,12 +108,12 @@
com.fasterxml.jackson.core
jackson-core
- 2.11.1
+ 2.13.0
com.fasterxml.jackson.core
jackson-databind
- 2.11.1
+ 2.13.0
org.openrdf.sesame
@@ -123,7 +128,7 @@
org.apache.httpcomponents
httpclient
- 4.5.12
+ 4.5.13
commons-logging
@@ -144,45 +149,58 @@
org.apache.logging.log4j
log4j-api
- 2.13.3
+ 2.16.0
org.apache.logging.log4j
log4j-core
- 2.13.3
+ 2.16.0
org.apache.logging.log4j
log4j-slf4j-impl
- 2.13.3
+ 2.16.0
org.apache.solr
solr-solrj
- 8.6.0
+ 8.11.0
-
- org.elasticsearch
- elasticsearch
- 7.7.1
-
org.elasticsearch.client
elasticsearch-rest-high-level-client
- 7.7.1
+ 7.13.4
com.amazonaws
aws-java-sdk-core
- 1.11.839
+ 1.12.129
+
+
+
+ org.mockito
+ mockito-core
+ 4.1.0
+ test
junit
junit
- 4.13
+ 4.13.2
test
+
+
+ com.github.scribejava
+ scribejava-apis
+ 8.3.1
+
+
+ org.springframework.security
+ spring-security-core
+ 5.6.0
+
simpleAnnotationStore
@@ -263,6 +281,57 @@
+
+ com.github.eirslett
+ frontend-maven-plugin
+ 1.10.4
+
+
+
+ install node and npm
+
+ install-node-and-npm
+
+ generate-resources
+
+ v14.15.1
+ 6.14.8
+
+
+
+ npm install
+
+ npm
+
+
+
+ install
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 1.3.2
+
+
+ npm run test (test)
+
+ exec
+
+ test
+
+ npm
+
+ run
+ test
+
+ ${skipTests}
+
+
+
+
diff --git a/runDocker.sh b/runDocker.sh
index 129b6468..efd829b1 100755
--- a/runDocker.sh
+++ b/runDocker.sh
@@ -1,7 +1,7 @@
#!/bin/bash
if [ $# -eq 0 ]; then
- echo "What backend do you want to use? Jena / Solr / Cloud"
+ echo "What backend do you want to use? Jena / Solr / Cloud / Elastic"
read backend
else
backend="$1"
@@ -19,6 +19,9 @@ elif [[ "$backend" =~ [Cc]loud ]]; then
elif [[ "$backend" =~ [Ee]lastic ]]; then
echo "Running SAS with Elastic Cloud on port 8888"
docker-compose -f docker/sas-elastic/docker-compose.yml --project-directory . up
+elif [[ "$backend" =~ [Aa]uth ]]; then
+ echo "Running SAS with Elastic Cloud on port 8888 with Auth enabled"
+ docker-compose -f docker/sas-auth/docker-compose.yml --project-directory . up
else
echo "I don't recognise '$backend'. Options are Jena / Solr / Cloud"
fi
diff --git a/src/main/java/uk/org/llgc/annotation/store/AnnotationUtils.java b/src/main/java/uk/org/llgc/annotation/store/AnnotationUtils.java
index bcc915c4..a30541b2 100644
--- a/src/main/java/uk/org/llgc/annotation/store/AnnotationUtils.java
+++ b/src/main/java/uk/org/llgc/annotation/store/AnnotationUtils.java
@@ -88,12 +88,7 @@ public List