Verify and Test the Migration

Estimated time: ~20 minutes

Learning objectives

  • Confirm Gateway / policies are Ready in the migrated namespace

  • Test OIDC and API Key paths with curl against both 3scale and CL endpoints

  • Validate that behavior matches the source application

The workshop already runs both products side by side. This module checks those preinstalled Connectivity Link resources (not a per-user lab-user-*-cl namespace, which is only created if you apply the migration template in module 7).

Step 1: Verify the Gateways are programmed

oc whoami
oc get gateway -n neuralbank-stack
oc get gateway -n nfl-wallet-prod

Expected: PROGRAMMED: True

Step 2: Verify policies are enforced

oc get authpolicy,ratelimitpolicy,planpolicy,apiproduct -n neuralbank-stack
oc get authpolicy,ratelimitpolicy,planpolicy,apiproduct -n nfl-wallet-prod

The AuthPolicy should show ACCEPTED: True and ENFORCED: True.

Step 3: Test the migrated API (OIDC)

3.1 — Without token (expect redirect)

curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" \
  https://neuralbank.apps.cluster.example.com/api/v1/customers

Expected: HTTP Status: 302

3.2 — Get a Bearer Token

TOKEN=$(curl -s -X POST \
  "https://rhbk.apps.cluster.example.com/realms/neuralbank/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password" \
  -d "client_id=neuralbank-frontend" \
  -d "username=robert.anderson@email.com" \
  -d "password=Welcome123" \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')

echo "Token (first 50 chars):" && echo "$TOKEN" | head -c 50 && echo "..."

3.3 — List customers on the migrated endpoint

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://neuralbank.apps.cluster.example.com/api/v1/customers" \
  | python3 -m json.tool | head -20

3.4 — Same call through 3scale APIcast (for comparison)

curl -s -o /dev/null -w "3scale HTTP Status: %{http_code}\n" \
  -H "Authorization: Bearer $TOKEN" \
  "https://neuralbank-oidc-3scale-apicast-production.apps.cluster.example.com/api/v1/customers"

Both front doors use the same backend Service, neuralbank-backend-svc. On this cluster both return 200. A 403 from APIcast means the Bearer has no aud claim or the Application client_id is not neuralbank-frontend. The full executable path is Neuralbank OIDC.

Step 4: Compare the resources side by side

Authentication resources

echo "=== 3scale Product ===" && \
oc get product -n 3scale-system | grep neuralbank && echo && \
echo "=== Connectivity Link AuthPolicy ===" && \
oc get authpolicy -n neuralbank-stack -o wide

Rate limiting

echo "=== Connectivity Link RateLimitPolicy ===" && \
oc get ratelimitpolicy -n neuralbank-stack -o yaml | grep -A5 "limits:"

Step 5: Test NFL Wallet (API Key)

The wallet Gateway is already on nfl-wallet-prod. Call /api/v1/wallets.

Without API Key (expect 401)

curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" \
  https://nfl-wallet.apps.cluster.example.com/api/v1/wallets

With API Key

curl -s -H "X-API-Key: nfl-wallet-demo-key-2024" \
  "https://nfl-wallet.apps.cluster.example.com/api/v1/wallets" \
  | python3 -m json.tool

Step 6: Browse in Developer Hub and Kuadrant Console

  1. Open Developer Hub and search for your migrated component in the Catalog.

  2. Check the API tab — the OpenAPI spec should be available.

  3. Check the Kuadrant section — the APIProduct should show as Published.

  4. Verify the ArgoCD annotation links to the correct application.

  5. Optional: open Kuadrant Console in OpenShift Console to list the APIProduct, manage keys, and open Swagger against the gateway URL (CORS / Bearer mapping may require the demo EnvoyFilter pattern described in module 5).

Step 7: Validate the complete flow

Run this comprehensive check:

echo "=== Neuralbank ===" && \
oc get gateway,httproute,authpolicy,ratelimitpolicy,planpolicy,apiproduct -n neuralbank-stack && echo && \
echo "=== NFL Wallet ===" && \
oc get gateway,httproute,authpolicy,ratelimitpolicy,planpolicy,apiproduct -n nfl-wallet-prod

All resources should exist and show healthy status.

Migration checklist

Check Status Description

Gateway PROGRAMMED

✓

Istio gateway is accepting traffic

AuthPolicy ENFORCED

✓

Authentication is active

RateLimitPolicy ENFORCED

✓

Rate limiting is active

API returns 200 with valid credentials

✓

Backend is reachable through the new gateway

API returns 401/302 without credentials

✓

Authentication is blocking unauthorized access

APIProduct Published

✓

API is visible in Developer Hub

ArgoCD Synced + Healthy

✓

GitOps is working correctly

Summary

You have successfully:

  • Verified all Connectivity Link resources are deployed and enforced

  • Tested the migrated API with the same credentials as the 3scale version

  • Compared both environments running side by side

  • Confirmed the migration preserved authentication, rate limiting, and API documentation