BackgroundThe sample scripts use some software components(jq, base64, etc.) that might not be possible to install or use (due to system restrictions or variations in their features or way of executing). For those cases, and if docker is available, the easiest solution would be to generate a docker image with the required components, and then set up a sh script to allow the execution of the WIPO sourced scripts. Docker imageThe following dockerfile, would allow to generate a simple image with the most common software tools that are needed for the execution of the scripts. Code Block |
---|
language | yml |
---|
title | dockerfile |
---|
linenumbers | true |
---|
collapse | true |
---|
| FROM debian
# Install required system packages
RUN apt-get update
RUN apt-get -y install gnupg vim ssh
RUN apt-get -y install git openssh-client less iproute2 procps apt-transport-https coreutils curl gnupg-agent software-properties-common lsb-release jq xxd
# additional packages in case newman is required to execute the tests
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get -y install nodejs |
Note |
---|
| The node package is only required in case you would want to execute "Newman" locally, to automate the testing of the DAS API. |
To build the image (locally), you can use the following command: Code Block |
---|
docker build ./ -t <image_name> |
Execute scriptsTo generate the asymmetric keys:See ae.1.- Generation of (ES256) asymmetric keys for more info. Execute docker as: Code Block |
---|
docker run -it --rm -v $(pwd):/src <image_name> sh /src/scripts/private_key_jwt_generation.sh output_folder private_es256_key_name.pem public_es256_key_name.pem |
To retrieve the authentication tocken:See ae.2.- Sample authentication script (using JWT private key) Execute docker as: Code Block |
---|
docker run -it --rm -v $(pwd):/src <image_name> sh /src/scripts/jwt-ipo-das.sh authorized_client_id {path_to_private_pem_key}/private_es256_key_name.pem |
|