Skip to content

chore(client-sso-oidc): move sts to peer #6224

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 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clients/client-sso-oidc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"dependencies": {
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-crypto/sha256-js": "5.2.0",
"@aws-sdk/client-sts": "*",
"@aws-sdk/core": "*",
"@aws-sdk/credential-provider-node": "*",
"@aws-sdk/middleware-host-header": "*",
Expand Down Expand Up @@ -59,6 +58,9 @@
"@smithy/util-utf8": "^3.0.0",
"tslib": "^2.6.2"
},
"peerDependencies": {
"@aws-sdk/client-sts": "*"
},
"devDependencies": {
"@tsconfig/node16": "16.1.3",
"@types/node": "^16.18.96",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ private AwsCredentialProviderUtils() {}
* The dependencies are skipped in first party credential providers to avoid circular dependency issue.
*/
public static void addAwsCredentialProviderDependencies(ServiceShape service, TypeScriptWriter writer) {
if (!service.getId().equals(ShapeId.from("com.amazonaws.ssooidc#AWSSSOOIDCService"))) {
boolean isStsClient =
service.getId().equals(ShapeId.from("com.amazonaws.sts#AWSSecurityTokenServiceV20110615"));
boolean isSsoOidcClient = service.getId().equals(ShapeId.from("com.amazonaws.ssooidc#AWSSSOOIDCService"));
if (!isSsoOidcClient) {
// SSO OIDC client is required in Sso credential provider
writer.addDependency(AwsDependency.SSO_OIDC_CLIENT);
}
if (!service.getId().equals(ShapeId.from("com.amazonaws.sts#AWSSecurityTokenServiceV20110615"))) {
if (!isStsClient) {
// STS client is required in Ini and WebIdentity credential providers
writer.addDependency(AwsDependency.STS_CLIENT);
if (isSsoOidcClient) {
// For the SSO OIDC client, adding the STS client as a peerDependency avoids circular dependency issues.
writer.addDependency(AwsDependency.STS_CLIENT_PEER);
} else {
writer.addDependency(AwsDependency.STS_CLIENT);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public enum AwsDependency implements Dependency {
TRANSCRIBE_STREAMING_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-transcribe-streaming"),
STS_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-sts"),
STS_CLIENT(NORMAL_DEPENDENCY, "@aws-sdk/client-sts"),
STS_CLIENT_PEER(PEER_DEPENDENCY, "@aws-sdk/client-sts"),
SSO_OIDC_CLIENT(NORMAL_DEPENDENCY, "@aws-sdk/client-sso-oidc"),
MIDDLEWARE_LOGGER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-logger"),
MIDDLEWARE_USER_AGENT("dependencies", "@aws-sdk/middleware-user-agent"),
Expand Down
Loading