Commit d3d98737 authored by Aaron Gutierrez's avatar Aaron Gutierrez

Initial commit

parents
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/*
* Copyright 2007-present the original author or authors.
*
* 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
*
* https://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.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
DROP TABLE IF EXISTS `PILO_ENTITY` CASCADE;
DROP TABLE IF EXISTS `TiposDeMotivo` CASCADE;
DROP TABLE IF EXISTS `XDF_ENTIDADES` CASCADE;
DROP TABLE IF EXISTS `Estados` CASCADE;
DROP TABLE IF EXISTS `Motivos` CASCADE;
CREATE TABLE PILO_ENTITY
(
`ENT_ID` BIGINT NOT NULL COMMENT 'Identificador único del tipo de la entidad, secuencial auto generado.',
`ENT_NAME` VARCHAR(50) NOT NULL COMMENT 'Nombre de la entidad.',
`ENT_DESC` VARCHAR(50) NOT NULL COMMENT 'Descripción de la entidad',
CONSTRAINT `PK_Entidades` PRIMARY KEY (`ENT_ID` ASC)
)
COMMENT='Catálogo de entidades del sistema'
;
CREATE TABLE `Estados`
(
`idEstado` BIGINT NOT NULL,
`idEntidad` BIGINT NULL,
`codEstado` BIGINT NULL,
`aliasEstado` VARCHAR(20) NULL,
`descEstado` VARCHAR(50) NULL,
CONSTRAINT `PK_Estados` PRIMARY KEY (`idEstado` ASC)
)
;
CREATE TABLE `Motivos`
(
`idMotivo` BIGINT NOT NULL COMMENT 'Identificador de motivo, secuencial auto generado.',
`codMotivo` BIGINT NULL COMMENT 'Código de motivo para el negocio.',
`descMotivo` VARCHAR(50) NULL COMMENT 'Descripción motivo.',
`idTipoDeMotivo` BIGINT NULL,
CONSTRAINT `PK_Motivos` PRIMARY KEY (`idMotivo` ASC)
)
COMMENT='Motivos para usos varios.'
;
CREATE TABLE `TiposDeMotivo`
(
`idTipoDeMotivo` BIGINT NOT NULL COMMENT 'Identificador único del tipo de motivo, secuencial auto generado.',
`codTipoDeMotivo` BIGINT NOT NULL COMMENT 'Código del tipo de motivo para el negocio.',
`descTipoDeMotivo` VARCHAR(50) NOT NULL COMMENT 'Descripción del tipo de motivo.',
`aliasTipoDeMotivo` VARCHAR(20) NOT NULL COMMENT 'Alias del tipo de motivo para uso desde el sistema.',
CONSTRAINT `PK_TiposDeMotivo` PRIMARY KEY (`idTipoDeMotivo` ASC)
)
COMMENT='Agrupan los motivos.'
;
\ No newline at end of file
This diff is collapsed.
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-arq</artifactId>
<version>3.1.0</version>
</parent>
<groupId>com.bytesw.bytebot</groupId>
<modelVersion>4.0.0</modelVersion>
<artifactId>bytebot-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>${packaging.type}</packaging>
<properties>
<xdf.version>3.1.0</xdf.version>
<docker.image.prefix>bytesw</docker.image.prefix>
<docker.image.name>bytebot-service</docker.image.name>
<packaging.type>war</packaging.type>
<json-path.version>2.4.0</json-path.version>
<org.everit.json.schema.version>1.5.1</org.everit.json.schema.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-coreweb</artifactId>
<version>${xdf.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>7.37.0.Final</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
</dependency>
<dependency>
<groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>${org.everit.json.schema.version}</version>
</dependency>
<!-- Inicio de Lock para scheduling -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
</dependency>
<!-- Fin de Lock para scheduling -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jparams</groupId>
<artifactId>to-string-verifier</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<!-- websocket-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
<version>0.37</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>sockjs-client</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>stomp-websocket</artifactId>
<version>2.3.3</version>
</dependency>
<!-- fin de web sockets -->
<!-- ibatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>default</id>
<activation>
<property>
<name>default</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>weblogic</id>
<activation>
<property>
<name>weblogic</name>
</property>
</activation>
<properties>
<packaging.type>war</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>nexus</id>
<activation>
<property>
<name>nexus</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
package com.bytesw.bytebot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication(scanBasePackages = "com.bytesw")
@ImportResource("classpath:application-config.xml")
@EnableCaching
@EnableAspectJAutoProxy
@EnableFeignClients(basePackages = "com.bytesw")
public class BytebotApplication {
public static void main(String[] args) {
SpringApplication.run(BytebotApplication.class, args);
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
@Controller
@Log4j2
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
public class LoginController {
@RequestMapping(value = {"/home"}, method = RequestMethod.GET)
public final String home(HttpServletRequest request, HttpServletResponse response, Principal principal) {
System.out.println("* home *****> " + request.getSession(false).getId());
System.out.println(request.getSession().getAttribute("username"));
return "home";
}
@RequestMapping(value = {"/mylogin"})
public final String mylogin(HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println("* mylogin *****> " + request.getSession(false).getId());
System.out.println(request.getSession().getAttribute("username"));
return "home";
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;
/**
* @author Marco A. Ortíz García
* @version 2019-03-16.
* <p>
* <p>
* Copyright (c) 2018 Byte, S.A. Todos los derechos reservados.
* <p>
* Este software constituye información confidencial y propietaria de Byte, S.A.
* ("Información Confidencial"). Usted no debe develar dicha Información
* Confidencial y debe usarla de acuerdo con los términos de aceptación de
* licencia de uso que firmó con Byte.
*/
@Controller
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
@Log4j2
public class LogoutController {
@Value("${application.services.security.token-key:#{null}}")
private String tokenKey;
@RequestMapping(value = {"/goodbye"}, method = RequestMethod.GET)
public final String goodbye(HttpServletRequest request, HttpServletResponse response, Principal principal, Model model) {
model.addAttribute("token", tokenKey != null);
return "goodbye";
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;
@Controller
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
@Log4j2
public class TokenFailController {
@RequestMapping(value = {"/token-fail"}, method = RequestMethod.GET)
public final String goodbye(HttpServletRequest request, HttpServletResponse response, Principal principal) {
return "/token-fail";
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<import resource="classpath:applicationContext-aop.xml" />
<import resource="classpath:applicationContext-datasource.xml" />
<import resource="classpath:applicationContext-scheduler.xml" />
</beans>
spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration
server:
servlet.context-path: ${APPLICATION_PATH:/bytebot}
port: ${APPLICATION_PORT:9077}
web:
static-content-location: file:e:/proyects/BYTE_BOT/bytebot-projects/dist/bytebot-html/
#NOTA debe terminar con /
security:
require-ssl: false
hystrix.shareSecurityContext: true
# oracle
endpoints:
shutdown:
enabled: true
management:
endpoints:
shutdown.enabled: true
web.exposure.include: "*"
application:
test: ENC(OEchnTXpIZnCVdPNthgCZBfQjMt1AUS1)
name: xdf-example
license:
applicationId: test
clientId: test
hosts: 38F9D38DD09
type: web # web o service
security:
enabled: true
encryption-key: ENC(0WRfEFi8lYjlJj2bj37z4TRu4zmPnmXl4zM4Jpdh1H8=)*
web:
server: docker # weblogic, docker
ignore:
path: /v2/api-docs, /configuration/**, /swagger-resources/**, /swagger-ui.html, /webjars/**, /api-docs/**, /resources/**, /css/**, /js/**, /fonts/**, /img/**, /modules/**, /system/**, /views/**, /font-awesome/**, /translations/**, /bower_components/**, /cache.manifest, /favicon.ico, /service/file
goodbyeURL: /goodbye
api.info:
title: 'pilotoXDF Service'
description: 'API para el desarrollo de software'
version: '1.0.0'
terms-of-service-url: 'https://es.wikipedia.org/wiki/byteXDF4Java'
license: 'Open source licensing'
license-url: 'https://help.github.com/articles/open-source-licensing/'
services:
authorization-service.url: http://localhost:7580
security: oauth2sso # none, basic, oauth2sso
security.method: true
security-exclude: /service/oauth/userinfo, /actuator/**, /mylogout, /login, /logout, /goodbye, /error, /anon, /cache.manifest, /favicon.ico, /service/file, /goodbye
messaging:
queue-support: activemq
multi-tenant: false
clustering: true
database: true
send-email: false
jt400: false
rabbitMQ: false
webservices: false
statistics.type: log # database or log
messaging:
queue-test: action_queue.fifo
topic-test: topic-test
# email.info:
# smtp:
# host: smtp.gmail.com
# port: 587
# username: mortiz@bytesw-bfm.com
# encrypted.password: ENC(OEchnTXpIZnCVdPNthgCZBfQjMt1AUS1)
# from.email: mortiz@bytesw-bfm.com
# jt400.info:
# username: usuario24
# password: poiuyt5
# host: 192.168.27.30
# queue-name: V4STCPGM.LIB/COLGENESIS.DTAQ
# rabbitMQ.info:
# host: localhost
# port: 5672
# queue-name: task_queue
spring:
main:
allow-bean-definition-overriding: true
mbeans.exclude: dataSource
application:
name: xdf-example
datasource:
database-type: mysql
schemaName: BYTESGA
url: jdbc:mysql://localhost:43306/BYTESGA?useSSL=false
driverClassName: 'com.mysql.cj.jdbc.Driver'
username: root
password: secret
minimum-idle: 10
maximum-pool-size: 10
validationQuery: SELECT 1
testWhileIdle: true
hikari.registerMbeans: true
security:
basepath: http://localhost:9077/piloto-xdf
provider: byte # oracle, amazon
oauth2-client:
clientId: xdf-client
clientSecret: xdf-secret
accessTokenUri: http://192.168.1.100:8080/oauth/token
userAuthorizationUri: http://192.168.1.100:8080/oauth/authorize
oauth2-resource:
userInfoUri: http://192.168.1.100:8080/oauth/userinfo
logoutUri: http://192.168.1.100:8080/oauth/userlogout
jpa:
open-in-view: false
properties.hibernate:
dialect: org.hibernate.dialect.MySQL5Dialect
format_sql: false
hbm2ddl.auto: none
show-sql: true
#session.store-type: jdbc
activemq.broker-url: tcp://localhost:61616
logging.level.root: INFO
logging.pattern.console: '%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n'
logging.level.com.zaxxer.hikari: ERROR
logging.level.springfox.documentation: ERROR
logging.level.org.kie.api.internal: ERROR
logging.level.org.springframework: ERROR
logging.level.org.apache.catalina.core: ERROR
logging.level.org.apache: ERROR
logging.level.org.quartz: ERROR
logging.level.com.bytesw-bfm.xdf.example.security: DEBUG
logging.level.net.javacrumbs.shedlock: ERROR
logging.level.com.github.alturkovic.lock: ERROR
logging.level.com.ulisesbocchio.jasyptspringboot: ERROR
logging.level.org.hibernate.SQL: ERROR
logging.level.org.hibernate.type: ERROR
logging.level.net.sf.hibernate.type: ERROR
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
">
<aop:aspectj-autoproxy proxy-target-class="true" />
<aop:config>
<aop:pointcut id="allServiceMethodsPointcut" expression="execution(* com.bytesw.xdf.example.controller.*.*(..)) || execution(* com.bytesw.xdf.controller.*.*(..))" />
<!--<aop:pointcut id="authResourcesMethodsPointcut" expression="execution(* org.springframework.security.oauth2.client.OAuth2RestTemplate.*(..))" />-->
<aop:advisor pointcut-ref="allServiceMethodsPointcut" advice-ref="statisticsInterceptor" />
<!--<aop:advisor pointcut-ref="authResourcesMethodsPointcut" advice-ref="authResourcerInterceptor" />-->
</aop:config>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
<context:annotation-config />
<jpa:repositories base-package="com.bytesw.xdf.dao" />
<jpa:repositories base-package="com.bytesw.xdf.security.dao" />
<jpa:repositories base-package="com.bytesw.bytebot.dao" />
<!-- <jpa:repositories base-package="com.bytesw.xdf.license.dao" />-->
<!-- <jpa:repositories base-package="com.bytesw.xdf.statistics.dao" />-->
<!--<context:component-scan base-package="com.bytesw.coreweb.seguridad.dao.jdbc" />-->
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">
<bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="2" />
<property name="maxPoolSize" value="5" />
<property name="queueCapacity" value="5" />
<property name="waitForTasksToCompleteOnShutdown" value="true" />
<property name="rejectedExecutionHandler">
<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
</property>
</bean>
<!--<bean name="testServiceJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="name" value="SCH00001: Test Service"/>
<property name="group" value="Security"/>
<property name="targetObject" ref="testService"/>
<property name="targetMethod" value="saludar"/>
</bean>
<bean id="testServiceTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="testServiceJob"/>
<property name="cronExpression" value="0/1 * * * * ?"/>
</bean>-->
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bytesw.xdf.dao.jdbc.AuditMapper" >
<!-- In Config XML file -->
<cache readOnly="true"></cache>
<select id="getAuditData" resultType="hashmap" flushCache="true">
SELECT ${columns},
SECURITY_AUDIT.REV_USER as username,
SECURITY_AUDIT.REV_MODIF as date,
${tableName}.REVTYPE as revisionType
FROM ${tableName}
LEFT JOIN SECURITY_AUDIT
ON ${tableName}.REV = SECURITY_AUDIT.REV_ID
WHERE ${pkName} = #{pkValue} ORDER BY SECURITY_AUDIT.REV_MODIF DESC
LIMIT ${page},${pageSize}
</select>
<select id="countAuditData" resultType="int" flushCache="true">
SELECT count(${pkName})
FROM ${tableName}
WHERE ${pkName} = #{pkValue}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n</pattern>
</encoder>
</appender>
<root level="ALL">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.apache" level="off" />
<logger name="org.springframework" level="info" />
<logger name="javax.management" level="info" />
<logger name="com.bytesw.xdf.example" level="off" />
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<properties resource="mybatis.properties" />
<typeAliases>
</typeAliases>
<mappers>
<mapper resource="config/mappers/xdf/${database-type-xdf}/AuditMapper.xml"/>
</mappers>
</configuration>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Spring Session + JDBC Demo</title>
</head>
<body>
<div>
<form th:action="@{/messages}" method="post">
<textarea name="msg" cols="40" rows="4"></textarea>
<input type="submit" value="Save"/>
</form>
<p><a href="/">refresh</a></p>
</div>
<div>
<h2>Messages</h2>
<ul th:each="m : ${messages}">
<li th:text="${m}">msg</li>
</ul>
</div>
<H3>Mensaje a cola</H3>
<div>
<form th:action="@{/sendToQueue}" method="post">
ID: <input name="message" />
<input type="submit" value="Send"/>
</form>
</div>
<H3>Mensaje a topico</H3>
<div>
<form th:action="@{/sendToTopic}" method="post">
ID: <input name="message" />
<input type="submit" value="Send"/>
</form>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>OAuth Server Index</title>
</head>
<body>
<div class="container">
<h1 class="page-header">OAuth Server Administration Dashboard </h1>
<div class="row">
<div class="col-md-12" >
<span sec:authorize="isAuthenticated()" style="display: inline-block;">
<a href="/logout">Sign Out</a>
</span>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Byte - Login</title>
<!-- Vendor CSS -->
<!-- <link href="css/animate.min.css" rel="stylesheet" />-->
<!-- <link href="css/material-design-iconic-font.min.css" rel="stylesheet" />-->
<!-- CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script>
function loginButton() {
window.location.href='./';
}
</script>
<style>
body {
color: #676a6c;
background-color: #f3f3f4;
}
.centered {
position: absolute;
left: 50%;
top: 40%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
h3 {
display: inherit;
font-weight: 600;
}
.text-center {
text-align: center;
}
</style>
</head>
<body>
<div class="row centered" >
<div class="col-lg-12">
<div class="ibox">
<div class="row">
<div class="text-center">
<i class="zmdi zmdi-sign-in" style="font-size: 80px"></i>
<h3 class="text-navy"> Su sesión ha finalizado</h3>
<p>Para iniciar sesión nuevamente presione aquí: <a href="#" onclick="loginButton()">Ingresar</a></p>
</div>
</div>
<div class="row text-center">
<div style="
display: inline-flex;
">
<img class="logo-byte" src="data:image/png;base64,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" style="
height: 20px;
width: 20px;
"> <p class="m-t"> <small class="ng-binding" style="
line-height: 24px;
">&nbsp;Latin American Byte © 2020</small> </p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico" title="Favicon">
<title>Spring Security SSO Client 2</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="col-sm-12">
<h1>Spring Security SSO and logout</h1>
<a href="#" onclick="logout()"><font
class="lightTextLarge">Log Out</font></a>
</div>
</div>
</body>
<script type="text/javascript">
function setTimeZoneInCookie() {
console.log("creando cookie");
var _myDate = new Date();
var _offset = _myDate.getTimezoneOffset();
document.cookie = "TIMEZONE_COOKIE=" + _offset; //Cookie name with value
}
setTimeZoneInCookie();
function logout() {
window.location.href='logout';
}
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico" title="Favicon">
<title>Spring Security SSO Client 2</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="col-sm-12">
<h1>Spring Security SSO and logout</h1>
<form name="logout_form" id="logout_form" method="post" action="/logout1">
<input type="hidden" name="scope" value="read">
<input type="submit" value="Logout"/>
</form>
<a href="#" onclick="login()"><font
class="lightTextLarge">Log Out</font></a>
<a href="#" onclick="logout()"><font
class="lightTextLarge">Log Out</font></a>
</div>
</div>
</body>
<script type="text/javascript">
function setTimeZoneInCookie() {
console.log("creando cookie");
var _myDate = new Date();
var _offset = _myDate.getTimezoneOffset();
document.cookie = "TIMEZONE_COOKIE=" + _offset; //Cookie name with value
}
setTimeZoneInCookie();
function readCookie(name) {
return (name = new RegExp('(?:^|;\\s*)' + ('' + name).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '=([^;]*)').exec(document.cookie)) && name[1];
}
console.log(document.cookie);
function login() {
window.location.href='mylogin';
}
function logout() {
var url = 'https://idcs-204e4341c8eb4484b0edba0934b4d507.identity.oraclecloud.com/oauth2/v1/userlogout?post_logout_redirect_uri=http://localhost:8080/logout&id_token_hint='+readCookie('XSRF-TOKEN');
window.location.href = url;
}
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Spring Session + JDBC Demo</title>
</head>
<body>
<h3>Good bye</h3>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment