# Licensed under the Gluu Support License
# https://www.apache.org/licenses/LICENSE-2.0
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gluu
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:xxxx:certificate/xxxxxx
    alb.ingress.kubernetes.io/auth-session-cookie: custom-cookie
    alb.ingress.kubernetes.io/auth-session-timeout: '3600'
    alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=60,stickiness.type=lb_cookie
    alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '10'
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.scim-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/scim/restv1/scim/scim-configuration", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.openid-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/oxauth/.well-known/openid-configuration", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.uma-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/oxauth/restv1/uma2-configuration", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.webfinger-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/oxauth/.well-known/webfinger", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.simple-web-discovery-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/oxauth/.well-known/simple-web-discovery", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.fido-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/oxauth/restv1/fido-configuration", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.fido2-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/fido2/restv1/fido2/configuration", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/actions.main-page-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "Path":"/identity/", "StatusCode": "HTTP_301"}}'


spec:
  rules:
  - host: FQDN
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: ssl-redirect
            port:
              name: use-annotation
      - path: /.well-known/scim-configuration
        pathType: Exact
        backend:
          service:
            name: scim-redirect
            port:
              name: use-annotation
      - path: /.well-known/openid-configuration
        pathType: Exact
        backend:
          service:
            name: openid-redirect
            port:
              name: use-annotation
      - path: /.well-known/uma2-configuration
        pathType: Exact
        backend:
          service:
            name: uma-redirect
            port:
              name: use-annotation
      - path: /.well-known/webfinger
        pathType: Exact
        backend:
          service:
            name: webfinger-redirect
            port:
              name: use-annotation
      - path: /.well-known/simple-web-discovery
        pathType: Exact
        backend:
          service:
            name: simple-web-discovery-redirect
            port:
              name: use-annotation
      - path: /.well-known/fido-configuration
        pathType: Exact
        backend:
          service:
            name: fido-redirect
            port:
              name: use-annotation
      - path: /.well-known/fido2-configuration
        pathType: Exact
        backend:
          service:
            name: fido2-redirect
            port:
              name: use-annotation
      - path: /
        pathType: Exact
        backend:
          service:
            name: main-page-redirect
            port:
              name: use-annotation
      - path: /.well-known/scim-configuration
        pathType: Exact
        backend:
          service:
            name: scim
            port:
              number: 8080
      - path: /.well-known/openid-configuration
        pathType: Exact
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /.well-known/uma2-configuration
        pathType: Exact
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /.well-known/webfinger
        pathType: Exact
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /.well-known/simple-web-discovery
        pathType: Exact
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /.well-known/fido-configuration
        pathType: Exact
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /.well-known/fido2-configuration
        pathType: Exact
        backend:
          service:
            name: fido2
            port:
              number: 8080
      - path: /oxauth
        pathType: Prefix
        backend:
          service:
            name: oxauth
            port:
              number: 8080
      - path: /identity
        pathType: Prefix
        backend:
          service:
            name: oxtrust
            port:
              number: 8080
      - path: /idp
        pathType: Prefix
        backend:
          service:
            name: oxshibboleth
            port:
              number: 8080
      - path: /scim
        pathType: Prefix
        backend:
          service:
            name: scim
            port:
              number: 8080
      - path: /fido2
        pathType: Prefix
        backend:
          service:
            name: fido2
            port:
              number: 8080
      - path: /passport
        pathType: Prefix
        backend:
          service:
            name: oxpassport
            port:
              number: 8090
      - path: /casa
        pathType: Prefix
        backend:
          service:
            name: casa
            port:
              number: 8080
