Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularized Keychain Access #1393

Merged
merged 11 commits into from
Nov 5, 2020
Merged

Conversation

overheadhunter
Copy link
Member

This is the first step towards a more modular project in regards of integrations with third party services.

Instead of directly adding implementations to this project, we will rather use an interface defined in integrations-api, which can get implemented by various libs (including third party ones).

Those implementations can then be loaded using a ServiceLoader, which will yield 0..n objects (depending on the available libs during runtime):

@Provides
@Singleton
static Set<ServiceLoader.Provider<KeychainAccessProvider>> provideAvailableKeychainAccessProviderFactories() {
return ServiceLoader.load(KeychainAccessProvider.class).stream().collect(Collectors.toUnmodifiableSet());
}
@Provides
@Singleton
static Set<KeychainAccessProvider> provideSupportedKeychainAccessProviders(Set<ServiceLoader.Provider<KeychainAccessProvider>> availableFactories) {
return availableFactories.stream() //
.map(ServiceLoader.Provider::get) //
.filter(KeychainAccessProvider::isSupported) //
.collect(Collectors.toUnmodifiableSet());
}

This PR removes the keychain maven module and adds integrations-api as a compile-time dependency. Libraries implementing integrations-api will only be present at runtime (to be included with the installers, if applicable).

Furthermore this PR removes system-specific dependencies. These should be part of system-specific service implementations (and as such transitive dependencies will be re-added when packaging installers).

@overheadhunter overheadhunter merged commit efaf107 into develop Nov 5, 2020
@overheadhunter overheadhunter deleted the feature/modular-keychains branch November 5, 2020 10:10
@infeo infeo added this to the 1.5.9 milestone Nov 6, 2020
@overheadhunter
Copy link
Member Author

@swiesend @purejava I think you should be aware of this change:

To get rid of the reflection involved constructing the Linux keychain objects while not running into errors on macOS/Windows with the jars being unavailable, we've externalized such platform-specific code.

So if you want to update the Linux keychain integrations, head over to the integrations-linux repo.

@purejava
Copy link
Contributor

purejava commented Nov 9, 2020

Yes, thanks for the hint.

@swiesend
Copy link
Contributor

swiesend commented Nov 9, 2020

Sounds like a proper engineering idea. Thanks for the update.

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.

4 participants