---
apiVersion: capabilities.3scale.net/v1beta1
kind: Backend
metadata:
  name: backend-api
spec:
  name: {BACKEND_NAME}
  systemName: {BACKEND_NAME}
  description: Backend demo
  privateBaseURL: >-
    https://echo-api.3scale.net:443
  metrics:
    hits:
      description: Number of API hits
      friendlyName: Hits
      unit: hit
  providerAccountRef:
    name: tenant-secret
    namespace: 3scaleapim
---
apiVersion: capabilities.3scale.net/v1beta1
kind: Product
metadata:
  name: product-name
spec:
  systemName: {PRODUCT_NAME}
  name: {PRODUCT_NAME}
  description: Product demo
  backendUsages:
    {BACKEND_NAME}:
      path: /api/v1
  mappingRules:
    - httpMethod: POST
      pattern: /api/v1/
      metricMethodRef: postmetric
      increment: 1
  applicationPlans:
    {APPLICATIONPLAN_NAME}:
      name: {APPLICATIONPLAN_NAME}
  policies:
    - name: apicast
      version: builtin
      enabled: true
      configuration: {}
  deployment:
    apicastSelfManaged:
      stagingPublicBaseURL: https://demo-staging-url.example.com
      productionPublicBaseURL: https://demo-production-url.example.com
      authentication:
        oidc:
          issuerEndpoint: >-
            https://sso-domain.example.com/realm/3scale
          issuerType: rest
          authenticationFlow:
            standardFlowEnabled: false
            implicitFlowEnabled: false
            serviceAccountsEnabled: true
            directAccessGrantsEnabled: false
          jwtClaimWithClientID: azp
          jwtClaimWithClientIDType: plain
          credentials: headers
          gatewayResponse:
            errorStatusAuthFailed: 403
            errorStatusAuthMissing: 401
            errorStatusNoMatch: 404
            errorStatusLimitsExceeded: 429
            errorAuthFailed: >-
              {"error": {"code": "PERMISSION_DENIED","message":"Authentication
              failed"}}
            errorAuthMissing: >-
              {"error": {"code": "UNAUTHENTICATED","message": "Authentication
              parameters missing"}}
            errorLimitsExceeded": >-
              {"error": {"code": "USAGE_LIMIT_EXCEEDED","message": "Usage limit
              exceeded"}}
            errorNoMatch": >-
              {"error": {"code": "NOT_FOUND","message": "No Mapping Rule
              matched"}}
            errorHeadersAuthFailed": application/json; charset=us-ascii
            errorHeadersAuthMissing": application/json; charset=us-ascii
            errorHeadersNoMatch": application/json; charset=us-ascii
            errorHeadersLimitsExceeded": application/json; charset=us-ascii
  metrics:
    postmetric:
      friendlyName: postmetric
      unit: hit
      description: Number of API hits on postmetric
  providerAccountRef:
    name: tenant-secret
    namespace: 3scaleapim
