|
5 | 5 |
|
6 | 6 | package software.amazon.smithy.typescript.codegen.auth.http.integration;
|
7 | 7 |
|
8 |
| -import java.util.HashMap; |
9 | 8 | import java.util.Iterator;
|
10 | 9 | import java.util.List;
|
11 | 10 | import java.util.Map;
|
12 | 11 | import java.util.stream.Collectors;
|
13 |
| -import software.amazon.smithy.codegen.core.CodegenException; |
14 | 12 | import software.amazon.smithy.codegen.core.Symbol;
|
15 | 13 | import software.amazon.smithy.model.knowledge.ServiceIndex;
|
16 | 14 | import software.amazon.smithy.model.shapes.ServiceShape;
|
@@ -147,30 +145,15 @@ private getIdentityProviderConfigProvider() {
|
147 | 145 | s.getModel(),
|
148 | 146 | s.getSettings());
|
149 | 147 | ServiceIndex serviceIndex = ServiceIndex.of(s.getModel());
|
150 |
| - Map<ShapeId, HttpAuthScheme> httpAuthSchemes |
151 |
| - = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(s.getService(), serviceIndex, authIndex); |
152 |
| - // TODO(experimentalIdentityAndAuth): figure out a better deduping strategy |
153 |
| - Map<String, ConfigField> visitedConfigFields = new HashMap<>(); |
| 148 | + Map<ShapeId, HttpAuthScheme> httpAuthSchemes = |
| 149 | + AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(s.getService(), serviceIndex, authIndex); |
154 | 150 | for (HttpAuthScheme scheme : httpAuthSchemes.values()) {
|
155 | 151 | if (scheme == null) {
|
156 | 152 | continue;
|
157 | 153 | }
|
158 | 154 | for (ConfigField configField : scheme.getConfigFields()) {
|
159 |
| - if (visitedConfigFields.containsKey(configField.name())) { |
160 |
| - ConfigField visitedConfigField = visitedConfigFields.get(configField.name()); |
161 |
| - if (!configField.equals(visitedConfigField)) { |
162 |
| - throw new CodegenException("Contradicting `ConfigField` definitions for `" |
163 |
| - + configField.name() |
164 |
| - + "`; existing: " |
165 |
| - + visitedConfigField |
166 |
| - + ", conflict: " |
167 |
| - + configField); |
168 |
| - } |
169 |
| - } else { |
170 |
| - visitedConfigFields.put(configField.name(), configField); |
171 |
| - if (configField.type().equals(ConfigField.Type.MAIN)) { |
172 |
| - w.write("$S: config.$L,", scheme.getSchemeId().toString(), configField.name()); |
173 |
| - } |
| 155 | + if (configField.type().equals(ConfigField.Type.MAIN)) { |
| 156 | + w.write("$S: config.$L,", scheme.getSchemeId().toString(), configField.name()); |
174 | 157 | }
|
175 | 158 | }
|
176 | 159 | }
|
|
0 commit comments