Re: [PATCH] contrib: add a pair of credential helpers for Mac OS X's keychain
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Oct 4, 2011, 20:09 UTC
- Message-ID
- <CAG+J_DxQg_0YB8X6LMXhus817qRLLQkbCp939Ux4rzO36tj4Sg@mail.gmail.com>
- In-Reply-To
- <7vy5x0bmjk.fsf@alter.siamese.dyndns.org>
On Tue, Oct 4, 2011 at 3:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> > Hmm, don't we first want to enumerate contexts where we might want to get > the access information from the user? E.g. > > * "transport" aka "git fetch/push"; I think you meant this by --type=network, > but there probably are other kinds of accesses over "network". > * "imap-send". > * "send-email". > * "tag -s" and perhaps upcoming "push --signed" or "commit --gpg-sign"? > > Anything else?
Perhaps it would be illustrative to look at the OS X keychain API call for adding a password to the store:
OSStatus SecKeychainAddInternetPassword ( SecKeychainRef keychain, UInt32 serverNameLength, const char *serverName, UInt32 securityDomainLength, const char *securityDomain, UInt32 accountNameLength, const char *accountName, UInt32 pathLength, const char *path, UInt16 port, SecProtocolType protocol, SecAuthenticationType authenticationType, UInt32 passwordLength, const void *passwordData, SecKeychainItemRef *itemRef );
SecProtocolType is an enum of 4-char values such as 'ftp ', 'http', etc. Similarly for SecAuthenticationType which uses values such as 'form' (web form), 'http' (basic auth), etc.
http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/c_ref/SecKeychainAddInternetPassword http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/c_ref/SecProtocolType http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/c_ref/SecAuthenticationType
j.