-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XRoad REST request/response mapping Included are 3 basic DSL-s to support public XRoad services of Estonian Business Registry.
- Loading branch information
Showing
39 changed files
with
846 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Tue Jun 04 16:36:32 EEST 2024 | ||
gradle.version=8.8 |
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
params: | ||
- reg_code | ||
- username | ||
- password | ||
|
||
service: https://ariregxmlv6.rik.ee/ | ||
method: POST | ||
|
||
envelope: > | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xro="http://x-road.eu/xsd/xroad.xsd" xmlns:iden="http://x-road.eu/xsd/identifiers" xmlns:prod="http://arireg.x-road.eu/producer/"> | ||
<soapenv:Body> | ||
<prod:detailandmed_v2> | ||
<prod:keha> | ||
<prod:ariregister_kasutajanimi>{{username}}</prod:ariregister_kasutajanimi> | ||
<prod:ariregister_parool>{{password}}</prod:ariregister_parool> | ||
<prod:ariregistri_kood>{{reg_code}}</prod:ariregistri_kood> | ||
<prod:yandmed>1</prod:yandmed> | ||
<prod:iandmed>1</prod:iandmed> | ||
<prod:kandmed>0</prod:kandmed> | ||
<prod:dandmed>0</prod:dandmed> | ||
<prod:maarused>0</prod:maarused> | ||
</prod:keha> | ||
</prod:detailandmed_v2> | ||
</soapenv:Body> | ||
</soapenv:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
params: | ||
- reg_code | ||
|
||
service: https://ariregxmlv6.rik.ee/ | ||
method: POST | ||
|
||
envelope: > | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prod="http://arireg.x-road.eu/producer/"> | ||
<soapenv:Header/> | ||
<soapenv:Body> | ||
<prod:ettevottegaSeotudIsikud_v1> | ||
<prod:keha> | ||
<prod:ariregistri_kood>{{reg_code}}</prod:ariregistri_kood> | ||
</prod:keha> | ||
</prod:ettevottegaSeotudIsikud_v1> | ||
</soapenv:Body> | ||
</soapenv:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
params: | ||
- reg_code | ||
- username | ||
- password | ||
|
||
service: https://ariregxmlv6.rik.ee/ | ||
method: POST | ||
|
||
envelope: > | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:iden="http://x-road.eu/xsd/identifiers" xmlns:prod="http://arireg.x-road.eu/producer/" xmlns:xro="http://x-road.eu/xsd/xroad.xsd"> | ||
<soapenv:Body> | ||
<prod:lihtandmed_v3> | ||
<prod:keha> | ||
<prod:ariregister_kasutajanimi>{{username}}</prod:ariregister_kasutajanimi> | ||
<prod:ariregister_parool>{{password}}</prod:ariregister_parool> | ||
<prod:ariregistri_kood>{{reg_code}}</prod:ariregistri_kood> | ||
</prod:keha> | ||
</prod:lihtandmed_v3> | ||
</soapenv:Body> | ||
</soapenv:Envelope> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM eclipse-temurin:17-jdk AS build | ||
WORKDIR /workspace/app | ||
|
||
COPY gradlew . | ||
COPY gradlew.bat . | ||
COPY gradle gradle | ||
COPY build.gradle . | ||
COPY src src | ||
COPY .env .env | ||
COPY DSL DSL | ||
|
||
RUN chmod 754 ./gradlew | ||
RUN ./gradlew -Pprod clean bootJar | ||
RUN mkdir -p build/libs && (cd build/libs; jar -xf *.jar) | ||
|
||
FROM eclipse-temurin:17-jdk | ||
VOLUME /build/tmp | ||
|
||
ARG DEPENDENCY=/workspace/app/build/libs | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib | ||
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app | ||
COPY DSL /DSL | ||
|
||
ENV application.dslPath=/DSL | ||
|
||
COPY .env /app/.env | ||
RUN echo BUILDTIME=`date +%s` >> /app/.env | ||
|
||
RUN adduser xtr | ||
RUN chown -R xtr:xtr /app | ||
RUN chown -R xtr:xtr /DSL | ||
USER xtr | ||
|
||
EXPOSE 9010 | ||
|
||
ENTRYPOINT ["java","-cp","app:app/lib/*","ee.buerokratt.xtr.XTRApplication"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Getting Started | ||
|
||
### Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Gradle documentation](https://docs.gradle.org) | ||
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.3.0/gradle-plugin/reference/html/) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.3.0/gradle-plugin/reference/html/#build-image) | ||
* [Spring Web Services](https://docs.spring.io/spring-boot/docs/3.3.0/reference/htmlsingle/index.html#io.webservices) | ||
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.0/reference/htmlsingle/index.html#web) | ||
* [Spring Configuration Processor](https://docs.spring.io/spring-boot/docs/3.3.0/reference/htmlsingle/index.html#appendix.configuration-metadata.annotation-processor) | ||
|
||
### Guides | ||
The following guides illustrate how to use some features concretely: | ||
|
||
* [Producing a SOAP web service](https://spring.io/guides/gs/producing-web-service/) | ||
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) | ||
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) | ||
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) | ||
|
||
### Additional Links | ||
These additional references should also help you: | ||
|
||
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
# XTR | ||
X-Road requests and responses as REST | ||
# XTR v3 | ||
### REST request/response mappings for XRoad SOAP requests | ||
|
||
### Services | ||
|
||
Services are defined as YAML-formatted DSLs in folder specified in `application.dslPath` property. | ||
|
||
The directory format should be `<DSLpath>/<service provider>/<service name>`. | ||
|
||
```yaml | ||
params: | ||
- <list of allowed parameters> | ||
service: <uri of service> | ||
method: <GET|POST> | ||
|
||
envelope: <XRoad envelope as XML> | ||
``` | ||
* `envelope` can contain handlebars mappings for parameters | ||
* Only parameters specified in `params` will be applied for handlebars mappings | ||
|
||
All services are served as POST endpoints. | ||
|
||
POST /<service provider>/<service_name> | ||
|
||
with optiona parameters as JSON object in request body. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.0' | ||
id 'io.spring.dependency-management' version '1.1.5' | ||
} | ||
|
||
group = 'ee.buerokratt' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-web-services' | ||
implementation 'wsdl4j:wsdl4j' | ||
|
||
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.0' | ||
implementation 'com.github.jknack:handlebars:4.4.0' | ||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0' | ||
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.0' | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.9' | ||
services: | ||
xtr: | ||
container_name: xtr | ||
build: | ||
context: . | ||
ports: | ||
- 9020:8080 | ||
volumes: | ||
- ./DSL:/DSL | ||
networks: | ||
- bykstack | ||
|
||
networks: | ||
bykstack: | ||
name: bykstack | ||
driver: bridge | ||
driver_opts: | ||
com.docker.network.driver.mtu: 1400 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.