From 7fcaa42f205363830e880ad9855ef31b7d563c7c Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Sat, 14 Sep 2019 10:44:54 +0200 Subject: [PATCH] add: implement language switch for contract and update contract text The texts for the contracts are taken from https://git.ccs-baumann.de/wpia/policies/tree/master/ra_agent_contract and are maintained there. Change-Id: I384176bb8d833f0dc74d438c461bf8114bf5a12c --- .../wpia/gigi/pages/account/MyContracts.java | 11 ++- .../wpia/gigi/pages/account/MyContracts.templ | 95 ++++++++++++++++--- .../gigi/pages/account/MyContractsDE.templ | 92 ++++++++++++++++++ .../wpia/gigi/pages/account/TestContract.java | 55 +++++++++++ 4 files changed, 241 insertions(+), 12 deletions(-) create mode 100644 src/club/wpia/gigi/pages/account/MyContractsDE.templ create mode 100644 tests/club/wpia/gigi/pages/account/TestContract.java diff --git a/src/club/wpia/gigi/pages/account/MyContracts.java b/src/club/wpia/gigi/pages/account/MyContracts.java index bf0574b5..b2aa53fc 100644 --- a/src/club/wpia/gigi/pages/account/MyContracts.java +++ b/src/club/wpia/gigi/pages/account/MyContracts.java @@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse; import club.wpia.gigi.dbObjects.Contract; import club.wpia.gigi.dbObjects.User; import club.wpia.gigi.localisation.Language; +import club.wpia.gigi.output.template.Template; import club.wpia.gigi.pages.LoginPage; import club.wpia.gigi.pages.Page; @@ -18,6 +19,8 @@ public class MyContracts extends Page { public static final String PATH = "/account/contracts"; + private static final Template contractDE = new Template(MyDetailsForm.class.getResource("MyContractsDE.templ")); + public MyContracts() { super("My Contracts"); } @@ -37,6 +40,12 @@ public class MyContracts extends Page { vars.put("csdate", sdf.format(c.getDateSigned())); } - getDefaultTemplate().output(out, getLanguage(req), vars); + switch (l.getLocale().toString()) { + case "de": + contractDE.output(out, getLanguage(req), vars); + break; + default: + getDefaultTemplate().output(out, getLanguage(req), vars); + } } } diff --git a/src/club/wpia/gigi/pages/account/MyContracts.templ b/src/club/wpia/gigi/pages/account/MyContracts.templ index ed1bfe97..c867d093 100644 --- a/src/club/wpia/gigi/pages/account/MyContracts.templ +++ b/src/club/wpia/gigi/pages/account/MyContracts.templ @@ -2,17 +2,90 @@
-

This contract concludes an agreement between

+

This contract concludes an agreement between

+

RA Agent:

+

and

+

World Privacy and Identity Association (WPIA) - Verein zur Foerderung von sicheren Technologien und Grundrechten im Internet (ZVR: 910115306)

+

c/o realraum

+

Brockmangasse 15

+

8010 Graz

+

Austria

+

- CA hereafter -

+

regarding the conduction of registration authority tasks.

+

§ 1 Contract matter 1. The RA Agent is entitled to conduct registration authority tasks as defined on the applicant's request and based on documents presented: * validation of an applicant's identity, and * validation of an applicant's personal data

+
    +
  1. The RA Agent is entitled to conduct those tasks on behalf of the CA as long as the RA Agent fulfills the following requirements: +
      +
    • 100 Verification Points,
    • +
    • passed the RA Agent test,
    • +
    • agrees the CA's Terms and Conditions,
    • +
    • agrees the Dispute Resolution system, and
    • +
    • signed this contract.
    • +
  2. +
  3. The parties agree, that this contract does not establish an employment relationship.

  4. +
  5. This contract starts on the day it is signed and is valid until it is terminated by either side with a notification period of fourteen (14) days.

  6. +
+

§ 2 Terms and Definitions

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TermDefinition

Applicant

Person who has an account on the systems of CA and requests to get the identity verified

Certificate Authority (CA)

Certificate Authority who issues S/MIME certificates to individuals and organisations

RA Agent

Person who conducts a identity verification on behalf of the CA

Registration Authority (RA)

Registration Authority who controls the correct entries of an applicant

Verification

Process to verify the identity of person

Verification Points

Points issued during the verification

+

§ 3 Rights and Obligations of the RA Agent

+
    +
  1. The RA Agent conducts the transferred duties independently according to the Verification Policy, i.e. free of instructions other than essential for the proper execution of the transferred tasks.

  2. +
  3. The RA Agent is entitled to use the brand and logo of the CA for her work as RA Agent based on this contract.

  4. +
  5. The RA Agent MUST identify herself to an Applicant as RA Agent with the RA Agent Card provided by the CA.

  6. +
  7. The RA Agent MUST NOT engage another person to do verifications on her behalf.

  8. +
  9. The RA Agent MUST NOT verify applicants that are spouses or life partners and first-degree relatives (next of kin).

  10. +
  11. All data collected and processed during the work as RA Auditor are object to strict confidentiality. They SHOULD NOT shared with others than those parties entitled by the CA and MUST be kept in accordance to their confidentiality.

  12. +
  13. The RA Agent is bound to the latest version of the data protection policy of the CA, in all regards of processing personal data of applicants. Personal data collected, used, and processed are titles, full names, date of birth, and email address of an applicant. The RA Agent is not allowed to transfer personal data to other entities than the CA, unless required to do so by the European Union or Member State law to which the RA Agent is subject to. In such a case, the RA Agent MUST to inform the CA of this legal requirement and the type of data transferred, unless that a law prohibits such information on important ground of public interest.

  14. +
+

§ 4 Payment and Fees

+
    +
  1. The RA Agent operates free of charge for the CA. This implies that the action is voluntary, honorary and unpaid without any liability to take an action and for the CA no obligation to register social security and labour legislation related data.

  2. +
  3. The RA agent is entitled to request reimbursement of travel expenses or other costs if this has been previously agreed with the applicant.

  4. +
+

§ 5 Dispute Resolution

+

Every dispute between the RA Agent and an applicant or the RA Agent and the CA MUST be filed to the CA's dispute resolution forum (arbitration). Each party is bound to the ruling of this forum.

+

§ 6 Termination

+

On termination of this contract all data that is older than thirty nine (39) months MUST be deleted in a secure manner. Data younger than thirty nine (39) months MUST be collected and made available to the CA unless otherwise requested by the CA. The RA Agent is accountable for the deletion or the handover to the CA.

+

§ 7 Subsidiary agreements

+

Subsidiary or deviating agreements and amendments to the contract MUST be in written form.

-

Name: - RA Agent hereafter -

+

-

and

- -

SomeCA - CA hereafter -

-

SomeAddress

- -

regarding the conduction of registration authority tasks.

- -

signed

-
diff --git a/src/club/wpia/gigi/pages/account/MyContractsDE.templ b/src/club/wpia/gigi/pages/account/MyContractsDE.templ new file mode 100644 index 00000000..b0fff313 --- /dev/null +++ b/src/club/wpia/gigi/pages/account/MyContractsDE.templ @@ -0,0 +1,92 @@ +
+
+
+ +

Dieser Vertrag schließt eine Vereinbarung zwischen

+

RA Agent:

+

und

+

World Privacy and Identity Association (WPIA) - Verein zur Förderung von sicheren Technologien und Grundrechten im Internet (ZVR: 910115306)

+

c/o realraum

+

Brockmangasse 15

+

8010 Graz

+

Austria

+

- folgend CA -

+

für die Durchführung von "Registration Authority"-Aufgaben.

+

§ 1 Vertragsgegenstand

+
    +
  1. Der RA Agent ist ermächtigt "Registration Authority"-Aufgaben, wie folgend aufgeführt, auf Antrag des Applicant und der vorgelegten Dokumente durchzuführen: +
      +
    • Validierung der Identität des Applicant
    • +
    • Validierung der persönlichen Daten des Applicant
    • +
  2. +
  3. Der RA Agent ist ermächtig diese Aufgaben im Auftrag der CA auszuführen sofern die folgenden Voraussetzungen erfüllt sind: +
      +
    • 100 Verification Points
    • +
    • bestandener RA Agent Test
    • +
    • Zustimmung zu den "Terms and Condition" der CA
    • +
    • Zustimmung zum Schiedsgerichtswesen
    • +
    • Unterschrift für diesen Vertrag
    • +
  4. +
  5. Die Parteien vereinbaren, dass aus diesem Vertrag keine Anstellungsverhältnis entsteht.

  6. +
  7. Dieser Vertrag beginnt mit dem Tag der Unterzeichnung und endet mit der Terminierung von jeder Seite mit einer Frist von vierzehn (14) Tagen nach Ankündigung.

  8. +
+

§ 2 Begriffe und Definitionen

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BegriffeDefinition

Applicant

Person die ein Konto bei der CA hat und ihre Identität verifiziert haben möchte.

Certificate Authority (CA)

Certificate Authority, die S/MIME Zertifikate für Personen und Organisationen austellt.

RA Agent Registration Authority (RA)

Person, die Verifications im Auftrag der CA durchführt. Registration Authority, die die Richtigkeit der Einträge eines Applicant sicherstellt.

Verification

Prozess die Identität einer Person festzustellen.

Verification Points

Punkte die während der verification vergeben werden.

+

§ 3 Rechte und Pflichten des RA Agent

+
    +
  1. Der RA Agent führt die auferlegten Pflichten gemäß der Verification Policy unabhängig durch, z.B. frei von Vorgaben anderer unter Berücksichtigung der ordnungsgemäßen Durchführung der Aufgaben.

  2. +
  3. Der RA Agent ist ermächtigt, die Marke und das Logo der CA für die Arbeit als RA Agent im Rahmen dieses Vertrages zu nutzen.

  4. +
  5. Der RA Agent muss (MUST) sich gegenüber dem Applicant als RA Agent mit seiner von der CA zur Verfügung gestellten RA Agent Card ausweisen.

  6. +
  7. Der RA Agent darf nicht (MUST NOT) andere Personen auffordern die Verification an seiner statt durchzuführen.

  8. +
  9. Der RA Agent darf nicht (MUST NOT) Ehe- und Lebenspartner und Verwandte ersten Grades als Applicant verifizieren.

  10. +
  11. Alle Informationen, die während der Arbeit als RA Agent gesammelt werden, sind als vertraulich zu behandeln. Diese sollten nicht (SHOULD NOT) an Dritte außer den von der CA bestimmten weitergeleitet werden und müssen (MUST) entsprechend gesichert aufbewahrt werden.

  12. +
  13. Der RA Agent ist an die aktuell gültige Version der Datenschutzrichtlinie der CA in allen Belangen der Verarbeitung der Daten des Applicant gebunden. Die gesammelten und zu verarbeitenden personenbezogenen Daten sind Titel, voller Namen, Geburtsdatum und E-Mail-Adresse des Applicant. Der RA Agent ist nicht ermächtigt, personenbezogenen Daten an Dritte außer der CA weiterzuleiten es sei den das Recht der Europäischen Union oder des Landes des RA Agent verlangt dieses. In diesem Fall muss (MUST) der RA Agent die CA über den Vorfall mit Angabe der Begründung und der übergebenen Daten melden, es sei denn ein Gesetz verbietet die Offenlegung auf Grund von gesteigerten öffentlichen Interesses.

  14. +
+

§ 4 Bezahlung und Gebühren

+
    +
  1. Der RA Agent arbeitet ohne Bezahlung durch die CA. Dies bedeutet, dass es sich bei dieser Tätigkeit um eine freiwillige, ehrenamtliche und unentgeltliche Tätigkeit ohne jede Arbeitsleistungsverpflichtung handelt, und seitens der CA keinerlei sozialversicherungs- und arbeitsrechtliche Meldepflichten bestehen.

  2. +
  3. Der RA Agent darf Reise- oder ähnliche Kosten dem Applicant in Rechnung stellen, sofern dies im Vorfeld vereinbart wird.

  4. +
+

§ 5 Schiedsgerichtsbarkeit

+

Jede Unstimmigkeit zwischen dem RA Agent und dem Applicant oder dem RA Agent und der CA muss (MUST) bei dem Schiedsgericht der CA eingreicht werden. Jede Partei ist an den Schiedspruch gebunden.

+

§ 6 Vertragsbeendigung

+

Mit Vertragsbeendigung dieses Vertrages sind (MUST) alle Daten älter als neununddreißig (39) Monate zu vernichten. Daten jünger als neununddreißig (39) Monate müssen gesammelt und der CA zukommen gelassen werden, es sei denn anders von der CA bestimmt. Der RA Agent ist dafür verantwortlich, dass die Daten entsprechend vernichtet oder an die CA weitergereicht werden.

+

§ 7 Zusätzliche Bestimmungen

+

Zusätzliche oder abweichende Bestimmungen oder Vereinbarungen benötigen (MUST) die Schriftform.

+ +

+ +
diff --git a/tests/club/wpia/gigi/pages/account/TestContract.java b/tests/club/wpia/gigi/pages/account/TestContract.java new file mode 100644 index 00000000..4628ec86 --- /dev/null +++ b/tests/club/wpia/gigi/pages/account/TestContract.java @@ -0,0 +1,55 @@ +package club.wpia.gigi.pages.account; + +import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.MatcherAssert.*; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.junit.Test; + +import club.wpia.gigi.testUtils.ClientTest; +import club.wpia.gigi.testUtils.IOUtils; + +public class TestContract extends ClientTest { + + @Test + public void TestContractSignRevoke() throws IOException { + // empty contract + String res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("This contract concludes an agreement between")); + assertThat(res, containsString("not yet")); + + // sign contract + executeBasicWebInteraction(cookie, MyDetails.PATH, "action=signContract", 0); + getMailReceiver().receive(u.getEmail()); + res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("This contract concludes an agreement between")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + assertThat(res, containsString(sdf.format(new Date()))); + + // sign contract + executeBasicWebInteraction(cookie, MyDetails.PATH, "action=revokeContract", 0); + getMailReceiver().receive(u.getEmail()); + res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("This contract concludes an agreement between")); + assertThat(res, containsString("not yet")); + } + + @Test + public void TestLanguageSwitch() throws IOException { + + String res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("This contract concludes an agreement between")); + // switch to German + executeBasicWebInteraction(cookie, MyDetails.PATH, "lang=de", 0); + res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("Dieser Vertrag schließt eine Vereinbarung zwischen")); + // switch to Turkish, should return default language English + executeBasicWebInteraction(cookie, MyDetails.PATH, "lang=tr", 0); + res = IOUtils.readURL(get(MyContracts.PATH)); + assertThat(res, containsString("This contract concludes an agreement between")); + } + +} -- 2.39.2