YKE4L2LBHEWB7PUPGLGDVKEAWYGLL3HB2JLY65TYGBELV2H6N55AC
package cloud.honeydue
import cloud.honeydue.model.Chore
import cloud.honeydue.model.User
import cloud.honeydue.repository.ChoreRepository
import cloud.honeydue.repository.UserRepository
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.*
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit.jupiter.SpringExtension
import java.sql.Date
@SpringBootTest
@ExtendWith(SpringExtension::class)
@TestMethodOrder(MethodOrderer.OrderAnnotation::class)
class HoneyDueApplicationTests(@Autowired val userRepo: UserRepository, @Autowired val choreRepo: ChoreRepository) {
val nickname = "continuouslee"
}
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE users
(
"id" serial8 PRIMARY KEY,
"nickname" text NOT NULL,
"email_address" text NOT NULL,
"last_name" varchar(255),
"first_name" varchar(255),
"password" bytea NOT NULL
);
CREATE TABLE chores
(
"id" serial8,
"user_id" int8 NOT NULL,
"title" varchar(255) NOT NULL,
"description" text,
"due_date" date NOT NULL DEFAULT CURRENT_DATE,
"completed" boolean NOT NULL DEFAULT false,
PRIMARY KEY ("id"),
CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
INSERT INTO users ( nickname, email_address, last_name, first_name, "password" )
VALUES
( 'jediknight', 'skywalker@honeydue.cloud', 'skywalker', 'luke', pgp_sym_encrypt ( 'P@ssw0rd', 'wandering-firefly-4506' ) );
INSERT INTO users ( nickname, email_address, last_name, first_name, "password" )
VALUES
( 'ladyjedi', 'leia@honeydue.cloud', 'leia', 'princess', pgp_sym_encrypt ( 'P@ssw0rd', 'wandering-firefly-4506' ) );
INSERT INTO users ( nickname, email_address, last_name, first_name, "password" )
VALUES
( 'darthvader', 'vader@honeydue.cloud', 'darth', 'vader', pgp_sym_encrypt ( 'P@ssw0rd', 'wandering-firefly-4506' ) );
-------------------------------------------------------------------------------------------------------------
::: ::: :::::::: :::: ::: :::::::::: ::: ::: ::::::::: ::: ::: ::::::::::
:+: :+: :+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++#++ +#+ +:+ +#+ +:+ +#+ +#++:++# +#++: +#+ +:+ +#+ +:+ +#++:++#
+#+ +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+#
### ### ######## ### #### ########## ### ######### ######## ##########
-------------------------------------------------------------------------------------------------------------
# database settings
spring.datasource.url=jdbc:postgresql://honeydue.cvte4l4cmrbp.us-east-1.rds.amazonaws.com:5432/honeydue
spring.datasource.username=postgres
spring.datasource.password=honeydue
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
package cloud.honeydue.repository
import cloud.honeydue.model.User
import org.springframework.data.jpa.repository.JpaRepository
interface UserRepository : JpaRepository<User, Long> {
fun getByNickname(nickname : String): User
}
package cloud.honeydue.repository
import cloud.honeydue.model.Chore
import cloud.honeydue.model.User
import org.springframework.data.jpa.repository.JpaRepository
interface ChoreRepository : JpaRepository<Chore, Long> {
fun findByUserId(userId: Long?) : MutableSet<Chore>
}
package cloud.honeydue.model
import com.fasterxml.jackson.annotation.JsonIgnore
import org.hibernate.annotations.ColumnTransformer
import org.hibernate.annotations.OnDelete
import org.hibernate.annotations.OnDeleteAction
import javax.persistence.*
@Entity
@Table(name="users")
class User(
val nickname: String,
var emailAddress: String,
var lastName: String,
var firstName: String,
@ColumnTransformer(read = "pgp_sym_decrypt(password, 'wandering-firefly-4506')", write = "pgp_sym_encrypt(?, 'wandering-firefly-4506')")
val password: String,
@OneToMany(mappedBy = "user", cascade = arrayOf(CascadeType.ALL))
val chores: MutableList<Chore>?
) : AbstractJpaPersistable<Long>()
package cloud.honeydue.model
class Login(
val nickname: String,
val password: String
) {
}
package cloud.honeydue.model
import com.fasterxml.jackson.annotation.JsonInclude
import io.jsonwebtoken.Claims
import io.jsonwebtoken.Jws
@JsonInclude(JsonInclude.Include.NON_NULL)
class JwtResponse {
var message: String? = null
var status: Status? = null
var exceptionType: String? = null
var jwt: String? = null
var jws: Jws<Claims>? = null
enum class Status {
SUCCESS, ERROR
}
constructor() {}
constructor(jwt: String?, status: Status) {
this.jwt = jwt
this.status = status
}
constructor(jws: Jws<Claims>?, status: Status) {
this.jws = jws
this.status = status
}
}
package cloud.honeydue.model
import com.fasterxml.jackson.annotation.JsonIgnore
import java.sql.Date
import javax.persistence.*
@Entity
@Table(name="chores")
class Chore(
val title: String,
val description: String?,
val dueDate: Date,
val completed: Boolean = false,
@ManyToOne(cascade = arrayOf(CascadeType.ALL))
@JoinColumn(name = "user_id")
@JsonIgnore
var user: User?
) : AbstractJpaPersistable<Long>()
package cloud.honeydue.model
import java.lang.Exception
class AuthenticationException(errorMessage: String?) : Exception(errorMessage)
package cloud.honeydue.model
import org.springframework.data.domain.Persistable
import org.springframework.data.util.ProxyUtils
import java.io.Serializable
import javax.persistence.*
@MappedSuperclass
abstract class AbstractJpaPersistable<T : Serializable> : Persistable<T> {
companion object {
private val serialVersionUID = -5554308939380869754L
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(columnDefinition = "serial")
private var id: T? = null
override fun getId(): T? {
return id
}
/**
* Must be [Transient] in order to ensure that no JPA provider complains because of a missing setter.
*
* @see org.springframework.data.domain.Persistable.isNew
*/
@Transient
override fun isNew() = null == getId()
override fun toString() = "Entity of type ${this.javaClass.name} with id: $id"
override fun equals(other: Any?): Boolean {
other ?: return false
if (this === other) return true
if (javaClass != ProxyUtils.getUserClass(other)) return false
other as AbstractJpaPersistable<*>
return if (null == this.getId()) false else this.getId() == other.getId()
}
override fun hashCode(): Int {
return 31
}
}
package cloud.honeydue.controller
import cloud.honeydue.model.AuthenticationException
import cloud.honeydue.model.JwtResponse
import cloud.honeydue.model.Login
import cloud.honeydue.model.User
import cloud.honeydue.repository.UserRepository
import io.jsonwebtoken.Jwts
import io.jsonwebtoken.SignatureAlgorithm
import io.jsonwebtoken.io.Decoders
import io.jsonwebtoken.io.Encoders
import io.jsonwebtoken.security.Keys
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*
import java.time.Instant
import java.time.temporal.ChronoUnit
import java.util.*
@RestController
@RequestMapping("/api/v1", produces = ["application/json"])
@CrossOrigin(origins = ["*"])
class UserController(@Autowired val userRepository: UserRepository) {
var logger = LoggerFactory.getLogger(UserController::class.java)
var secret = Base64.getDecoder().decode("NHi+orxnVHNclk17zy5oFc0znVXkUh3BOQwMEbP8308=")
@PostMapping("/authenticate")
fun authenticate(@RequestBody login: Login): JwtResponse {
var user = userRepository.getByNickname(login.nickname)
return if (user.password == login.password) {
var jws = Jwts.builder().setIssuer("honeydue").setSubject(user.nickname).claim("name", user.firstName + " " + user.lastName).claim("scope", "users").setIssuedAt(
Date.from(
Instant.now())).setExpiration(Date.from(Instant.now().plus(8, ChronoUnit.HOURS))).signWith(
Keys.hmacShaKeyFor(secret)).compact()
JwtResponse(jws, JwtResponse.Status.SUCCESS)
} else {
var exception : AuthenticationException = AuthenticationException("Username/Password combination incorrect")
var jws = Jwts.builder().setIssuer("honeydue").setSubject(exception.message).compact()
JwtResponse(jws, JwtResponse.Status.ERROR)
}
}
@GetMapping("/users")
fun allUsers(): MutableList<User> {
return userRepository.findAll()
}
@GetMapping("/users/{nickname}")
fun byNickname(@PathVariable nickname: String): User? {
return userRepository.getByNickname(nickname)
}
@PostMapping("/users")
fun newUser(@RequestBody user: User): User? {
return userRepository.save(user)
}
@PutMapping("/users/{nickname}")
fun updateUser(@RequestBody updatedUser: User, @PathVariable nickname: String): User? {
var user = userRepository.getByNickname(nickname)
user.emailAddress = updatedUser.emailAddress
user.firstName = updatedUser.firstName
user.lastName = updatedUser.lastName
return userRepository.save(user)
}
@DeleteMapping("/users/{nickname}")
fun deleteUser(@PathVariable nickname: String) {
val user = userRepository.getByNickname(nickname)
user.id?.let { userRepository.deleteById(it) }
}
}
package cloud.honeydue.controller
import cloud.honeydue.model.Chore
import cloud.honeydue.repository.ChoreRepository
import cloud.honeydue.repository.UserRepository
import io.jsonwebtoken.Jwts
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.*
@RestController
@RequestMapping("/api/v1", produces = ["application/json"])
@CrossOrigin(origins = ["*"])
class ChoreController(@Autowired val userRepository: UserRepository, @Autowired val choreRepository: ChoreRepository) {
var logger = LoggerFactory.getLogger(ChoreController::class.java)
var signingKey = "NHi+orxnVHNclk17zy5oFc0znVXkUh3BOQwMEbP8308=".encodeToByteArray()
private fun parseJwtToken(token: String) : String {
var claims = Jwts.parserBuilder().setSigningKey(signingKey).build().parseClaimsJws(token)
return claims.body.subject
}
@GetMapping("/chores")
fun findChoresForNickname(@RequestHeader("Authorization") jwtToken:String): MutableSet<Chore>? {
var user = userRepository.getByNickname(parseJwtToken(jwtToken))
logger.info(user.nickname)
return choreRepository.findByUserId(user.id)
}
@PostMapping("/chores")
fun addChoreByNickname(@RequestHeader("Authorization") jwtToken:String, @RequestBody chore: Chore): MutableSet<Chore>? {
var user = userRepository.getByNickname(parseJwtToken(jwtToken))
logger.info(user.nickname)
chore.user = user
choreRepository.save(chore)
return choreRepository.findByUserId(user.id)
}
}
package cloud.honeydue
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.annotation.ComponentScan
@SpringBootApplication
class HoneyDueApplication
fun main(args: Array<String>) {
runApplication<HoneyDueApplication>(*args)
}
rootProject.name = "api"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
#!/usr/bin/env sh
#
# Copyright 2015 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.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
import org.gradle.kotlin.dsl.support.gradleApiMetadataFrom
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.4.5"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("org.flywaydb.flyway") version "7.8.1"
kotlin("jvm") version "1.4.32"
kotlin("plugin.spring") version "1.4.32"
kotlin("plugin.jpa") version "1.4.32"
kotlin("plugin.allopen") version "1.4.32"
kotlin("plugin.noarg") version "1.4.32"
`java-library`
`maven-publish`
}
group = "cloud.honeydue"
version = "1.0.0-SNAPSHOT"
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/leefaus/honeydue-api")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>("gpr") {
artifact(tasks.getByName("bootJar"))
}
}
}
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
tasks.jar {
manifest {
attributes(mapOf("Implementation-Title" to project.name,
"Implementation-Version" to project.version))
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.flywaydb:flyway-core")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-allopen")
implementation("org.jetbrains.kotlin:kotlin-noarg")
implementation("io.jsonwebtoken:jjwt-api:0.11.2")
implementation("io.jsonwebtoken:jjwt-impl:0.11.2")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.2")
// Uncomment the next line if you want to use RSASSA-PSS (PS256, PS384, PS512) algorithms:
runtimeOnly("org.bouncycastle:bcprov-jdk15on:1.68")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
flyway {
url = "jdbc:postgresql://localhost:5432/honeydue"
user = "postgres"
password = "cockp1t"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
# crossplane-opa-springboot-template
MIT License
Copyright (c) 2021 Lee Faus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
.git
.DS_Store
image: continuouslee/gradle-kotlin:latest
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages: # List of stages for jobs, and their order of execution
- build
build-job: # This job runs in the build stage, which runs first.
stage: build
script: gradle --build-cache assemble
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle