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

feat!: Modularize identity and auth #751

Merged
merged 9 commits into from
Jun 12, 2024

Conversation

sichanyoo
Copy link
Contributor

@sichanyoo sichanyoo commented Jun 5, 2024

Companion PR: awslabs/aws-sdk-swift#1544

Issue #

awslabs/aws-sdk-swift#1382
awslabs/aws-sdk-swift#1383

Description of changes

Modularize identity & auth according to SRA.

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor Author

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Comments to help reviewers.

@@ -36,8 +36,10 @@ let package = Package(
.library(name: "SmithyXML", targets: ["SmithyXML"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 2 new modules: SmithyIdentity and SmithyHTTPAuth.

SmithyIdentity has concrete implementation of the Identity protocol from SmithyIdentityAPI module, such as AWSCredentialIdentity. It also has non-AWS specific AWS credential identity resolver such as StaticAWSCredentialIdentityResolver.

SmithyHTTPAuth has SigV4 signing config things moved from aws-sdk-swift. Moving the actual SigV4Signer and the auth schemes (e.g., SigV4AuthScheme) is on-hold for after HTTP modularization.

@@ -12,6 +12,7 @@ import class Smithy.Context
import class SmithyHTTPAPI.SdkHttpRequestBuilder
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Import statements have been made granular & updated to match new organization. No further comments will be made for this type of change.

@@ -1,21 +0,0 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is moved to SmithyHTTPAuth module.

@@ -0,0 +1,61 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was moved from aws-sdk-swift.

@@ -0,0 +1,103 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are all adapter methods that convert types in SmithyHTTPAuthAPI to matching CRT types.

@@ -1,9 +0,0 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is moved to Sources/SmithyIdentity/AWSCredentialIdentityResolver.swift, but git picked it up as deletion because the new file has new changes.

@@ -0,0 +1,26 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Organized into Context/ subdirectory along with other Context+XYZ files.

@@ -0,0 +1,11 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was moved from aws-sdk-swift to here.

@@ -0,0 +1,20 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was moved from aws-sdk-swift to here, as the thing it's testing was moved as well.

@@ -0,0 +1,22 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was moved from aws-sdk-swift to here, as the thing it tests was moved here.

@sichanyoo sichanyoo force-pushed the feat/modularize-identity-and-auth branch from 83ad11a to b5c8100 Compare June 5, 2024 23:53
@sichanyoo sichanyoo force-pushed the feat/modularize-identity-and-auth branch 2 times, most recently from 60a6fbb to 328c8df Compare June 7, 2024 16:59
Package.swift Outdated
.target(
name: "SmithyHTTPAuthAPI",
dependencies: ["Smithy", "SmithyHTTPAPI"]
dependencies: ["Smithy", "SmithyHTTPAPI", "SmithyIdentityAPI", "SmithyChecksumsAPI"]
Copy link
Contributor

Choose a reason for hiding this comment

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

SmithyChecksumsAPI shouldnt be a dependency here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as pointed out

// SPDX-License-Identifier: Apache-2.0
//

import enum SmithyChecksumsAPI.ChecksumAlgorithm
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a string / have no dependency on checksums

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as pointed out

@sichanyoo sichanyoo requested a review from dayaffe June 11, 2024 16:55
@sichanyoo sichanyoo merged commit 5855880 into main Jun 12, 2024
17 checks passed
@sichanyoo sichanyoo deleted the feat/modularize-identity-and-auth branch June 12, 2024 22:00
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.

None yet

3 participants