-
Notifications
You must be signed in to change notification settings - Fork 0
User interface implementation #127
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
Merged
Merged
Changes from 130 commits
Commits
Show all changes
134 commits
Select commit
Hold shift + click to select a range
4be72b6
Require controller constructor argument.
dkocher da18bdc
Add implementation using alerts.
dkocher 2755a7c
Save account key in keychain.
dkocher 42dac15
Add implementation using login callback.
dkocher cbd7b91
Attach sources.
dkocher adf2a9b
Require controller constructor argument.
dkocher 65e7efe
Lookup device setup prompt from login feature.
dkocher 505d20f
Add custom buttons.
dkocher 2954905
Remove confirmation input.
dkocher 511de65
Implement home interface.
dkocher 67e7a13
Fix initialization.
dkocher ac514cf
Fix default return value for fallback to parent profile.
dkocher a913446
Extract variable.
dkocher 40a390d
Explicitly require PKCE.
dkocher 30e6980
Add password store as constructor parameter.
dkocher 4274e3b
Add find feature for vaults.
dkocher 7db4b1f
Add null check for feature.
dkocher 50b847d
Add details to exception.
dkocher acf1856
Logging.
dkocher 8677628
Fix logger name.
dkocher 0015cd7
Deny read/write access to root in preflight checks.
dkocher 80a9d3c
Delete redundant override.
dkocher 55aebb5
Set nickname of vault as display name.
dkocher 4716add
Add missing listener notification for chunks retrieved.
dkocher f958e82
Remove logger.
dkocher fce0259
Fail with exception when storage does not support feature.
dkocher 0270b44
Disable custom versioning option.
dkocher 5ac4790
Allow multiple attempts to recover with account key until canceled by…
dkocher 22bb26d
Use default application icon in prompt.
dkocher 3ed5042
Add null check for token expiry.
dkocher f5764a0
Standard wrapping for error handler to limit retries.
dkocher 2389723
Remove redundant override of registry.
dkocher f87fd8a
Use storage specific comparison service.
dkocher d131a87
Extract class.
dkocher 51c2956
Prune imports.
dkocher f191521
Return storage profile name as default nickname.
dkocher d6e9109
Must not cache storage profile with reference to Hub connection.
dkocher 8a5ebce
No need to register profile.
dkocher 5412f4f
Reduce required parameters.
dkocher 2a57408
No custom cleanup.
dkocher 6e55170
Simplify assertion.
dkocher 14e4520
Extract class.
dkocher 716d282
Extract method.
dkocher 357eb1c
Remove redundant override.
dkocher 3dddc43
Delete unused property.
dkocher d589135
Use factory.
dkocher 97171e3
Set vault ID as vendor key in profile.
dkocher fa61288
Log failures.
dkocher 7ba91ea
Add overloaded constructor.
dkocher b4fcf21
Refactor to load vaults only once with short-lived user keys.
dkocher 69eba9a
Resolve deprecated usages.
dkocher 154156b
Default path is bucket name.
dkocher cca05cf
Logging.
dkocher 91b323c
Revert "Set vault ID as vendor key in profile."
dkocher edc25b1
Logging.
dkocher c86b6e4
Handle load failure.
dkocher 7963bb4
Add required argument.
dkocher 5bb434d
Fix test. Attributes retrieved for bucket have region set.
dkocher d0c91fb
Implement location service as combo of storage profile configuration …
dkocher 88e05b8
Log failure.
dkocher fb91071
Adtop updated interface.
dkocher b343090
Default to allow configuration of transfer acceleration.
dkocher 34ff3dd
Numbered formatting.
dkocher b58cd4b
Add constructors.
dkocher b39e4d7
Javadoc.
dkocher 0da90c9
Add accessor.
dkocher 2194d6a
Allow to create vault.
dkocher 0f05379
Show display name.
dkocher 4e66e13
Use delimiter different from regions.
dkocher b1e5797
Reuse OAuth credentials.
dkocher 255b1bc
Only reload when expired.
dkocher 01614b6
Logging.
dkocher ccbdfc9
Skip vault when token exchange fails.
dkocher 51c0885
Rename field.
dkocher d248046
Pass location including storage profile id and region.
dkocher 9e5c759
Fix return value.
dkocher 9fa6495
Register storage configurations on login.
dkocher a6dba37
Rename variable.
dkocher 4d9657e
Revert "Fail with exception when storage does not support feature."
dkocher ff2ff77
Adopt reusable authentication with temporeary credentials assuming ro…
dkocher ba602db
Add new parameters.
dkocher 056b171
Require test to create bucket for vault.
dkocher 56459f9
Assign bucket.
dkocher 7fca9af
No preloading of buckets.
dkocher 0c67e00
Unused.
dkocher 24ce8d4
Require storage credentials.
dkocher 31f7cae
Extract region name.
dkocher 56ff305
Use cached keys.
dkocher 7b9e652
Empty initialization.
dkocher a749fe2
Throw failure when attempting to list non-root.
dkocher bd9da57
Determine access grant options depeding on storage profile.
dkocher 19ff164
Revert "Resolve deprecated usages."
dkocher a6d0fe3
Set role configurable key.
dkocher 4a06d84
Fix region name.
dkocher 378bf99
Review ARN property names.
dkocher f3d5159
Add support to create vault from client.
dkocher 35ae8ee
Use provided bucket name when available.
dkocher 44c9327
Handle null.
dkocher 6a2ba62
Create random bucket in tests.
dkocher e5db877
Workaround #189.
dkocher 92cffe2
Delete unused.
dkocher 852e7b5
No duplicate transcript.
dkocher 0dae67f
Delete test.
dkocher a5cd29b
Revert "No preloading of buckets."
dkocher aeef089
Ensure listener notification.
dkocher 5ae6d55
Ignore vaults that fail to load.
dkocher 91e6bcc
Delete unused accessor.
dkocher 682d812
Keep user keys alive.
dkocher 98c3095
Make user keys short-lived.
dkocher 2e36d89
Inline configuration.
dkocher 717850d
Inline configuration.
dkocher 3108aac
Wrap with expiring holders.
dkocher 6526cf8
Obtain hub session as feature.
dkocher f13cc40
Logging.
dkocher 1d2801d
Adopt interface changes.
dkocher 19a5005
Merge implementations.
dkocher 833f56b
Share OAuth tokens. Resolves #29.
dkocher f0cbfce
Read cached setting.
dkocher e098e7c
Extract field.
dkocher 67d76ff
Isolate storage configurations per hub.
dkocher d07f6b4
Extract builder method.
dkocher 448b3d6
Delete unused.
dkocher 548ee66
Remove duplicate field.
dkocher a76a555
Remove redundant constructor.
dkocher a696a75
Use service loader.
dkocher 746b1cb
Fail on missing configuration.
dkocher 7bef746
Move to class.
dkocher 16e832b
Move to class.
dkocher b03cde1
Remove profile properties to be configured from storage profile confi…
dkocher 8bed1ae
Inject reference to Hub connection/Oauth explicitly. Load storage ses…
dkocher 3dde8a6
Remove option to save account key.
dkocher e33210f
Add comment on usage of "Role Configurable" boolean for storage profile.
dkocher 9694c95
Remove unused bucket name parameter.
dkocher 6657882
Merge pull request #205 from shift7-ch/issues/204
dkocher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
hub/src/main/java/cloud/katta/core/DefaultDeviceSetupCallback.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| * Copyright (c) 2025 shift7 GmbH. All rights reserved. | ||
| */ | ||
|
|
||
| package cloud.katta.core; | ||
|
|
||
| import ch.cyberduck.core.Credentials; | ||
| import ch.cyberduck.core.Host; | ||
| import ch.cyberduck.core.LocaleFactory; | ||
| import ch.cyberduck.core.LoginCallback; | ||
| import ch.cyberduck.core.LoginOptions; | ||
| import ch.cyberduck.core.StringAppender; | ||
| import ch.cyberduck.core.exception.LoginCanceledException; | ||
|
|
||
| import cloud.katta.model.AccountKeyAndDeviceName; | ||
| import cloud.katta.workflows.exceptions.AccessException; | ||
|
|
||
| public class DefaultDeviceSetupCallback implements DeviceSetupCallback { | ||
|
|
||
| private final LoginCallback prompt; | ||
|
|
||
| public DefaultDeviceSetupCallback(final LoginCallback prompt) { | ||
| this.prompt = prompt; | ||
| } | ||
|
|
||
| @Override | ||
| public AccountKeyAndDeviceName displayAccountKeyAndAskDeviceName(final Host bookmark, final AccountKeyAndDeviceName accountKeyAndDeviceName) throws AccessException { | ||
| try { | ||
| final Credentials input = prompt.prompt(bookmark, accountKeyAndDeviceName.accountKey(), | ||
| LocaleFactory.localizedString("Account Key", "Hub"), | ||
| new StringAppender() | ||
| .append(LocaleFactory.localizedString("On first login, every user gets a unique Account Key", "Hub")) | ||
| .append(LocaleFactory.localizedString("Your Account Key is required to login from other apps or browsers", "Hub")) | ||
| .append(LocaleFactory.localizedString("You can see a list of authorized apps on your profile page", "Hub")).toString(), | ||
| new LoginOptions() | ||
| .usernamePlaceholder(LocaleFactory.localizedString("Account Key", "Hub")) | ||
| // Account key not editable | ||
| .user(false) | ||
| .passwordPlaceholder(accountKeyAndDeviceName.deviceName()) | ||
| // Input device name | ||
| .password(true) | ||
| .keychain(true) | ||
| ); | ||
| return new AccountKeyAndDeviceName() | ||
| .withAddToKeychain(input.isSaved()) | ||
| .withDeviceName(input.getUsername()) | ||
| .withAccountKey(input.getPassword()); | ||
| } | ||
| catch(LoginCanceledException e) { | ||
| throw new AccessException(e); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public AccountKeyAndDeviceName askForAccountKeyAndDeviceName(final Host bookmark, final String initialDeviceName) throws AccessException { | ||
| try { | ||
| final Credentials input = prompt.prompt(bookmark, initialDeviceName, | ||
| LocaleFactory.localizedString("Authorization Required", "Hub"), | ||
| new StringAppender() | ||
| .append(LocaleFactory.localizedString("This is your first login on this device.", "Hub")) | ||
| .append(LocaleFactory.localizedString("Your Account Key is required to link this browser to your account.", "Hub")).toString(), | ||
dkocher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| new LoginOptions() | ||
| .usernamePlaceholder(LocaleFactory.localizedString("Device Name", "Hub")) | ||
| // Customize device name | ||
| .user(true) | ||
| .passwordPlaceholder(LocaleFactory.localizedString("Account Key", "Hub")) | ||
| // Input account key | ||
| .password(true) | ||
| .keychain(true) | ||
| ); | ||
| return new AccountKeyAndDeviceName() | ||
| .withAddToKeychain(input.isSaved()) | ||
| .withDeviceName(input.getUsername()) | ||
| .withAccountKey(input.getPassword()); | ||
| } | ||
| catch(LoginCanceledException e) { | ||
| throw new AccessException(e); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
hub/src/main/java/cloud/katta/core/DeviceSetupCallbackFactory.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
hub/src/main/java/cloud/katta/protocols/hub/HubAwareProfile.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright (c) 2025 shift7 GmbH. All rights reserved. | ||
| */ | ||
|
|
||
| package cloud.katta.protocols.hub; | ||
|
|
||
| import ch.cyberduck.core.Profile; | ||
| import ch.cyberduck.core.Protocol; | ||
|
|
||
| import cloud.katta.client.model.ConfigDto; | ||
| import cloud.katta.model.StorageProfileDtoWrapper; | ||
| import cloud.katta.protocols.hub.serializer.HubConfigDtoDeserializer; | ||
| import cloud.katta.protocols.hub.serializer.StorageProfileDtoWrapperDeserializer; | ||
|
|
||
| public final class HubAwareProfile extends Profile { | ||
|
|
||
| public HubAwareProfile(final Protocol parent, final ConfigDto configDto, final StorageProfileDtoWrapper storageProfile) { | ||
| super(parent, new HubConfigDtoDeserializer(configDto, new StorageProfileDtoWrapperDeserializer(storageProfile))); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
hub/src/main/java/cloud/katta/protocols/hub/HubOAuthTokensCredentialsConfigurator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright (c) 2025 shift7 GmbH. All rights reserved. | ||
| */ | ||
|
|
||
| package cloud.katta.protocols.hub; | ||
|
|
||
| import ch.cyberduck.core.Credentials; | ||
| import ch.cyberduck.core.CredentialsConfigurator; | ||
| import ch.cyberduck.core.Host; | ||
| import ch.cyberduck.core.HostPasswordStore; | ||
| import ch.cyberduck.core.OAuthTokens; | ||
|
|
||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
|
|
||
| public class HubOAuthTokensCredentialsConfigurator implements CredentialsConfigurator { | ||
| private static final Logger log = LogManager.getLogger(HubOAuthTokensCredentialsConfigurator.class); | ||
|
|
||
| private final HostPasswordStore keychain; | ||
| private final Host host; | ||
|
|
||
| private OAuthTokens tokens = OAuthTokens.EMPTY; | ||
|
|
||
| public HubOAuthTokensCredentialsConfigurator(final HostPasswordStore keychain, final Host host) { | ||
| this.keychain = keychain; | ||
| this.host = host; | ||
| } | ||
|
|
||
| @Override | ||
| public Credentials configure(final Host host) { | ||
| return new Credentials(host.getCredentials()).setOauth(tokens); | ||
| } | ||
|
|
||
| @Override | ||
| public CredentialsConfigurator reload() { | ||
| if(tokens.isExpired()) { | ||
| log.debug("Reload expired tokens from keychain for {}", host); | ||
| tokens = keychain.findOAuthTokens(host); | ||
| log.debug("Retrieved tokens {}", tokens); | ||
| } | ||
| return this; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.