Skip to content

store/keychain: require a serviceName and serviceGroup#32

Merged
Benehiko merged 1 commit intomainfrom
keychain-spec
Jun 23, 2025
Merged

store/keychain: require a serviceName and serviceGroup#32
Benehiko merged 1 commit intomainfrom
keychain-spec

Conversation

@Benehiko
Copy link
Member

The macOS keychain scopes items based on the application bundle ID, managed by XCode. The macOS keychain service also supports setting a Keychain group which shares keychain items between applications. On Linux any application can prompt the user for any credential stored inside the keychain.

For us to support a wide range of use cases we need to require the serviceName and serviceGroup. This helps make credentials searchable via their attributes field (support by macOS and Linux).

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@Benehiko Benehiko requested review from joe0BAB and wmluke June 23, 2025 13:44
// Changing the service name can be done, but would require migrating existing credentials.
//
// [Factory] is a function used to instantiate new secrets of type T.
func New[T store.Secret](serviceGroup, serviceName string, factory Factory[T]) (store.Store, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any secrets stored in the wild that will need to be migrated?

Copy link

@wmluke wmluke Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: should/do we have functional tests to validate this behavior across platforms?

Copy link
Member Author

@Benehiko Benehiko Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any secrets stored in the wild that will need to be migrated?

Not here, we aren't storing any secrets with the keychain library yet, so nothing to be migrated. But someone implementing this library would need to be made aware of it.

Minor nit: should/do we have functional tests to validate this behavior across platforms?

Not yet, tests will come once we have a baseline.

@Benehiko Benehiko merged commit 0788248 into main Jun 23, 2025
12 checks passed
@Benehiko Benehiko deleted the keychain-spec branch June 24, 2025 08:36
@Benehiko Benehiko linked an issue Jul 2, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OS keychain [macos, linux, windows]

3 participants