microsoft / microsoft/go-sqlcmd
Unable to pass credential via Mac Keychain due to SqlToolsService (ADS) using UTF16 characters
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 595
- Forks
- 91
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 1
Description
In implementing sqlcmd open ads for Mac, we've hit an issue, in that the name of the credential that ADS is expecting (via SqlToolsService) is named using UTF16 characters (the internal representation for strings in .Net (C#)), but all the KeyChain packages for golang correctly take a string parameter for the credential name, which is UTF8, which means there is no way using golang keychain packages to name a credential using UTF16 characters. But naming the credential with UTF16 characters is incorrect anyway, is causes all sorts of problems in the Mac Keychain UI
The following bugs have already been filed in ADS, SqlToolsService:
https://github.com/microsoft/azuredatastudio/issues/22385
https://github.com/microsoft/azuredatastudio/issues/19269
When we have solved the UTF16 issue, there is another issue in that SqlToolsService ACLs the credential to just the SqlToolsService process, I'm not sure how sqlcmd will be able to do this (since sqlcmd won't necessary know where the SqlToolsService is)
As a temporary workaround, rather than trying to clone the UTF16 bug in ADS, we are going to require the user run a sqlcmd config cs to get the password from the sqlconfig to the console, and then cut and paste it into ADS the one time (and save password). We have an effort going on to work out the correct path forward to solve this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sqlcmd open ads credential flow and the temporary sqlcmd config cs workaround. Read the linked Azure Data Studio issues and investigate how SqlToolsService names and ACLs credentials on macOS. Done requires an agreed path that avoids the UTF16 naming problem and supports SqlToolsService access without relying on manual password copying.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, go, macos
- Domain
- cli, operating-systems, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100