Skip to content

Commit 6ba959d

Browse files
author
Andrea Splendiani
committed
Initital release for FAIRplus
1 parent e13c9d3 commit 6ba959d

560 files changed

Lines changed: 74363 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
## Description
3+
4+
OpenRefine's extension to add authentication protocols for HTTP/HTTPS request. Compatible with OpenRefine 3.3 supporting:
5+
6+
* Custom applications with JWT tokens
7+
* RDF extension with basic authentication for AllegroGraph
8+
9+
10+
## Requirements
11+
12+
* Java 1.8.*
13+
* Maven 3.* (mvn)
14+
15+
## Compile
16+
17+
* Execute `mvn package assembly:single`
18+
* Extension will be located into `target/openrefine-authenticator-0.3.zip`
19+
20+
## Installation
21+
22+
* Extract the `openrefine-authenticator-0.3.zip` into the OpenRefine folder `webapp/extensions`
23+
* Run OpenRefine and set up your credentials for all HTTP/HTTPS request
24+
25+
26+
## Run demo
27+
28+
* Add a vhost to your pc
29+
* Linux examples: `sudo nano /etc/hosts` and add to then end: `127.0.0.1 languages.local.com`
30+
* Move to `demo` folder
31+
* Execute `docker-compose build`
32+
* Run the two containers with `docker-compose up -d`. This will start two containers
33+
* OpenRefine in http://localhost:3333
34+
* LoginApp in http://localhost:8888 with two endpoints that you can test
35+
* ```
36+
curl --location --request POST 'http://languages.local.com:8080/api/login' \
37+
--header 'Content-Type: application/json' \
38+
--data-raw '{
39+
"username": "admin",
40+
"password": "password",
41+
"grant_type": "password"
42+
}'```
43+
44+
* ```
45+
curl --location --request GET 'http://localhost:8080/api/languages' \
46+
--header 'Authorization: Bearer TOKEN_FROM_PREVIOUS_REQUEST''```
47+
48+
* Open in a browser http://127.0.0.1:3333/ then follow the video https://www.loom.com/share/7065806b1fd14e2b83f4412b2829bbd0
49+
* Credentials for http://languages.local.com:8080/api/login:
50+
* Username: `admin`
51+
* Password: `password`
52+
* Type: `Bearer`
53+
* Credentials for http://127.0.0.1:10035/token (AllegroGraph):
54+
* Username: `admin`
55+
* Password: `pass`
56+
* Type: `Basic`

demo/docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: '3.4'
2+
3+
services:
4+
openrefine-authenticator:
5+
build:
6+
context: ./openrefine/
7+
dockerfile: ./Dockerfile
8+
container_name: openrefine-authenticator
9+
network_mode: host
10+
volumes:
11+
- ./data:/or/data
12+
ports:
13+
- 3333:3333
14+
15+
login-app:
16+
build:
17+
context: ./login_app/
18+
dockerfile: ./Dockerfile
19+
container_name: login-app
20+
volumes:
21+
- ./data:/or/data
22+
- ./openrefine/workspace-files:/or/files
23+
ports:
24+
- 8080:8080
25+
26+
allegrograph:
27+
image: franzinc/agraph:latest
28+
container_name: allegrograph
29+
shm_size: 1g
30+
ports:
31+
- '10000-10035:10000-10035'
32+
restart: unless-stopped
33+
volumes:
34+
- ./agraph/etc/:/agraph/etc/
35+
- ./agraph/data/:/agraph/data/
36+
- ./organisations.ttl:/agraph/lib/organisations.ttl
37+
environment:
38+
- AGRAPH_SUPER_USER=admin
39+
- AGRAPH_SUPER_PASSWORD=pass
40+
expose:
41+
- 10035

demo/login_app/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM adoptopenjdk/openjdk8:alpine
2+
COPY ./LoginProtocol-0.1.war LoginProtocol-0.1.war
3+
EXPOSE 8080
4+
ENTRYPOINT ["java", "-jar", "LoginProtocol-0.1.war"]
86.9 MB
Binary file not shown.

demo/openrefine/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM openjdk:8-jre-alpine
2+
LABEL docker_image=novartis-openrefine
3+
LABEL version=1.0
4+
5+
# OpenRefine 3.4.1 as a based application
6+
ENV OR_URL https://github.com/OpenRefine/OpenRefine/releases/download/3.4.1/openrefine-linux-3.4.1.tar.gz
7+
8+
WORKDIR /or
9+
10+
11+
ENV EXT_LOCAL_FILE_SYSTEM "/or/files"
12+
RUN mkdir /or/files
13+
ADD workspace-files/* /or/files/
14+
15+
RUN set -xe && apk add --no-cache bash curl grep tar && curl -sSL ${OR_URL} | tar xz --strip 1
16+
17+
ADD ./or-configuration/refine.ini /or
18+
19+
ADD ./or-configuration/extensions/ /or/webapp/extensions/
20+
RUN cd /or/webapp/ && ls -l
21+
22+
WORKDIR /or/data
23+
VOLUME /or/data
24+
25+
EXPOSE 3333
26+
ENTRYPOINT ["/or/refine"]
27+
CMD ["-i", "0.0.0.0", "-p", "3333", "-d", "/or/data"]

0 commit comments

Comments
 (0)