Open calebdoxsey opened 9 months ago
@wasaga it appears that we don't currently support the redirect option, I'm guessing because its incompatible with an ingress rule. For the same reason, would the new direct response option also not be supported?
I believe we may do that using i.e. ConfigMap or a Secret reference and Resource Backends
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: direct-response
namespace: default
spec:
ingressClassName: pomerium
rules:
- host: direct-response.localhost.pomerium.io
http:
paths:
- backend:
resource:
kind: ConfigMap
name: mydata
path: /
pathType: Exact
apiVersion: v1
kind: ConfigMap
metadata:
name: mydata
namespace: default
data:
contentType: application/json
code: "200"
data: |
{
"key": "value"
}
I think this needs more detailed requirements. I'm not sure how the backend resource is intended to be used with an ingress rule. For example, what would be the format of the data in the config map or secret? The direct response itself:
{"status":200, "body": "TEST"}
Or is it something more nested?
{
"response": {
"status": 200,
"body": "TEST"
}
}
Maybe we should put this on hold till we have clearer needs from users.
Direct responses are described in https://github.com/pomerium/pomerium/issues/4954. We should support them in the ingress controller as well.