Azure-sdk-for-go: postgresql API allows capitals & invalid chars in server name/returns incorrect casing.

Created on 8 Nov 2019  路  9Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

[13:59:26] kt@katbook:~/hashi/tf/azure/azurerm鈻竝ostgres/casing$ cat go.mod | egrep "(autorest|Azure)"
    github.com/Azure/azure-sdk-for-go v35.0.0+incompatible
    github.com/Azure/go-autorest/autorest v0.9.2
    github.com/Azure/go-autorest/autorest/date v0.2.0
[13:59:33] kt@katbook:~/hashi/tf/azure/azurerm鈻竝ostgres/casing$ go version
go version go1.13.1 darwin/amd64
[14:01:21] kt@katbook:~/hashi/tf/azure/azurerm鈻竝ostgres/casing$ find azurerm -type f -print | xargs grep "postgresql\"$" | cut -d\" -f 2 | sort -u
github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-12-01/postgresql
  • What happened?
    the API accepts uppercase letters for sql server name but then returns the server name in all lowercase.
    put: https://management.azure.com/subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-postgres-191108135158564028/providers/Microsoft.DBforPostgreSQL/servers/acctest-PGSQL-server-191108135158564028?api-version=2017-12-01
    get: https://management.azure.com/subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-postgres-191108135158564028/providers/Microsoft.DBforPostgreSQL/servers/acctest-PGSQL-server-191108135158564028?api-version=2017-12-01
{
...
    "location": "westeurope",
    "tags": {},
    "id": "/subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-postgres-191108135158564028/providers/Microsoft.DBforPostgreSQL/servers/acctest-pgsql-server-191108135158564028",
    "name": "acctest-pgsql-server-191108135158564028",
    "type": "Microsoft.DBforPostgreSQL/servers"
}
  • What did you expect or want to happen?
    either the server name to be returned in the correct casing or an API error due to the uppercase characters.
  • How can we reproduce it?
  • Anything we should know about your environment.
Mgmt PostgreSQL Service Attention customer-reported

Most helpful comment

@rachel-msft, if the server name is expected to be lowercase the API should be validating and rejecting any server names that are not lowercase? this very much sounds like a bug that should fixed, storage accounts also can only be lower case and they reject any name that has capitals in it rather then silently changing a users input.

All 9 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @rachel-msft

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaredmoo

Hi @katbyte I have tagged this issue so the corresponding service team will have a look at this.

Thanks for reaching out @katbyte and providing details about this experience.

For this api, we request that lowercase format be used for inputting letters.
As it stands, we will continue to convert to lowercase format if that's not entered.

@rachel-msft thanks for confirming this is a bug - is there a timeline to fix this bug in the API?

@tombuildsstuff I wasn't saying that it is a bug. The server name is expected to be lower case and converts other entries into this format. There isn't any change planned.

@rachel-msft, if the server name is expected to be lowercase the API should be validating and rejecting any server names that are not lowercase? this very much sounds like a bug that should fixed, storage accounts also can only be lower case and they reject any name that has capitals in it rather then silently changing a users input.

@rachel-msft, it seems there is no validation on API inputs here at all. I have done a number of requests with invalid chars (#$!@) and the API just hangs.

We haven't been able to receive the issue described with invalid chars. We get an error code and error when we attempted the chars you listed (#$!@). Closing this issue for now. Can reopen if repro steps are provided.

Was this page helpful?
0 / 5 - 0 ratings