Commit 72ea123d authored by Tobias Assmann's avatar Tobias Assmann
Browse files

rework codegen to use local xsds, fix some maven deps, start code for impl soap client

parent 988d7c26
......@@ -86,8 +86,6 @@
<wsdl>${basedir}/src/main/resources/wsdl/TR-03130eID-Server.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
<extraarg>-catalog</extraarg>
<extraarg>${basedir}/src/main/resources/wsdl/catalog.cat</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
......@@ -110,32 +108,33 @@
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<artifactId>javaee-api</artifactId>
<version>8.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
</dependency>
<!-- JSON-B API -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.62</version>
</dependency>
<!--Test-->
<!-- JSON-B API and Yasson (JSON-B implementation)
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<!-- Yasson (JSON-B implementation) -->
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>1.0.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.62</version>
</dependency>
<!--Test-->
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
......
......@@ -30,6 +30,7 @@ import reqesidta.ssa.server.config.SSAConfig;
import reqesidta.ssa.session.SessionStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reqesidta.ssa.eid.EidClient;
import reqesidta.ssa.session.Session;
/**
......@@ -45,6 +46,7 @@ public class SsaService {
@Inject private SSAConfig config;
@Inject private CertificateAuthorityClient caClient;
@Inject private SessionStore sessionStore;
@Inject private EidClient eidService;
public SsaService() {
JsonbConfig config = new JsonbConfig()
......
package reqesidta.ssa.eid;
import de.bund.bsi.eid.EID;
import de.bund.bsi.eid.EID_Service;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Tobias Assmann <tobias.assmann@ecsec.de>
*/
public class EidClient {
private static final Logger log = LoggerFactory.getLogger(EidClient.class);
private static final QName SERVICE_NAME = new QName("http://bsi.bund.de/eID/", "eID");
public EidClient(String url) throws MalformedURLException {
log.debug("setting up eidClient with url "+url);
EID_Service service = new EID_Service(new URL(url), SERVICE_NAME);
EID port = service.getEIDSOAP();
}
}
package reqesidta.ssa.eid;
import java.net.MalformedURLException;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import reqesidta.ssa.server.config.SSAConfig;
/**
*
* @author Tobias Assmann <tobias.assmann@ecsec.de>
*/
@ApplicationScoped
public class EidClientProvider {
private EidClient eidClient;
@Inject
public EidClientProvider(SSAConfig config) throws MalformedURLException {
this.eidClient = new EidClient(config.getEidUrl());
}
@Produces
public EidClient getEidclient() {
return eidClient;
}
}
......@@ -17,7 +17,8 @@ public class SSAConfig {
private int sessionMaxAge;
private int sessionCheckAgeInterval;
// private String eidBaseUrl;
private String eidUrl;
private int eidPort;
private CertificateAuthorityConfig caConfig;
public int getSessionMaxAge() {
......@@ -36,14 +37,13 @@ public class SSAConfig {
this.sessionCheckAgeInterval = sessionCheckAgeInterval;
}
// public String getEidBaseUrl() {
// return this.eidBaseUrl;
// }
//
// public void setEidBaseUrl(String eidBaseUrl) {
// this.eidBaseUrl = eidBaseUrl;
// }
public String getEidUrl() {
return this.eidUrl;
}
public void setEidUrl(String eidUrl) {
this.eidUrl = eidUrl;
}
public CertificateAuthorityConfig getCaConfig() {
return caConfig;
}
......
ssa-config {
sessionMaxAge: 60,
sessionCheckAgeInterval: 30,
eidUrl: "https://poseidas.docker.reqesidta.de:8443/POSeIDAS/service/eid/TR-03130-WSDL.wsdl"
ca-config: {
caName: 'dummy-caName',
cmpAlias: 'dummy-cmp-alias',
......
......@@ -6,7 +6,7 @@
version="2.1.2 2017-10-25">
<import namespace="urn:oasis:names:tc:dss:1.0:core:schema"
schemaLocation="http://docs.oasis-open.org/dss/v1.0/oasis-dss-core-schema-v1.0-os.xsd" />
schemaLocation="oasis-dss-core-schema-v1.0-os.xsd" />
<import namespace="urn:oasis:names:tc:SAML:2.0:assertion"
schemaLocation="saml-schema-assertion-2.0.xsd" />
<complexType name="SessionType">
......
--
catalog file to fix broken xsd references, as wsdl2java maven plugin does not follow redirects :-(
--
SYSTEM "http://www.oasis-open.org/committees/download.php/3408/oasis-sstc-saml-schema-protocol-1.1.xsd" "https://www.oasis-open.org/committees/download.php/3408/oasis-sstc-saml-schema-protocol-1.1.xsd"
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:dss="urn:oasis:names:tc:dss:1.0:core:schema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" targetNamespace="urn:oasis:names:tc:dss:1.0:core:schema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation xml:lang="en">This Schema defines the Digital Signature Service Core Protocols, Elements, and Bindings Committee Specification version 1.0 release 1</xs:documentation>
</xs:annotation>
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<xs:import namespace="urn:oasis:names:tc:SAML:1.0:assertion" schemaLocation="oasis-sstc-saml-schema-assertion-1.1.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:complexType name="AnyType">
<xs:sequence>
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="InternationalStringType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="InputDocuments">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element ref="dss:Document"/>
<xs:element ref="dss:TransformedData"/>
<xs:element ref="dss:DocumentHash"/>
<xs:element name="Other" type="dss:AnyType"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="DocumentBaseType" abstract="true">
<xs:attribute name="ID" type="xs:ID" use="optional"/>
<xs:attribute name="RefURI" type="xs:anyURI" use="optional"/>
<xs:attribute name="RefType" type="xs:anyURI" use="optional"/>
<xs:attribute name="SchemaRefs" type="xs:IDREFS" use="optional"/>
</xs:complexType>
<xs:element name="Document" type="dss:DocumentType"/>
<xs:complexType name="DocumentType">
<xs:complexContent>
<xs:extension base="dss:DocumentBaseType">
<xs:choice>
<xs:element name="InlineXML" type="dss:InlineXMLType"/>
<xs:element name="Base64XML" type="xs:base64Binary"/>
<xs:element name="EscapedXML" type="xs:string"/>
<xs:element ref="dss:Base64Data"/>
<xs:element ref="dss:AttachmentReference"/>
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Base64Data">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="MimeType" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:complexType name="InlineXMLType">
<xs:sequence>
<xs:any processContents="lax"/>
</xs:sequence>
<xs:attribute name="ignorePIs" type="xs:boolean" use="optional" default="true"/>
<xs:attribute name="ignoreComments" type="xs:boolean" use="optional" default="true"/>
</xs:complexType>
<xs:element name="TransformedData">
<xs:complexType>
<xs:complexContent>
<xs:extension base="dss:DocumentBaseType">
<xs:sequence>
<xs:element ref="ds:Transforms" minOccurs="0"/>
<xs:element ref="dss:Base64Data"/>
</xs:sequence>
<xs:attribute name="WhichReference" type="xs:integer" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="DocumentHash">
<xs:complexType>
<xs:complexContent>
<xs:extension base="dss:DocumentBaseType">
<xs:sequence>
<xs:element ref="ds:Transforms" minOccurs="0"/>
<xs:element ref="ds:DigestMethod" minOccurs="0"/>
<xs:element ref="ds:DigestValue"/>
</xs:sequence>
<xs:attribute name="WhichReference" type="xs:integer" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="SignatureObject">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element ref="ds:Signature"/>
<xs:element ref="dss:Timestamp"/>
<xs:element ref="dss:Base64Signature"/>
<xs:element ref="dss:SignaturePtr"/>
<xs:element name="Other" type="dss:AnyType"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="SchemaRefs" type="xs:IDREFS" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="Base64Signature">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="Type" type="xs:anyURI"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="SignaturePtr">
<xs:complexType>
<xs:attribute name="WhichDocument" type="xs:IDREF"/>
<xs:attribute name="XPath" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="Result">
<xs:complexType>
<xs:sequence>
<xs:element name="ResultMajor" type="xs:anyURI"/>
<xs:element name="ResultMinor" type="xs:anyURI" minOccurs="0"/>
<xs:element name="ResultMessage" type="dss:InternationalStringType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OptionalInputs" type="dss:AnyType"/>
<xs:element name="OptionalOutputs" type="dss:AnyType"/>
<xs:element name="ServicePolicy" type="xs:anyURI"/>
<xs:element name="ClaimedIdentity">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="saml:NameIdentifierType"/>
<xs:element name="SupportingInfo" type="dss:AnyType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Language" type="xs:language"/>
<xs:element name="AdditionalProfile" type="xs:anyURI"/>
<xs:element name="Schemas" type="dss:SchemasType"/>
<xs:complexType name="SchemasType">
<xs:sequence>
<xs:element ref="dss:Schema" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Schema" type="dss:DocumentType"/>
<xs:complexType name="RequestBaseType">
<xs:sequence>
<xs:element ref="dss:OptionalInputs" minOccurs="0"/>
<xs:element ref="dss:InputDocuments" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="RequestID" type="xs:string" use="optional"/>
<xs:attribute name="Profile" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:complexType name="ResponseBaseType">
<xs:sequence>
<xs:element ref="dss:Result"/>
<xs:element ref="dss:OptionalOutputs" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="RequestID" type="xs:string" use="optional"/>
<xs:attribute name="Profile" type="xs:anyURI" use="required"/>
</xs:complexType>
<xs:element name="Response" type="dss:ResponseBaseType"/>
<xs:element name="SignRequest">
<xs:complexType>
<xs:complexContent>
<xs:extension base="dss:RequestBaseType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="SignResponse">
<xs:complexType>
<xs:complexContent>
<xs:extension base="dss:ResponseBaseType">
<xs:sequence>
<xs:element ref="dss:SignatureObject" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="SignatureType" type="xs:anyURI"/>
<xs:element name="AddTimestamp" type="dss:UpdateSignatureInstructionType"/>
<xs:complexType name="TimeSignatureInstructionType">
<xs:complexContent>
<xs:extension base="dss:UpdateSignatureInstructionType">
<xs:attribute name="TimeStampTheGivenSignature" type="xs:boolean" use="optional" default="false"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="UpdateSignatureInstructionType">
<xs:attribute name="Type" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:element name="IntendedAudience">
<xs:complexType>
<xs:sequence>
<xs:element name="Recipient" type="saml:NameIdentifierType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="KeySelector">
<xs:complexType>
<xs:choice>
<xs:element ref="ds:KeyInfo"/>
<xs:element name="Other" type="dss:AnyType"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Properties">
<xs:complexType>
<xs:sequence>
<xs:element name="SignedProperties" type="dss:PropertiesType" minOccurs="0"/>
<xs:element name="UnsignedProperties" type="dss:PropertiesType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="PropertiesType">
<xs:sequence>
<xs:element ref="dss:Property" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Property">
<xs:complexType>
<xs:sequence>
<xs:element name="Identifier" type="xs:anyURI"/>
<xs:element name="Value" type="dss:AnyType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IncludeObject">
<xs:complexType>
<xs:attribute name="WhichDocument" type="xs:IDREF"/>
<xs:attribute name="hasObjectTagsAndAttributesSet" type="xs:boolean" default="false"/>
<xs:attribute name="ObjId" type="xs:string" use="optional"/>
<xs:attribute name="createReference" type="xs:boolean" use="optional" default="true"/>
</xs:complexType>
</xs:element>
<xs:element name="SignaturePlacement">
<xs:complexType>
<xs:choice>
<xs:element name="XPathAfter" type="xs:string"/>
<xs:element name="XPathFirstChildOf" type="xs:string"/>
</xs:choice>
<xs:attribute name="WhichDocument" type="xs:IDREF"/>
<xs:attribute name="CreateEnvelopedSignature" type="xs:boolean" default="true"/>
</xs:complexType>
</xs:element>
<xs:element name="DocumentWithSignature">
<xs:complexType>
<xs:sequence>
<xs:element ref="dss:Document"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SignedReferences">
<xs:complexType>
<xs:sequence>
<xs:element ref="dss:SignedReference" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SignedReference">
<xs:complexType>
<xs:sequence>
<xs:element ref="ds:Transforms" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="WhichDocument" type="xs:IDREF" use="required"/>
<xs:attribute name="RefURI" type="xs:anyURI" use="optional"/>
<xs:attribute name="RefId" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="VerifyRequest">
<xs:complexType>
<xs:complexContent>
<xs:extension base="dss:RequestBaseType">
<xs:sequence>
<xs:element ref="dss:SignatureObject" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="VerifyResponse" type="dss:ResponseBaseType"/>
<xs:element name="VerifyManifestResults" type="dss:VerifyManifestResultsType"/>
<xs:complexType name="VerifyManifestResultsType">
<xs:sequence>
<xs:element ref="dss:ManifestResult" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ManifestResult">
<xs:complexType>
<xs:sequence>
<xs:element name="ReferenceXpath" type="xs:string"/>
<xs:element name="Status" type="xs:anyURI"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UseVerificationTime"/>
<xs:complexType name="UseVerificationTimeType">
<xs:choice>
<xs:element name="CurrentTime"/>
<xs:element name="SpecificTime" type="xs:dateTime"/>
<xs:any namespace="##other"/>
</xs:choice>
</xs:complexType>
<xs:element name="ReturnVerificationTimeInfo"/>
<xs:element name="AdditionalTimeInfo" type="dss:AdditionalTimeInfoType"/>
<xs:complexType name="AdditionalTimeInfoType">
<xs:simpleContent>
<xs:extension base="xs:dateTime">
<xs:attribute name="Type" type="xs:anyURI" use="required"/>
<xs:attribute name="Ref" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="VerificationTimeInfo" type="dss:VerificationTimeInfoType"/>
<xs:complexType name="VerificationTimeInfoType">
<xs:sequence>
<xs:element name="VerificationTime" type="xs:dateTime"/>
<xs:element ref="dss:AdditionalTimeInfo" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="AdditionalKeyInfo">
<xs:complexType>
<xs:sequence>
<xs:element ref="ds:KeyInfo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReturnProcessingDetails"/>
<xs:element name="ProcessingDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="ValidDetail" type="dss:DetailType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="IndeterminateDetail" type="dss:DetailType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InvalidDetail" type="dss:DetailType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="DetailType">
<xs:sequence>
<xs:element name="Code" type="xs:anyURI" minOccurs="0"/>
<xs:element name="Message" type="dss:InternationalStringType" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Type" type="xs:anyURI" use="required"/>
</xs:complexType>
<xs:element name="ReturnSigningTimeInfo"/>
<xs:element name="SigningTimeInfo" type="dss:SigningTimeInfoType"/>
<xs:complexType name="SigningTimeInfoType">
<xs:sequence>
<xs:element name="SigningTime" type="xs:dateTime"/>
<xs:element name="SigningTimeBoundaries" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="LowerBoundary" type="xs:dateTime" minOccurs="0"/>
<xs:element name="UpperBoundary" type="xs:dateTime" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="ReturnSignerIdentity"/>
<xs:element name="SignerIdentity" type="saml:NameIdentifierType"/>
<xs:element name="ReturnUpdatedSignature">
<xs:complexType>
<xs:attribute name="Type" type="xs:anyURI" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="UpdatedSignature" type="dss:UpdatedSignatureType"/>
<xs:complexType name="UpdatedSignatureType">
<xs:sequence>
<xs:element ref="dss:SignatureObject"/>
</xs:sequence>
<xs:attribute name="Type" type="xs:anyURI" use="optional"/>
</xs:complexType>
<xs:element name="ReturnTransformedDocument">
<xs:complexType>
<xs:attribute name="WhichReference" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="TransformedDocument">
<xs:complexType>
<xs:sequence>
<xs:element ref="dss:Document"/>
</xs:sequence>
<xs:attribute name="WhichReference" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="ReturnTimestampedSignature" type="dss:UpdateSignatureInstructionType"/>
<xs:element name="TimestampedSignature" type="dss:UpdatedSignatureType"/>
<xs:element name="Timestamp">
<xs:complexType>
<xs:choice>
<xs:element ref="ds:Signature"/>
<xs:element name="RFC3161TimeStampToken" type="xs:base64Binary"