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

chore: Remove disabled auth customization where it's no longer needed #1836

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,8 @@ internal val DISABLED_AUTH_OPERATIONS: Map<String, Set<String>> = mapOf(
"com.amazonaws.sts#AssumeRoleWithSAML",
"com.amazonaws.sts#AssumeRoleWithWebIdentity"
),
// Operations with missing optional auth: https://docs.aws.amazon.com/cognito/latest/developerguide/security_iam_service-with-iam.html
//
// Some of the following operations do correctly have the `optionalAuth` trait applied and therefore do not need this customization
// but maintaining the diff of operations that have the trait and which don't is a nightmare and so
// we are applying the trait to all operations listed in the documentation linked above.
"com.amazonaws.cognitoidentity#AWSCognitoIdentityService" to setOf(
"com.amazonaws.cognitoidentity#GetId",
"com.amazonaws.cognitoidentity#GetOpenIdToken",
"com.amazonaws.cognitoidentity#UnlinkIdentity",
"com.amazonaws.cognitoidentity#GetCredentialsForIdentity",
),
"com.amazonaws.cognitoidentityprovider#AWSCognitoIdentityProviderService" to setOf(
"com.amazonaws.cognitoidentityprovider#AssociateSoftwareToken",
"com.amazonaws.cognitoidentityprovider#ChangePassword",
"com.amazonaws.cognitoidentityprovider#ConfirmDevice",
"com.amazonaws.cognitoidentityprovider#ConfirmForgotPassword",
"com.amazonaws.cognitoidentityprovider#ConfirmSignUp",
"com.amazonaws.cognitoidentityprovider#DeleteUser",
"com.amazonaws.cognitoidentityprovider#DeleteUserAttributes",
"com.amazonaws.cognitoidentityprovider#ForgetDevice",
"com.amazonaws.cognitoidentityprovider#ForgotPassword",
"com.amazonaws.cognitoidentityprovider#GetDevice",
"com.amazonaws.cognitoidentityprovider#GetUser",
"com.amazonaws.cognitoidentityprovider#GetUserAttributeVerificationCode",
"com.amazonaws.cognitoidentityprovider#GlobalSignOut",
"com.amazonaws.cognitoidentityprovider#InitiateAuth",
"com.amazonaws.cognitoidentityprovider#ListDevices",
"com.amazonaws.cognitoidentityprovider#ResendConfirmationCode",
"com.amazonaws.cognitoidentityprovider#RespondToAuthChallenge",
"com.amazonaws.cognitoidentityprovider#RevokeToken",
"com.amazonaws.cognitoidentityprovider#SetUserMFAPreference",
"com.amazonaws.cognitoidentityprovider#SetUserSettings",
"com.amazonaws.cognitoidentityprovider#SignUp",
"com.amazonaws.cognitoidentityprovider#UpdateAuthEventFeedback",
"com.amazonaws.cognitoidentityprovider#UpdateDeviceStatus",
"com.amazonaws.cognitoidentityprovider#UpdateUserAttributes",
"com.amazonaws.cognitoidentityprovider#VerifySoftwareToken",
"com.amazonaws.cognitoidentityprovider#VerifyUserAttribute",
)
)

// TODO: If or when the service team adds this trait to their model, we can remove this customization
class DisabledAuth(private val disabledAuth: Map<String, Set<String>> = DISABLED_AUTH_OPERATIONS) : SwiftIntegration {
override fun enabledForService(model: Model, settings: SwiftSettings): Boolean {
Expand Down
Loading