-
Notifications
You must be signed in to change notification settings - Fork 261
feat(storage): multi bucket get properties api #5577
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 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
13d6723
updating storage_outputs class for multi-bucket support
c5c0438
seperated bucket out into its own class instead of using a map
f22dd48
made bucket_output class a proper output class like the others in amp…
cc6c55b
Update auth.dart
ekjotmultani b6f8719
added doc comments and changed name of bucket class
66ad860
Merge branch 'storagewereoutput-update' of https://github.com/aws-amp…
3fc0ce9
Delete devtools_options.yaml
ekjotmultani 9114206
added trailing commas to pass ci test
a17b602
Merge branch 'storage-output-update' of https://github.com/aws-amplif…
e7906c7
ran dart format on two failing files
6055a80
feat(core): add storage bucket type (#5478)
NikaHsn 24089ae
Merge pull request #5476 from aws-amplify/storage-output-update
ekjotmultani d01d0df
updated resource.ts and backend.ts for multiple buckets in our infra-…
47c1371
updated resource.ts and backend.ts for multiple buckets in our infra-…
0d4e492
Merge pull request #5492 from aws-amplify/multi-bucket-infra-update
ekjotmultani d68bb03
feat(storage): update s3 storage service to support multiple s3 clien…
NikaHsn 3eafd51
feat(storage): update uploadData API to accept optional storage bucke…
NikaHsn 1becb6f
added bucket option to getProperties api
ekjotmultani 3d717dd
added integration tests
ekjotmultani 3a13b3d
removed the use of specific s3 bucket names and regions, moved testin…
ekjotmultani 58ead62
added unauthiorized path test
ekjotmultani 7de725c
Update packages/amplify_core/lib/src/types/storage/get_properties_opt…
ekjotmultani 3bea1dc
Merge branch 'multi-bucket' into feat/multi-bucket-get-properties-api
ekjotmultani 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
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
22 changes: 20 additions & 2 deletions
22
infra-gen2/backends/storage/main/amplify/storage/resource.ts
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
47 changes: 47 additions & 0 deletions
47
packages/amplify_core/lib/src/config/amplify_outputs/storage/bucket_outputs.dart
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,47 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
part 'bucket_outputs.g.dart'; | ||
|
||
/// {@template amplify_core.amplify_outputs.bucket_outputs} | ||
/// The Amplify Gen 2 outputs for Buckets in the Storage category. | ||
/// {@endtemplate} | ||
@zAmplifyOutputsSerializable | ||
class BucketOutputs | ||
with AWSEquatable<BucketOutputs>, AWSSerializable, AWSDebuggable { | ||
/// {@macro amplify_core.amplify_outputs.bucket_outputs} | ||
const BucketOutputs({ | ||
required this.name, | ||
required this.bucketName, | ||
required this.awsRegion, | ||
}); | ||
|
||
factory BucketOutputs.fromJson(Map<String, Object?> json) => | ||
_$BucketOutputsFromJson(json); | ||
|
||
/// The user friendly name of the bucket | ||
final String name; | ||
|
||
/// The Amazon S3 bucket name. | ||
final String bucketName; | ||
|
||
/// The AWS region of Amazon S3 resources. | ||
final String awsRegion; | ||
|
||
@override | ||
List<Object?> get props => [ | ||
name, | ||
bucketName, | ||
awsRegion, | ||
]; | ||
|
||
@override | ||
String get runtimeTypeName => 'BucketOutputs'; | ||
|
||
@override | ||
Object? toJson() { | ||
return _$BucketOutputsToJson(this); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/amplify_core/lib/src/config/amplify_outputs/storage/bucket_outputs.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
26 changes: 21 additions & 5 deletions
26
packages/amplify_core/lib/src/config/amplify_outputs/storage/storage_outputs.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
15 changes: 15 additions & 0 deletions
15
packages/amplify_core/lib/src/types/exception/storage/invalid_storage_bucket_exception.dart
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,15 @@ | ||
part of '../amplify_exception.dart'; | ||
|
||
/// {@template amplify_core.storage.invalid_storage_bucket_exception} | ||
/// Exception thrown when the [StorageBucket] is invalid. | ||
/// {@endtemplate} | ||
class InvalidStorageBucketException extends StorageException { | ||
const InvalidStorageBucketException( | ||
super.message, { | ||
super.recoverySuggestion, | ||
super.underlyingException, | ||
}); | ||
|
||
@override | ||
String get runtimeTypeName => 'InvalidStorageBucketException'; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/amplify_core/lib/src/types/storage/bucket_info.dart
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,17 @@ | ||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
/// {@template amplify_core.storage.bucket_info} | ||
/// Presents a storage bucket information. | ||
/// {@endtemplate} | ||
class BucketInfo with AWSEquatable<BucketInfo> { | ||
/// {@macro amplify_core.storage.bucket_info} | ||
const BucketInfo({required this.bucketName, required this.region}); | ||
final String bucketName; | ||
final String region; | ||
|
||
@override | ||
List<Object?> get props => [ | ||
bucketName, | ||
region, | ||
]; | ||
} |
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
19 changes: 19 additions & 0 deletions
19
packages/amplify_core/lib/src/types/storage/storage_bucket.dart
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,19 @@ | ||
import 'package:amplify_core/src/config/amplify_outputs/storage/storage_outputs.dart'; | ||
import 'package:amplify_core/src/types/storage/bucket_info.dart'; | ||
import 'package:amplify_core/src/types/storage/storage_bucket_from_outputs.dart'; | ||
import 'package:meta/meta.dart'; | ||
|
||
/// Presents a storage bucket. | ||
class StorageBucket { | ||
/// Creates a [StorageBucket] from [BucketInfo]. | ||
const StorageBucket.fromBucketInfo(this._info); | ||
|
||
/// Creates a [StorageBucket] defined by the [name] in AmplifyOutputs file. | ||
factory StorageBucket.fromOutputs(String name) => | ||
StorageBucketFromOutputs(name); | ||
|
||
final BucketInfo _info; | ||
|
||
@internal | ||
BucketInfo resolveBucketInfo(StorageOutputs? storageOutputs) => _info; | ||
} |
Oops, something went wrong.
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.