Skip to content

Merge updates from upstream #1

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
becdc29
Prettify header
chulanovskyi-bs Nov 21, 2019
d892ad5
Merge pull request #42 from chulanovskyi-bs/patch-1
tburch Nov 21, 2019
ba9a73c
Use HTTPS instead of HTTP to resolve dependencies
JLLeitschuh Feb 11, 2020
abb7700
Merge pull request #47 from JLLeitschuh/fix/JLL/use_https_to_resolve_…
tburch Feb 11, 2020
be9dbba
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 29, 2021
abb32c8
Merge pull request #73 from tburch/dependabot/add-v2-config-file
tburch Jun 25, 2021
62dbd1b
removing old jsonblob
tburch Sep 14, 2021
e7fc468
new jsonblob
tburch Sep 14, 2021
fe3349a
Make sure to expose CORS headers. Fixes #96
tburch Sep 30, 2021
714a708
dependency cleanup
tburch Sep 30, 2021
ddfd59e
fix adsense config
tburch Oct 1, 2021
86c50cf
not used
tburch Oct 1, 2021
e9cad0d
don't print the stack trace when we can't read
tburch Oct 1, 2021
8047e1c
add flag to copy the object within S3 to reset the lifecycle
tburch Oct 1, 2021
756b859
Fix bug in pruner that didn't handle compressed blobs
tburch Oct 1, 2021
046ca3e
log how long the pruning took
tburch Oct 1, 2021
80cbee3
move concurrency setting
tburch Oct 1, 2021
8e749bd
delete before emitting
tburch Oct 1, 2021
41e1144
Make the `JsonBlobStore` that's used configuration driven.
tburch Oct 22, 2021
5a940f4
1.0
tburch Oct 23, 2021
a38ae79
Merge branch 'release/1.0'
tburch Oct 23, 2021
8281b9b
latest logback
tburch Dec 16, 2021
e3fff7b
Merge branch 'hotfix/latest_logback'
tburch Dec 16, 2021
cf0f589
fix master version
tburch Dec 16, 2021
9e1f388
Make sure to check that the blob exists before updating or deleting it.
tburch Jul 7, 2022
6ebec9b
bump version
tburch Jul 7, 2022
00b9e1f
Merge branch 'hotfix/1.0.2'
tburch Jul 7, 2022
94a2eef
Allow PUTs to create blobs as long as the id can be resolved
tburch May 6, 2023
bb703c1
switch to new GA
tburch Apr 6, 2024
17e4974
Fixes #106 - validate that PUT requests contain valid JSON
tburch Feb 17, 2025
d8a001f
Merge pull request #107 from tburch/validate-put-request-json
tburch Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "12:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: org.projectlombok:lombok
versions:
- 1.18.18
- dependency-name: org.mongodb:mongo-java-driver
versions:
- 3.12.7
- dependency-name: org.apache.commons:commons-lang3
versions:
- "3.11"
30 changes: 13 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
*.iws
*Db.properties
*Db.script
.settings
stacktrace.log
/*.zip
/plugin.xml
/*.log
/*DB.*
/cobertura.ser
Thumbs.db
.DS_Store
/target/
/out/
/web-app/plugins
/web-app/WEB-INF/classes
.classpath
.project
.gradle
build/
target/
out/
.idea
*.iml
*.ipr
.idea
*.iws
.project
.settings
.classpath
.factorypath
src/main/resources/application-local.yml
src/main/resources/application-prod.yml
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion CHECKS

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
JSON Blob
========
## Micronaut 2.4.0 Documentation

JSON Blob was created to help parallelize client/server development. Mock JSON responses can be defined and stored using the online editor and then clients can use the JSON Blob API to retrieve and update the mock responses.
- [User Guide](https://docs.micronaut.io/2.4.0/guide/index.html)
- [API Reference](https://docs.micronaut.io/2.4.0/api/index.html)
- [Configuration Reference](https://docs.micronaut.io/2.4.0/guide/configurationreference.html)
- [Micronaut Guides](https://guides.micronaut.io/index.html)
---

[![Build Status](https://travis-ci.org/tburch/jsonblob.svg?branch=master)](https://travis-ci.org/tburch/jsonblob)
## Feature assertj documentation

- [https://assertj.github.io/doc/](https://assertj.github.io/doc/)

## Feature http-client documentation

- [Micronaut HTTP Client documentation](https://docs.micronaut.io/latest/guide/index.html#httpClient)

## Feature management documentation

- [Micronaut Management documentation](https://docs.micronaut.io/latest/guide/index.html#management)

##Building & Running JSON Blob
1. To run JSON Blob, you'll need the following things installed:
- Java (version 1.8+)
- Maven
1. Build the JSON Blob jar - from the command line run `mvn clean package`.
1. Start JSON Blob - from the command line run `java -Ddw.blobManager.fileSystemBlogDataDirectory=<PATH TO STORE BLOBS ON THE FILESYSTEM> -jar target/jsonblob.jar server target/config/jsonblob.yml`. You'll need to replace `<PATH TO STORE BLOBS ON THE FILESYSTEM>` with the path where you want to store blobs on the file system.
93 changes: 93 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
plugins {
id("org.jetbrains.kotlin.jvm") version "1.5.21"
id("org.jetbrains.kotlin.kapt") version "1.5.21"
id("org.jetbrains.kotlin.plugin.allopen") version "1.5.21"
id("com.github.johnrengelman.shadow") version "6.1.0"
id("io.micronaut.application") version "2.0.2"
}

version = "1.0.2"
group = "com.jsonblob"

val kotlinVersion= project.properties["kotlinVersion"]
val testContainersVersion= project.properties["testContainersVersion"]
val jvmBrotliVersion= project.properties["jvmBrotliVersion"]

repositories {
mavenCentral()
jcenter()
}

micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("jsonblob.*")
}
}

dependencies {
implementation("io.micronaut:micronaut-validation")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut:micronaut-management")
implementation("io.micronaut.micrometer:micronaut-micrometer-core")
implementation("io.micronaut.micrometer:micronaut-micrometer-registry-new-relic")
implementation("io.micronaut.aws:micronaut-aws-sdk-v2")
implementation("software.amazon.awssdk:s3")
implementation("com.fasterxml.uuid:java-uuid-generator:3.1.4")
implementation("org.mongodb:mongo-java-driver:3.2.2")
implementation("com.google.guava:guava:30.1-jre")
implementation("io.github.microutils:kotlin-logging-jvm:2.0.6")
implementation("com.nixxcode.jvmbrotli:jvmbrotli:$jvmBrotliVersion")
implementation("io.micronaut.views:micronaut-views-handlebars")
implementation("commons-codec:commons-codec:1.15")

runtimeOnly("ch.qos.logback:logback-classic:1.2.8")
runtimeOnly("com.nixxcode.jvmbrotli:jvmbrotli-darwin-x86-amd64:$jvmBrotliVersion")
runtimeOnly("com.nixxcode.jvmbrotli:jvmbrotli-linux-x86-amd64:$jvmBrotliVersion")

testImplementation(platform("org.junit:junit-bom:5.7.1"))
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("io.micronaut.test:micronaut-test-junit5")
testImplementation("io.micronaut:micronaut-http-client")
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin")
testImplementation("org.assertj:assertj-core")
testImplementation("org.skyscreamer:jsonassert:1.5.0")
testImplementation("org.testcontainers:testcontainers:$testContainersVersion")
testImplementation("org.testcontainers:junit-jupiter:$testContainersVersion")
testImplementation("org.testcontainers:localstack:$testContainersVersion")
testImplementation("com.amazonaws:aws-java-sdk-s3:1.11.1030") // for localstack

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("com.nixxcode.jvmbrotli:jvmbrotli-darwin-x86-amd64:$jvmBrotliVersion")
}


application {
mainClass.set("jsonblob.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("1.8")
}

tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
test {
useJUnitPlatform()
}
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
micronautVersion=2.5.13
kotlinVersion=1.4.21
jvmBrotliVersion=0.2.0
testContainersVersion=1.15.3
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
#!/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" "$@"
Loading