resource "authentik_provider_proxy" "proxy-test" {
  name          = "Proxy Test"
  internal_host = "http://homelab-proxy-test.tools:8000"
  external_host = "https://proxy-test.lab.cowley.tech"

  internal_host_ssl_validation = false

  authentication_flow = data.authentik_flow.default-authentication-flow.id
  authorization_flow  = data.authentik_flow.default-provider-authorization-implicit-consent.id
  invalidation_flow   = data.authentik_flow.default-provider-invalidation-flow.id

  access_token_validity = "hours=24"
}

resource "authentik_application" "proxy-test" {
  name = "Proxy Test"
  slug = "proxy-test"

  protocol_provider = authentik_provider_proxy.proxy-test.id
}