Skip to content

Instantly share code, notes, and snippets.

@pubudu538
Last active January 27, 2023 10:03
Show Gist options
  • Select an option

  • Save pubudu538/a30ef29e5a9723295f3727bedc951c64 to your computer and use it in GitHub Desktop.

Select an option

Save pubudu538/a30ef29e5a9723295f3727bedc951c64 to your computer and use it in GitHub Desktop.
APK Sample CRS
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: http-route-SwaggerPetstore
spec:
parentRefs:
- name: my-gateway
hostnames:
- "gateway.wso2.com"
rules:
- matches:
- path:
type: PathPrefix
value: /pet-store-api/1.0.6/pet/findByStatus
method: GET
queryParams:
- type: Exact
name: status
value: available
- path:
type: PathPrefix
value: /pet-store-api/1.0.6/pet
filters:
- type: extesnionRef
extesnionRef:
group: wso2.com
kind: CachingFilter
name: cache-filter
- type: extesnionRef
extesnionRef:
group: wso2.com
kind: Authentication
name: pet-store-authentication-1
- type: RequestRewrite
requestRewrite:
path:
type: ReplacePrefix
pattern: /pet-store-api/1.0.6
substitution: /my-backend-path
- type: RequestHeaderModifier
requestHeaderModifier:
remove:
- X-Header-Remove
- type: extesnionRef
extesnionRef:
group: wso2.com/v1beta1
kind: Scope
name: pet-store-scope-1
---
apiVersion: wso2.com/v1beta1
kind: Authentication
metadata:
name: pet-store-authentication-1
Spec:
default:
type: ext
ext:
serviceRef:
group: wso2/v1alpha2
kind: Backend
name: ext_authz-server
port: 1234
authTypes:
- type: jwt
jwt:
tokenValidation: false
scopeValidation: true
subscriptionValidation: true
customFilters:
- ValidationFilter
- type: basic
basic:
tokenValidation: true
scopeValidation: false
subscriptionValidation: true
- type: InternalKey
basic:
tokenValidation: true
scopeValidation: false
subscriptionValidation: false
----
apiVersion: wso2.com/v1beta1
kind: Scope
metadata:
name: pet-store-scope-1
spec:
name: read:pets
displayName: read:pets
description: read your pets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment