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

changing terminology to more inclusive terms #4115

Merged
merged 2 commits into from
Aug 16, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,16 @@ private void setSimpleMethods(IntermediateModel model) {
} else {
inputShape.setSimpleMethod(false);

boolean methodIsNotBlacklisted = !config.getBlacklistedSimpleMethods().contains(methodName) ||
config.getBlacklistedSimpleMethods().stream().noneMatch(m -> m.equals("*"));
boolean methodIsNotExcluded = !config.getExcludedSimpleMethods().contains(methodName) ||
config.getExcludedSimpleMethods().stream().noneMatch(m -> m.equals("*")) ||
!config.getBlacklistedSimpleMethods().contains(methodName) ||
config.getBlacklistedSimpleMethods().stream().noneMatch(m -> m.equals("*"));
boolean methodHasNoRequiredMembers = !CollectionUtils.isNullOrEmpty(inputShape.getRequired());
boolean methodIsNotStreaming = !operation.isStreaming();
boolean methodHasSimpleMethodVerb = methodName.matches(Constant.APPROVED_SIMPLE_METHOD_VERBS);

if (methodIsNotBlacklisted && methodHasNoRequiredMembers && methodIsNotStreaming && methodHasSimpleMethodVerb) {
log.warn("A potential simple method exists that isn't whitelisted or blacklisted: " + methodName);
if (methodIsNotExcluded && methodHasNoRequiredMembers && methodIsNotStreaming && methodHasSimpleMethodVerb) {
log.warn("A potential simple method exists that isn't explicitly excluded or included: " + methodName);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ public class CustomizationConfig {
/**
* APIs that have no required arguments in their model but can't be called via a simple method
*/
private List<String> excludedSimpleMethods = new ArrayList<>();

/**
* APIs that have no required arguments in their model but can't be called via a simple method.
* Superseded by {@link #excludedSimpleMethods}
*/
@Deprecated
private List<String> blacklistedSimpleMethods = new ArrayList<>();

/**
Expand Down Expand Up @@ -373,10 +380,26 @@ public void setServiceSpecificHttpConfig(String serviceSpecificHttpConfig) {
this.serviceSpecificHttpConfig = serviceSpecificHttpConfig;
}

public List<String> getExcludedSimpleMethods() {
return excludedSimpleMethods;
}

public void setExcludedSimpleMethods(List<String> excludedSimpleMethods) {
this.excludedSimpleMethods = excludedSimpleMethods;
}

/**
* Use {@link #getExcludedSimpleMethods()}
*/
@Deprecated
public List<String> getBlacklistedSimpleMethods() {
return blacklistedSimpleMethods;
}

/**
* Use {@link #setExcludedSimpleMethods(List)}
*/
@Deprecated
public void setBlacklistedSimpleMethods(List<String> blackListedSimpleMethods) {
this.blacklistedSimpleMethods = blackListedSimpleMethods;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"customRetryPolicy": "software.amazon.MyServiceRetryPolicy",
"verifiedSimpleMethods" : ["paginatedOperationWithResultKey"],
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"eventStreamOperation"
],
"utilitiesMethod": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"customRetryPolicy": "software.amazon.MyServiceRetryPolicy",
"verifiedSimpleMethods" : ["paginatedOperationWithResultKey"],
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"eventStreamOperation"
],
"utilitiesMethod": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"allTypes",
"nestedContainers",
"operationWithNoInputOrOutput",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"allTypes",
"nestedContainers",
"operationWithNoInputOrOutput",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"allTypes",
"nestedContainers",
"operationWithNoInputOrOutput",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"allTypes",
"nestedContainers",
"operationWithNoInputOrOutput"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"allTypes",
"nestedContainers",
"operationWithNoInputOrOutput",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ private RetryOnExceptionsCondition(Set<Class<? extends Exception>> exceptionsToR

/**
* @param context Context about the state of the last request and information about the number of requests made.
* @return True if the exception class matches one of the whitelisted exceptions or if the cause of the exception matches the
* whitelisted exception.
* @return True if the exception class or the cause of the exception matches one of the exceptions supplied at
* initialization time.
*/
@Override
public boolean shouldRetry(RetryPolicyContext context) {
Expand All @@ -56,10 +56,10 @@ public boolean shouldRetry(RetryPolicyContext context) {
Predicate<Class<? extends Exception>> isRetryableException =
ex -> ex.isAssignableFrom(exception.getClass());

Predicate<Class<? extends Exception>> hasRetrableCause =
Predicate<Class<? extends Exception>> hasRetryableCause =
ex -> exception.getCause() != null && ex.isAssignableFrom(exception.getCause().getClass());

return exceptionsToRetryOn.stream().anyMatch(isRetryableException.or(hasRetrableCause));
return exceptionsToRetryOn.stream().anyMatch(isRetryableException.or(hasRetryableCause));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class SdkUserAgent {
+ "vendor/{java.vendor}";

/** Disallowed characters in the user agent token: @see <a href="https://tools.ietf.org/html/rfc7230#section-3.2.6">RFC 7230</a> */
private static final String UA_BLACKLIST_REGEX = "[() ,/:;<=>?@\\[\\]{}\\\\]";
private static final String UA_DENYLIST_REGEX = "[() ,/:;<=>?@\\[\\]{}\\\\]";

/** Shared logger for any issues while loading version information. */
private static final Logger log = LoggerFactory.getLogger(SdkUserAgent.class);
Expand Down Expand Up @@ -125,7 +125,7 @@ String getUserAgent() {
* @return the input with spaces replaced by underscores
*/
private static String sanitizeInput(String input) {
return input == null ? UNKNOWN : input.replaceAll(UA_BLACKLIST_REGEX, "_");
return input == null ? UNKNOWN : input.replaceAll(UA_DENYLIST_REGEX, "_");
}

private static String getAdditionalJvmLanguages() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"blacklistedSimpleMethods" : ["*"]
"excludedSimpleMethods" : ["*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"emitAsShape": "String"
}
},
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"updateAccount",
"createApiKey",
"generateClientCertificate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"describeExportConfigurations",
"getDiscoverySummary"
],
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"startContinuousExport",
"describeContinuousExports"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"updateFleet",
"describeUserStackAssociations"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"getSupportedResourceTypes"
],
"verifiedSimpleMethods" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"describeJobDefinitions",
"describeJobQueues"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"listJobs"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]
}
},
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"estimateTemplateCost",
"validateTemplate",
"getTemplate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exclude": [ "retryable" ]
}
},
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"describeHsm",
"describeLunaClient"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"listDashboards",
"listMetrics"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"deleteDashboards",
"putDashboard",
"getDashboard"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"deleteResourcePolicy",
"putResourcePolicy"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"verifiedSimpleMethods": [
"listRepositories"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"getBranch"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"listGitHubAccountTokenNames",
"listOnPremisesInstances"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"continueDeployment",
"skipWaitTimeForInstanceTermination",
"updateApplication",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"listPipelines",
"listWebhooks"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"deregisterWebhookWithThirdParty",
"registerWebhookWithThirdParty"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"associateSoftwareToken"
],
"shapeModifiers" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"getComplianceSummaryByResourceType",
"getDiscoveredResourceCounts"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"startConfigRulesEvaluation"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"verifiedSimpleMethods": [
"describeReportDefinitions"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"deleteReportDefinition"
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"blacklistedSimpleMethods" : ["getCostAndUsage"]
"excludedSimpleMethods" : ["getCostAndUsage"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"describeReplicationSubnetGroups",
"describeReplicationTasks"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"describeReplicationTaskAssessmentResults"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"listOfferings",
"listProjects"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"purchaseOffering",
"renewOffering",
"listVPCEConfigurations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"describeVirtualGateways",
"describeVirtualInterfaces"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"createBGPPeer",
"deleteBGPPeer",
"describeDirectConnectGatewayAttachments",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
]
}
},
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"acceptVpcPeeringConnection",
"authorizeSecurityGroupIngress",
"cancelImportTask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"listTaskDefinitionFamilies",
"listTaskDefinitions"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"discoverPollEndpoint",
"registerContainerInstance",
"submitContainerStateChange",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"verifiedSimpleMethods": [
"describeFileSystems"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"describeMountTargets"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"describeReservedCacheNodesOfferings",
"describeSnapshots"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"describeCacheSecurityGroups",
"listAllowedNodeTypeModifications"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]
}
},
"blacklistedSimpleMethods" : [
"excludedSimpleMethods" : [
"abortEnvironmentUpdate",
"composeEnvironments",
"deletePlatformVersion",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"describeSSLPolicies",
"describeTargetGroups"
],
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"describeRules",
"describeListeners"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]
}
},
"blacklistedSimpleMethods": [
"excludedSimpleMethods": [
"cancelSteps",
"modifyInstanceGroups",
"describeJobFlows"
Expand Down
Loading
Loading