Skip to content

Commit

Permalink
Optimise username calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
marrobi committed Feb 18, 2025
1 parent 2a93c65 commit b5e9cb9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole-linuxvm
version: 1.2.7
version: 1.2.8
description: "An Azure TRE User Resource Template for Guacamole (Linux)"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ locals {
admin_username = (
length(data.azuread_user.user.mail) > 0 && strcontains(data.azuread_user.user.user_principal_name, "#EXT#") ?
substr(element(split("@", data.azuread_user.user.mail), 0), 0, 20) :
substr(
strcontains(element(split("@", data.azuread_user.user.user_principal_name), 0), "#EXT#") ?
element(split("#EXT#", element(split("@", data.azuread_user.user.user_principal_name), 0)), 0) :
element(split("@", data.azuread_user.user.user_principal_name), 0),
0, 20
)
substr(element(split("#EXT#", element(split("@", data.azuread_user.user.user_principal_name), 0)), 0), 0, 20)
)
vm_password_secret_name = "${local.vm_name}-admin-credentials"
tre_user_resources_tags = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole-windowsvm
version: 1.2.9
version: 1.2.10
description: "An Azure TRE User Resource Template for Guacamole (Windows 10)"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ locals {
admin_username = (
length(data.azuread_user.user.mail) > 0 && strcontains(data.azuread_user.user.user_principal_name, "#EXT#") ?
substr(element(split("@", data.azuread_user.user.mail), 0), 0, 20) :
substr(
strcontains(element(split("@", data.azuread_user.user.user_principal_name), 0), "#EXT#") ?
element(split("#EXT#", element(split("@", data.azuread_user.user.user_principal_name), 0)), 0) :
element(split("@", data.azuread_user.user.user_principal_name), 0),
0, 20
)
substr(element(split("#EXT#", element(split("@", data.azuread_user.user.user_principal_name), 0)), 0), 0, 20)
)
vm_password_secret_name = "${local.vm_name}-admin-credentials"
tre_user_resources_tags = {
Expand Down

0 comments on commit b5e9cb9

Please sign in to comment.