Skip to content

Commit

Permalink
Merge pull request #383 from josdem/feature/379
Browse files Browse the repository at this point in the history
[small]Feature/379
  • Loading branch information
josdem authored Oct 8, 2024
2 parents 04ab707 + cfd67bc commit aae724d
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ext {
}

group = 'com.josdem.vetlog'
version = '1.9.0'
version = '1.9.1'

configurations {
compileOnly {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
"/recovery/**",
"/breed/list",
"/pet/listForAdoption",
"/service/list")
"/privacy/show")
.permitAll()
.anyRequest()
.authenticated())
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/josdem/vetlog/controller/PrivacyController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2024 Jose Morales [email protected]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.vetlog.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Slf4j
@Controller
@RequestMapping("/privacy")
public class PrivacyController {

@RequestMapping("/show")
public String index() {
log.info("Showing privacy page");
return "privacy/show";
}
}
14 changes: 14 additions & 0 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,20 @@ service.surgery.teeth.twenty.two=$80 USD
service.surgery.teeth.forty.four=$120 USD
service.surgery.teeth.sixty.six=$150 USD
service.surgery.teeth.sixty.seven=$200 USD
privacy.title=Privacy Policy
privacy.header=Welcome to Vetlog Privacy Policy
privacy.description=Vetlog is a web application aka website, that allows you to register your pets and their medical history. We are committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our website. Please read this Privacy Policy carefully. IF YOU DO NOT AGREE WITH THE TERMS OF THIS PRIVACY POLICY, PLEASE DO NOT ACCESS THE SITE.
privacy.information.title=Information We Collect
privacy.information.description=We collect personal information that you voluntarily provide to us when registering at the website expressing an interest in obtaining information about us or our services, when participating in activities on the website.
privacy.usage.title=Use of Your Information
privacy.usage.description=Having accurate information about you and your pets permits us to provide you with a smooth, efficient, and customized experience. Specifically, we may use information collected about you via the website to:
privacy.usage.list=Create and manage your account and your pets medical history.
privacy.disclosure.title=Disclosure of Your Information
privacy.disclosure.description=We will NOT share any information we have collected about you or your pets with any third party entity.
privacy.security.title=Security of Your Information
privacy.security.description=We use authentication, authorization and filters to handle user's access to the website, we don't know your password, since we use the BCrypt strong hashing function to store them, and other security measures to help protect your personal information. We hereby state, to the best of our knowledge and belief that your information is secure, If you find any security vulnerability that has been inadvertently caused by us, or have any question regarding how the website protects your privacy, please contact us and we will be happy to assist you.
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/i18n/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,15 @@ service.surgery.teeth.twenty.two=$1400 MXN
service.surgery.teeth.forty.four=$2100 MXN
service.surgery.teeth.sixty.six=$2900 MXN
service.surgery.teeth.sixty.seven=$3600 MXN
privacy.title=Aviso de Privacidad
privacy.header=Bienvenidos al aviso de privacidad de Vetlog
privacy.description=Vetlog es una aplicación web ó sitio web, que te permite registrar tus mascotas y su historial médico. Estamos comprometidos a proteger tu privacidad. Esta Política de Privacidad explica cómo recopilamos, usamos, divulgamos y protegemos tu información cuando visitas nuestro sitio web. Por favor, lee esta Política de Privacidad cuidadosamente. SI NO ESTÁS DE ACUERDO CON LOS TÉRMINOS DE ESTA POLÍTICA DE PRIVACIDAD, POR FAVOR NO ACCEDAS AL SITIO.
privacy.information.title=Información que Recopilamos
privacy.information.description=Recopilamos información personal que nos proporcionas voluntariamente al registrarte en el sitio web expresando interés en obtener información sobre nosotros o nuestros servicios, al participar en actividades en el sitio web.
privacy.usage.title=Uso de tu Información
privacy.usage.description=Tener información precisa sobre ti y tus mascotas nos permite proporcionarte una buena experiencia, eficiente y personalizada. Específicamente, podemos usar la información recopilada sobre ti a través del sitio web para:
privacy.usage.list=Crear y administrar tu cuenta y el historial médico de tus mascotas.
privacy.disclosure.title=Divulgación de tu Información
privacy.disclosure.description=No compartiremos ninguna información que hayamos recopilado sobre ti o tus mascotas con ninguna entidad de terceros.
privacy.security.title=Seguridad de tu Información
privacy.security.description=Usamos autenticación, autorización y filtros para manejar el acceso de los usuarios al sitio web, no conocemos tu contraseña, ya que usamos la función de hash BCrypt para almacenarlas, y otras medidas de seguridad estándar para ayudar a proteger tu información personal. Por la presente declaramos, según nuestro leal saber y entender, que tu información está segura. Si encuentras alguna vulnerabilidad de seguridad que haya sido causada inadvertidamente por nosotros, o tienes alguna pregunta sobre cómo el sitio web protege tu privacidad, por favor contáctanos en [email protected] y con gusto te apoyamos.
3 changes: 2 additions & 1 deletion src/main/resources/templates/fragments/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<a th:href="@{/}"><i th:text="#{home.name}"/></a> |
<a th:href="@{/pet/list}"><i th:text="#{home.list.name}"/></a> |
<a th:href="@{/pet/create}"><i th:text="#{home.register.name}"/></a> |
<a th:href="@{/pet/giveForAdoption}"><i th:text="#{adoption.name}"/></a>
<a th:href="@{/pet/giveForAdoption}"><i th:text="#{adoption.name}"/></a> |
<a th:href="@{/privacy/show}"><i th:text="#{privacy.title}"/></a>
</div>
</div>
<div class="row margin-top">
Expand Down
52 changes: 52 additions & 0 deletions src/main/resources/templates/privacy/show.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
<title th:text="#{privacy.title}"></title>
<head th:insert="~{fragments/include}"/>
</head>
<body class="login">
<div th:insert="~{fragments/header}"/>
<br/><br/>
<br/><br/>
<br/><br/>
<h3 class="text-center" th:text="#{privacy.header}"></h3>
<br/>
<div class="container">
<div class="row">
<div class="col-lg-4 col-lg-offset-4">
<div class="portlet portlet-green">
<div class="portlet-body">
<p th:text="#{privacy.description}"></p>
</div>
</div>
<h4 th:text="#{privacy.information.title}"></h4>
<div class="portlet portlet-green">
<div class="portlet-body">
<p th:text="#{privacy.information.description}"></p>
</div>
</div>
<h4 th:text="#{privacy.usage.title}"></h4>
<div class="portlet portlet-green">
<div class="portlet-body">
<p th:text="#{privacy.usage.description}"></p>
<p th:text="#{privacy.usage.list}"></p>
</div>
</div>
<h4 th:text="#{privacy.disclosure.title}"></h4>
<div class="portlet portlet-green">
<div class="portlet-body">
<p th:text="#{privacy.disclosure.description}"></p>
</div>
</div>
<h4 th:text="#{privacy.security.title}"></h4>
<div class="portlet portlet-green">
<div class="portlet-body">
<p th:text="#{privacy.security.description}"></p>
</div>
</div>
</div>
</div>
</div>
<div th:insert="~{fragments/footer}"/>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2024 Jose Morales [email protected]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.vetlog.controller;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;

@Slf4j
@SpringBootTest
@AutoConfigureMockMvc
class PrivacyControllerTest {

@Autowired
private MockMvc mockMvc;

@Test
@DisplayName("showing privacy page")
void shouldShowHomePage(TestInfo testInfo) throws Exception {
log.info("Running: {}", testInfo.getDisplayName());
mockMvc.perform(get("/privacy/show")).andExpect(status().isOk()).andExpect(view().name("privacy/show"));
}
}

0 comments on commit aae724d

Please sign in to comment.