Skip to content

Commit

Permalink
WIP: Adding workflow for jwt plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rspurgeon committed Jul 26, 2023
1 parent b518fa5 commit b4340a7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/stage-changes-for-kong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ jobs:
run: |
deck file openapi2kong -s flight-data/flights/openapi.yaml | \
deck file patch flight-data/flights/kong/patches.yaml | \
deck file add-tags -o .github/artifacts/kong/flight-data-flights-kong.yaml --selector "$.services[*]" --selector "$.services[*].routes[*]" flight-data
deck file add-tags -o .github/artifacts/kong/flight-data-flights-kong.yaml \
--selector "$.services[*]" --selector "$.services[*].routes[*]" flight-data
- name: Convert Routes API to Kong
Expand All @@ -82,35 +83,43 @@ jobs:
run: |
deck file openapi2kong -s flight-data/routes/openapi.yaml | \
deck file patch flight-data/routes/kong/patches.yaml | \
deck file add-tags -o .github/artifacts/kong/flight-data-routes-kong.yaml --selector "$.services[*]" --selector "$.services[*].routes[*]" flight-data
deck file add-tags -o .github/artifacts/kong/flight-data-routes-kong.yaml \
--selector "$.services[*]" --selector "$.services[*].routes[*]" flight-data
- name: Convert Bookings API to Kong
# In two steps, convert the OpenAPI Spec to a Kong declarative configuration
# and then patch the result with the data in the kong/patches.yaml
run: |
deck file openapi2kong -s sales/bookings/openapi.yaml | \
deck file patch sales/bookings/kong/patches.yaml | \
deck file add-tags -o .github/artifacts/kong/sales-bookings-kong.yaml --selector "$.services[*]" --selector "$.services[*].routes[*]" sales
deck file add-tags -o .github/artifacts/kong/sales-bookings-kong.yaml \
--selector "$.services[*]" --selector "$.services[*].routes[*]" sales
- name: Convert Customers API to Kong
# In two steps, convert the OpenAPI Spec to a Kong declarative configuration
# and then patch the result with the data in the kong/patches.yaml
run: |
deck file openapi2kong -s sales/customer/openapi.yaml | \
deck file patch sales/customer/kong/patches.yaml | \
deck file add-tags -o .github/artifacts/kong/sales-customer-kong.yaml --selector "$.services[*]" --selector "$.services[*].routes[*]" sales
deck file add-tags -o .github/artifacts/kong/sales-customer-kong.yaml --selector "$.services[*]" \
--selector "$.services[*].routes[*]" sales
- name: Combine Kong Configurations
# Combine all the previous OAS->Kong configurations into one and put it in a well known place
run: |
deck file merge .github/artifacts/kong/*-kong.yaml -o .github/artifacts/kong/kong-combined.yaml
cp platform/kong/platform-kong-base.yaml .github/artifacts/kong/
deck file merge \
.github/artifacts/kong/*-kong.yaml \
.github/artifacts/kong/platform-kong-base.yaml \
-o .github/artifacts/kong/kong-combined.yaml
- name: Platform Team Kong Additions
# The platform team has their own things to add to the final Kong configuration
# The platform/kong/.generated/kong.yaml is the final product and is stored in the repository
# Storing the generated file in the repo is intentional, it should help with PR reviews, transparency, and debugging
run: |
deck file merge .github/artifacts/kong/kong-combined.yaml platform/kong/plugins/* platform/kong/vaults/* | deck file patch -o platform/kong/.generated/kong.yaml platform/kong/patches.yaml
deck file merge .github/artifacts/kong/kong-combined.yaml platform/kong/plugins/* platform/kong/vaults/* | \
deck file patch -o platform/kong/.generated/kong.yaml platform/kong/patches.yaml
- name: Upload Artifacts
# Artifacts are the files that are built along the way of the pipeline but are not committed to the repo
Expand Down
8 changes: 8 additions & 0 deletions platform/kong/patches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ patches:
values:
protocols:
- https
# Add default settings for plugin configs
- selectors:
- $._plugin_configs
values:
default-jwt:
name: jwt
config:
enabled: true
2 changes: 2 additions & 0 deletions platform/kong/platform-kong-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This will be used as the base file for the Kong configuration.
_plugin_configs: {}

0 comments on commit b4340a7

Please sign in to comment.