samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

MacOS deprecating APIs in go-keychain #68

Closed keilin-anz closed 2 years ago

keilin-anz commented 3 years ago

(NB: Just a note for now, as I've not got a machine running Big Sur to do any testing)

Overview

Seems one of the ABIs used by go-keychain has been recently deprecated - it presumedly still works (with warnings), but that likely won't last long:

(copied from another user)

~ % go get -v github.com/samuong/alpaca
# github.com/keybase/go-keychain
cgo-gcc-prolog:203:11: warning: 'SecTrustedApplicationCreateFromPath' is deprecated: first deprecated in macOS 10.15 - No longer supported [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h:59:10: note: 'SecTrustedApplicationCreateFromPath' has been explicitly marked deprecated here

Also see: https://github.com/keybase/go-keychain/issues/54

What to do?

Hopefully just bump the go-keychain version, assuming they've worked out how to transparently support the older OS ABI alongside the new one

samuong commented 3 years ago

Hi @keilin-anz, thanks for the heads up. I was able to repro this on my MacBook Pro, which is running Big Sur.

I was also able to make it go away by bumping the go-keychain version as you suggested (which I did in 3610028 as part of another change). If you run go get -v github.com/samuong/alpaca@3610028 and still get the error, let me know?

keilin-anz commented 3 years ago

Glad to hear bumping worked well for you, will confirm it doesn't break functionality on older OS and update here soon

EDIT: go get worked great without any warnings, and executed just fine on Mojave 10.14.6 (18G9028)

samuong commented 3 years ago

Btw I just remembered that this was actually fixed in an earlier commit than 3610028; see #60. Since this seems to be fixed for everyone, I'll close this.

samhaque commented 2 years ago

This issue resurfaced in macOS Monterey (12.3.0), could you bump up the version again @samuong ?

samhaque commented 2 years ago

Here is the screenshotimage

samuong commented 2 years ago

Unfortunately, bumping the version won't fix it this time; Apple have removed the deprecated API and we'll have to stop using it.

We use custom keychain management for testing purposes in Alpaca, so I can remove this without changing any functionality, but test coverage will drop as a result. I'll have a go at putting together a PR for this tonight.