|
6 | 6 | postLogoutRedirectUris = [] |
7 | 7 | grantTypes = ["AUTHORIZATION_CODE"] |
8 | 8 | protocol = "oidc" |
9 | | - metadataUrl = "" |
| 9 | + metadataFile = "" |
10 | 10 | # When true, a user is granted every role they match (not just the |
11 | 11 | # highest-priority one) — e.g. Outline admins land in Leadership and Team. |
12 | 12 | multi_role = false |
@@ -86,10 +86,15 @@ locals { |
86 | 86 | roles = [{ key = "Granted", grants_to = ["yucca"] }] |
87 | 87 | }, |
88 | 88 | { |
89 | | - name = "OVHCloud" |
90 | | - protocol = "saml" |
91 | | - roles = [{ key = "ADMIN", grants_to = ["immich_admin", "yucca"] }, { key = "DEFAULT", grants_to = ["team"] }] |
92 | | - metadataUrl = "https://auth.eu.ovhcloud.com/sso/saml/sp/metadata.xml" |
| 89 | + name = "OVHCloud" |
| 90 | + protocol = "saml" |
| 91 | + roles = [{ key = "ADMIN", grants_to = ["immich_admin", "yucca"] }, { key = "DEFAULT", grants_to = ["team"] }] |
| 92 | + # SP metadata is vendored rather than fetched at plan time: OVH gates |
| 93 | + # https://auth.eu.ovhcloud.com/sso/saml/sp/metadata.xml behind a CDN |
| 94 | + # Set-Cookie 307-redirect-to-self that the http provider (no cookie jar) |
| 95 | + # can't satisfy, so `data.http` loops to 10 redirects and fails the apply. |
| 96 | + # Re-fetch with `curl -sL -c jar -b jar <url>` if OVH rotates their SP cert. |
| 97 | + metadataFile = "ovhcloud-sp-metadata.xml" |
93 | 98 | } |
94 | 99 | ] |
95 | 100 |
|
@@ -152,15 +157,10 @@ resource "onepassword_item" "application_client_secret" { |
152 | 157 | password = each.value.client_secret |
153 | 158 | } |
154 | 159 |
|
155 | | -data "http" "saml_sp_metadata" { |
156 | | - for_each = { for project in local.saml_projects : project.name => project } |
157 | | - url = each.value.metadataUrl |
158 | | -} |
159 | | - |
160 | 160 | resource "zitadel_application_saml" "applications" { |
161 | 161 | for_each = { for project in local.saml_projects : project.name => project } |
162 | 162 | name = upper(replace(each.value.name, "/[^a-zA-Z0-9]/", "_")) |
163 | 163 | org_id = zitadel_org.immich.id |
164 | 164 | project_id = zitadel_project.projects[each.key].id |
165 | | - metadata_xml = data.http.saml_sp_metadata[each.key].response_body |
| 165 | + metadata_xml = file("${path.module}/assets/${each.value.metadataFile}") |
166 | 166 | } |
0 commit comments