diff --git a/legend-engine-protocol-api/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/PureProtocol.java b/legend-engine-protocol-api/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/PureProtocol.java index 9cb20c8a76b..ec6e7ab175f 100644 --- a/legend-engine-protocol-api/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/PureProtocol.java +++ b/legend-engine-protocol-api/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/PureProtocol.java @@ -95,7 +95,7 @@ public Response getSubtypeInfo() })); result.storeSubtypes = storeSubtypes.toList(); - MutableSet functionActivatorsSubtypes = Sets.mutable.empty(); + MutableSet functionActivatorSubtypes = Sets.mutable.empty(); PureProtocolExtensionLoader.extensions().forEach(extension -> LazyIterate.flatCollect(extension.getExtraProtocolSubTypeInfoCollectors(), Function0::value).forEach(info -> { @@ -103,23 +103,23 @@ public Response getSubtypeInfo() { if (FunctionActivator.class.isAssignableFrom(subType.getOne())) { - if (functionActivatorsSubtypes.contains(subType.getTwo())) + if (functionActivatorSubtypes.contains(subType.getTwo())) { // ignore duplications return; } - functionActivatorsSubtypes.add(subType.getTwo()); + functionActivatorSubtypes.add(subType.getTwo()); } }); })); - result.functionActivatorsSubtypes = functionActivatorsSubtypes.toList(); + result.functionActivatorSubtypes = functionActivatorSubtypes.toList(); return Response.status(200).type(MediaType.APPLICATION_JSON).entity(result).build(); } public static class SubtypeInfoResult { public List storeSubtypes; - public List functionActivatorsSubtypes; + public List functionActivatorSubtypes; } } diff --git a/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/language/pure/dsl/authentication/grammar/test/TestAuthenticationGrammarRoundtrip_AuthenticationTypes.java b/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/language/pure/dsl/authentication/grammar/test/TestAuthenticationGrammarRoundtrip_AuthenticationTypes.java index ffa59dee9fb..793b6d27556 100644 --- a/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/language/pure/dsl/authentication/grammar/test/TestAuthenticationGrammarRoundtrip_AuthenticationTypes.java +++ b/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/language/pure/dsl/authentication/grammar/test/TestAuthenticationGrammarRoundtrip_AuthenticationTypes.java @@ -19,11 +19,27 @@ public class TestAuthenticationGrammarRoundtrip_AuthenticationTypes extends TestGrammarRoundtrip.TestGrammarRoundtripTestSuite { + @Test + public void userPasswordAuthenticationWithImport() + { + testWithSectionInfoPreserved("###AuthenticationDemo\n" + + "import test::*;\n" + + "AuthenticationDemo demo::demo1\n" + + "{\n" + + " authentication: # UserPassword {\n" + + " username: 'alice';\n" + + " password: PropertiesFileSecret\n" + + " {\n" + + " propertyName: 'property1';\n" + + " };\n" + + " }#;\n" + + "}\n"); + } + @Test public void userPasswordAuthentication() { test("###AuthenticationDemo\n" + - "import test::*;\n" + "AuthenticationDemo demo::demo1\n" + "{\n" + " authentication: # UserPassword {\n" + @@ -40,7 +56,6 @@ public void userPasswordAuthentication() public void apiTokenAuthentication() { test("###AuthenticationDemo\n" + - "import test::*;\n" + "AuthenticationDemo demo::demo1\n" + "{\n" + " authentication: # ApiKey {\n" + @@ -58,7 +73,6 @@ public void apiTokenAuthentication() public void encryptedKeyPairAuthentication() { test("###AuthenticationDemo\n" + - "import test::*;\n" + "AuthenticationDemo demo::demo1\n" + "{\n" + " authentication: # EncryptedPrivateKey {\n" + @@ -79,7 +93,6 @@ public void encryptedKeyPairAuthentication() public void gcpWIFWithAWSIdP() { test("###AuthenticationDemo\n" + - "import test::*;\n" + "AuthenticationDemo demo::demo1\n" + "{\n" + " authentication: # GCPWIFWithAWSIdP {\n" +