Skip to content

Commit

Permalink
Merge pull request #184 from permitio/omer/per-10741-fix-unhandled-nu…
Browse files Browse the repository at this point in the history
…ll-value-in-debug-key-response

Fix unhandled issue with debug null and improve local dev
  • Loading branch information
omer9564 authored Sep 22, 2024
2 parents 8410d25 + c22e3de commit f4d729f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions build_opal_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ else
echo "permit-opa directory already exists. Skipping clone operation."
fi

# Check if datasync directory already exists
if [ ! -d "../datasync" ]; then
# Clone the permit-opa repository into the parent directory if it doesn't exist
git clone [email protected]:permitio/datasync.git ../datasync
else
echo "datasync directory already exists. Skipping clone operation."
fi

# Conditionally execute the custom OPA tarball creation section based on the value of PDP_VANILLA
if [ "$PDP_VANILLA" != "true" ]; then
# Custom OPA tarball creation section
Expand All @@ -24,6 +32,13 @@ if [ "$PDP_VANILLA" != "true" ]; then
cd "../permit-opa"
find * -name '*go*' -print0 | xargs -0 tar -czf "$build_root"/custom/custom_opa.tar.gz --exclude '.*'
cd "$build_root"
# Datasync tarball creation section
rm -rf datasync
mkdir datasync
build_root="$PWD"
cd "../datasync"
find * -name '*go*' -print0 | xargs -0 tar -czf "$build_root"/datasync/datasync.tar.gz --exclude '.*'
cd "$build_root"
else
echo "Skipping custom OPA tarball creation for pdp-vanilla environment."
fi
3 changes: 1 addition & 2 deletions horizon/enforcer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
KongWrappedAuthorizationQuery,
)
from horizon.enforcer.schemas_v1 import AuthorizationQueryV1
from horizon.enforcer.utils.headers_utils import get_case_insensitive
from horizon.enforcer.utils.mapping_rules_utils import MappingRulesUtils
from horizon.enforcer.utils.statistics_utils import StatisticsManager
from horizon.state import PersistentStateHandler
Expand Down Expand Up @@ -201,7 +200,7 @@ def get_v1_processed_query(result: dict) -> Optional[dict]:


def get_v2_processed_query(result: dict) -> Optional[dict]:
return result.get("debug", {}).get("input", None)
return (result.get("debug", {}) or {}).get("input", None)


async def notify_seen_sdk(
Expand Down

0 comments on commit f4d729f

Please sign in to comment.