Repository navigation
fix: publish a connection password without a username - #1934
ranjithguggilla wants to merge 2 commits into
Conversation
Tableau Server accepts connectionCredentials that carry a password and no name, and then keeps the username already stored on the connection. TSC refused that request, so a password-only publish never embedded the password.
|
Thanks for this, @ranjithguggilla. The REST reference lists Question: callers who forgot the username (
Question: datasource publish path
Question: docstring claims in The docstring says "The server then keeps the username already stored on the connection" and that an empty string "clears it". The Publish Workbook reference says only that Drafted with AI assistance (Claude); reviewed and posted by Jac. |
A connection with no name is valid, so the request-factory test that expected an error for a missing name now expects that error only when the password is missing. Datasource publish uses the same builder, and its request is covered the same way as the workbook request. The credential docstring no longer says what a server does with a missing or empty name. The REST reference only marks both fields optional.
|
Addressed in e091752. The Python tests failed in A Datasource publish uses The docstring no longer says that omitting |
Closes #1926
Motivation
Publishing a workbook with a connection password and no username is rejected by TSC, even though the REST API marks
nameandpasswordonconnectionCredentialsas optional. Issue #1926 reports a publish against Tableau Server build main.26.1119.1559 (REST 3.31, a workbook with an extract and a SQL Server connection): omittingnamekept the username already on the connection, andname=""cleared it. This pull request does not repeat that publish. tabcmd Classic does this with--db-passwordand no--db-username; tabcmd 2 uses TSC and drops the password.Behavior change
ConnectionCredentials.namemay beNone. The request then omits thenameattribute. A missing password still raisesValueError. An empty string is still sent asname="". The library does not document what a server does with either choice; the REST reference only marks both fields optional.A
ConnectionItemwith a password andembed_password, and no username, is sent the same way. That is the case #1926 asks for: previously those two fields were set and the password was dropped with no error. AConnectionItemwith no password still sends no credentials element. Datasource and flow publish use the same builder.Test plan
Workbook and datasource tests check a
ConnectionCredentialswith no name and aConnectionItemwith only a password.test_publish_connection_credentials_require_a_passwordchecks the missing-password error.test_generate_xml_invalid_connection_credentialsnow expects that error only when the password is missing, andtest_generate_xml_connection_credentials_without_a_namecovers a missing name. The existing named-credential publish tests still pass.Not covered: a publish against Tableau Server.