Add token and database URI validation to SQL Server configure script route (#34035)

* feat(web): add token and database uri validations to sql server configure

* feat: add sql server address validation

* test: update example sql server URIs

* Update lib/web/databases_test.go

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>

---------

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
This commit is contained in:
Gabriel Corado
2023-11-29 12:50:00 +00:00
committed by GitHub
co-authored by STeve Huang
parent 731b9bf52b
commit 96ed71b2f7
8 changed files with 189 additions and 27 deletions
@@ -1,13 +1,13 @@
$ErrorActionPreference = "Stop"
$TELEPORT_CA_CERT_PEM = "{{.CACertPEM}}"
$TELEPORT_CA_CERT_SHA1 = "{{.CACertSHA1}}"
$TELEPORT_CA_CERT_BLOB_BASE64 = "{{.CACertBase64}}"
$TELEPORT_CRL_PEM = "{{.CRLPEM}}"
$TELEPORT_PROXY_PUBLIC_ADDR = "{{.ProxyPublicAddr}}"
$TELEPORT_PROVISION_TOKEN = "{{.ProvisionToken}}"
$TELEPORT_CA_CERT_PEM = '{{.CACertPEM}}'
$TELEPORT_CA_CERT_SHA1 = '{{.CACertSHA1}}'
$TELEPORT_CA_CERT_BLOB_BASE64 = '{{.CACertBase64}}'
$TELEPORT_CRL_PEM = '{{.CRLPEM}}'
$TELEPORT_PROXY_PUBLIC_ADDR = '{{.ProxyPublicAddr}}'
$TELEPORT_PROVISION_TOKEN = '{{.ProvisionToken}}'
$DB_ADDRESS = "{{.DBAddress}}"
$DB_ADDRESS = '{{.DBAddress}}'
$COMPUTER_NAME = ($DB_ADDRESS -split '\.')[0].ToLower()
$DOMAIN_NAME=(Get-ADDomain).DNSRoot
@@ -128,4 +128,4 @@ Write-Output $OUTPUT
Remove-Item $TeleportPEMFile -Recurse
Remove-Item $TeleportCRLFile -Recurse
Remove-Item $WindowsDERFile -Recurse
Remove-Item $WindowsPEMFile -Recurse
Remove-Item $WindowsPEMFile -Recurse