Skip to content
Draft
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
21 changes: 21 additions & 0 deletions deploy/apigee/deploy_apigee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function prep_proxies() {
copy_resources "$proxy_name" "policies" "policies"
copy_resources "$proxy_name" "proxy_endpoints" "proxies"
copy_resources "$proxy_name" "target_endpoints" "targets"
copy_js_resources "$proxy_name"
cd "$ENV_TMP_DIR"
mv "$proxy_name" apiproxy
# Set a constant modification timestamp on all files so zip archive hash
Expand All @@ -120,6 +121,26 @@ function prep_proxies() {
done
}

# Copies all JavaScript files listed under .jsc in config yaml for the given
# proxy into apiproxy/resources/jsc/.
function copy_js_resources() {
proxy_name="$1"
resources=($(yq eval ".proxies[] | select(.name == \"$proxy_name\") | .jsc // [] | .[]" "$ENV_DATA"))
for resource in "${resources[@]}"; do
if [[ "$resource" == "" ]]; then
continue
fi
write_dir="$ENV_TMP_DIR/$proxy_name/resources/jsc"
mkdir -p "$write_dir"
if [[ -f "jsc/$resource.js" ]]; then
cp "jsc/$resource.js" "$write_dir/$resource.js"
else
echo "Not found: jsc/$resource.js"
exit 1
fi
done
}

# Copies all files listed in config yaml for the given proxy and
# resource source directory.
function copy_resources() {
Expand Down
32 changes: 32 additions & 0 deletions deploy/apigee/envs/nonprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,35 @@ proxies:
- nl
target_endpoints:
- nl
- name: oauth
policies:
- add-cors
- set-southbound-key
- rewrite-quota-exceeded-message
- oauth-set-config
- oauth-script
- oauth-verify-client-id
- oauth-generate-state2-code
- oauth-get-state2-attributes
- oauth-delete-state2-code
- oauth-call-google-token
- oauth-verify-google-id-token
- oauth-compute-uid
- oauth-generate-auth-code
- oauth-decode-basic-auth
- oauth-verify-client-form
- oauth-get-code-attributes
- oauth-generate-access-token
- oauth-refresh-access-token
- oauth-verify-access-token
- oauth-enforce-user-quota
- oauth-strip-auth-headers
- oauth-raise-error
- oauth-rewrite-error
- oauth-rewrite-unauthorized-mcp
jsc:
- oauth
proxy_endpoints:
- oauth
target_endpoints:
- oauth
Loading
Loading