Skip to content

Commit

Permalink
add tests for dataset reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Parisa68 committed Nov 26, 2024
1 parent 823880a commit 2aa1095
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,7 @@ public void listen(String message) {
String stableDatasetId = metadataService.getDataset(datasetsDbTableId).getStableId();
log.info("Reference id {} mapped to dataset id {}", requestedDatasetId, stableDatasetId);
requestedDatasetId = stableDatasetId; // use stable dataset id instead of reference to complete the export as normal
Collection<String> approvedMappedDatasetIds = approvedDatasetIds.stream()
.map(x -> {
var reference = metadataService.findByReferenceId(x);
if (reference != null && reference.getDatasetId() != null) {
var dataset = metadataService.getDataset(reference.getDatasetId());
return dataset != null ? dataset.getStableId() : x;
} else {
return x;
}
})
.toList();
Collection<String> approvedMappedDatasetIds = approvedDatasetIds.stream().map(x -> metadataService.getDataset(metadataService.findByReferenceId(x).getDatasetId()).getStableId()).toList();
approvedDatasetIds = approvedMappedDatasetIds;
}
exportDataset(user, approvedDatasetIds, requestedDatasetId, exportRequest.getPublicKey(), exportRequest.getStartCoordinate(), exportRequest.getEndCoordinate());
Expand Down
28 changes: 13 additions & 15 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,34 @@ logging:
rest.enabled: ${REST_ENABLED:true}

server.ssl:
enabled: ${SSL_ENABLED:false}
enabled: ${SSL_ENABLED:true}
key-store-type: PKCS12
key-store: file:${KEYSTORE_PATH:/etc/ega/ssl/server.cert}
key-store-password: ${KEYSTORE_PASSWORD}

spring.rabbitmq:
host: ${BROKER_HOST:129.177.177.134}
host: ${BROKER_HOST:private-mq}
port: ${BROKER_PORT:5671}
virtual-host: ${BROKER_VHOST:sda}
username: ${BROKER_USERNAME:admin}
password: ${BROKER_PASSWORD:guest}
ssl:
enabled: true
algorithm: TLSv1.2
validate-server-certificate: ${BROKER_VALIDATE:false}
validate-server-certificate: ${BROKER_VALIDATE:true}
trust-store-type: PKCS12
key-store-type: PKCS12

outbox:
enabled: ${OUTBOX_ENABLED:true}
type: ${OUTBOX_TYPE:POSIX}
queue: ${OUTBOX_QUEUE:exportRequests}
location: ${OUTBOX_LOCATION:%s/files/}
location: ${OUTBOX_LOCATION:/ega/outbox/p11-%s/files/}

spring:
datasource:
# url: jdbc:postgresql://${DB_INSTANCE:129.177.177.134}:${DB_PORT:5432}/${POSTGRES_DB:sda}?sslmode=${SSL_MODE:verify-ca}&sslrootcert=${ROOT_CERT_PATH:test/rootCA.pem}&sslcert=${CERT_PATH:test/localhost.pem}&sslkey=${CERT_KEY:test/localhost-client-key.der}
url: jdbc:postgresql://${DB_INSTANCE:129.177.177.134}:${DB_PORT:5432}/${POSTGRES_DB:sda}

username: ${POSTGRES_USER:lega_out}
url: jdbc:postgresql://${DB_INSTANCE:db}:${DB_PORT:5432}/${POSTGRES_DB:sda}?sslmode=${SSL_MODE:verify-full}&sslrootcert=${ROOT_CERT_PATH:/etc/ega/ssl/CA.cert}&sslcert=${CERT_PATH:/etc/ega/ssl/client.cert}&sslkey=${CERT_KEY:/etc/ega/ssl/client.key}
username: ${POSTGRES_USER:postgres}
password: ${POSTGRES_PASSWORD:rootpasswd}
driver-class-name: org.postgresql.Driver
jpa:
Expand All @@ -57,13 +55,13 @@ s3:
root-ca: ${S3_ROOT_CERT_PATH:/etc/ssl/certs/ca-certificates.crt}

s3.out:
endpoint: ${S3_OUT_ENDPOINT:129.177.177.134}
port: ${S3_OUT_PORT:9000}
endpoint: ${S3_OUT_ENDPOINT:outbox}
port: ${S3_OUT_PORT:443}
access-key: ${S3_OUT_ACCESS_KEY:minio}
secret-key: ${S3_OUT_SECRET_KEY:miniostorage}
region: ${S3_OUT_REGION:us-west-1}
bucket: ${S3_OUT_BUCKET:lega}
secure: ${S3_OUT_SECURE:false}
secure: ${S3_OUT_SECURE:true}
root-ca: ${S3_OUT_ROOT_CERT_PATH:/etc/ssl/certs/ca-certificates.crt}

archive:
Expand All @@ -74,14 +72,14 @@ ga4gh:
# First, the public key is checked. If present, it's used for validating the token and openid-configuration-url is not used.
public-key-path: ${PASSPORT_PUBLIC_KEY_PATH:/etc/ega/jwt/passport.pem}
# If public key is absent, then openid-configuration-url is used to query JWK and fetch the public key.
openid-configuration-url: ${OPENID_CONFIGURATION_URL:http://129.177.177.134:8000/openid-configuration}
openid-configuration-url: ${OPENID_CONFIGURATION_URL:https://login.elixir-czech.org/oidc/.well-known/openid-configuration}
# /userinfo endpoint URL for handling opaque access tokens
userinfo-endpoint-url: ${USERINFO_ENDPOINT_URL:http://129.177.177.134:8000/userinfo}
userinfo-endpoint-url: ${USERINFO_ENDPOINT_URL:https://login.elixir-czech.org/oidc/userinfo}
visa:
# First, the public key is checked. If present, it's used for validating the token. Otherwise, JKU is used instead (entry in the header).
public-key-path: ${VISA_PUBLIC_KEY_PATH:/etc/ega/jwt/visa.pem}


crypt4gh:
private-key-path: ${CRYPT4GH_PRIVATE_KEY_PATH:test/crypt4gh.sec.pem}
private-key-password-path: ${CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH:test/crypt4gh.pass}
private-key-path: ${CRYPT4GH_PRIVATE_KEY_PATH:/etc/ega/crypt4gh/key.pem}
private-key-password-path: ${CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH:/etc/ega/crypt4gh/key.pass}

0 comments on commit 2aa1095

Please sign in to comment.