Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 31 additions & 5 deletions .github/workflows/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ run() {
cd docker || exit 1
ddir=$(pwd)
( cd certs || exit 1 ; ./generate-certs.sh )
export REG_API_IMAGE=nasapds/registry-api-service:latest
docker image inspect nasapds/registry-api-service:latest >/dev/null
export REG_API_IMAGE=nasapds/registry-api-service:${registry_api_tag:-latest}
docker image inspect "nasapds/registry-api-service:${registry_api_tag:-latest}" >/dev/null
echo "launch services"
docker compose \
--ansi never \
Expand Down Expand Up @@ -110,15 +110,35 @@ run() {
return $status
}

registry_api_tag=""
registry_branch=""
verbose=false
verify=false
for arg in "$@"; do
case "$arg" in
--verbose) verbose=true ;;
--verify) verify=true ;;
--registry-branch=*) registry_branch="${arg#--registry-branch=}" ;;
--registry-api-tag=*) registry_api_tag="${arg#--registry-api-tag=}" ;;
*)
echo "Error: Invalid argument '$arg'"
echo "Usage: $0 [--verify] [--verbose]"
echo "Usage: $0 [--verify] [--verbose] [--registry-branch=<branch>] [--registry-api-tag=<tag>]"
echo
echo "Options:"
echo " --verify Verify that the last integration test result is"
echo " still valid for the current commit (no re-run)."
echo " --verbose Print docker compose logs after the test run."
echo " --registry-branch=<branch> Check out the given branch of NASA-PDS/registry"
echo " for the integration tests instead of the default"
echo " behaviour, which auto-selects a branch whose name"
echo " matches the current registry-api branch (falling"
echo " back to the registry default branch when no match"
echo " is found)."
echo " --registry-api-tag=<tag> Use the given Docker Hub tag for the registry-api"
echo " service image (nasapds/registry-api-service:<tag>)"
echo " instead of building the image from the current"
echo " source. When this option is set the Maven build and"
echo " docker build steps are skipped."
exit 1 ;;
esac
done
Expand All @@ -136,10 +156,16 @@ echo "temporary directory: $tdir"
trap 'rm -rf "$tdir"' EXIT
export tdir
cd "$tdir" || exit 1
echo "Cloning NASA-PDS/registry repository into temporary directory: $tdir"
git clone --quiet https://github.com/NASA-PDS/registry.git
cd registry || exit 1
if git show-ref --verify --quiet refs/remotes/origin/"$branchname"
if [ -n "$registry_branch" ]
then
echo "Switching to requested registry branch: $registry_branch"
git switch "$registry_branch"
elif git show-ref --verify --quiet refs/remotes/origin/"$branchname"
then
echo "Switching to matching registry branch: $branchname"
git switch "$branchname"
fi
echo "registry being used"
Expand Down Expand Up @@ -214,7 +240,7 @@ if $verify; then
else
cd "$rdir" || exit 1
clean || exit 2
build || exit 3
[ -z "$registry_api_tag" ] && { build || exit 3; }
cd "$tdir"/registry || exit 1
( set -o pipefail ; run 2>&1 | tee "$rdir"/integration_tests.rpt.txt ) \
&& status=success || status=failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/last_integration_test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"api_gitrev": "b0711d49e711ff012dca26ff455682b29a5ca99c+",
"reg_gitrev": "dda5e706096b4e50575006f85f82f3c111d05b1f",
"api_gitrev": "a550f43949944ed5446f15e9bc49a1d667994509+",
"reg_gitrev": "bd844d424da08fc692ee5b6e9dc7b2ed91a3e2b9",
"status": "success"
}
1 change: 1 addition & 0 deletions model/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ info:
Property values are cast to string in responses due to limitations of JSON typing, and should be interpreted by the client/user according to the data dictionary.
As a result of the string cast, some missing values might be found as "null".
title: PDS Registry Search API
version: 1.7.0
termsOfService: 'http://pds.nasa.gov'
contact:
name: "Contact PDS Engineering Node Support"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Go through this file line-by-line and replace the template values with your own.
<!-- See https://central.sonatype.org/publish/publish-portal-maven/ for more details -->
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<version>0.11.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
String serverName = request.getServerName();
log.debug("Servername is {}", serverName);
if (!authorizedServerName(serverName)) {
log.error("Server cannot be proxied from {} but from {}", serverName,
this.authorizedForwardedHosts);
throw new UnauthorizedForwardedHostException("Server cannot be proxied from " + serverName);
}
}
Expand Down
Loading