This is an automated email from the ASF dual-hosted git repository. isjarana pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git
commit 9705f59e54d44abc5fea6db10144d4bacf00a8f1 Author: Isuru Ranawaka <[email protected]> AuthorDate: Tue Apr 6 00:25:20 2021 -0400 rest proxy for DB service, data population, custos integration --- airavata-data-lake.ipr | 306 +++++++--- airavata-data-lake.iws | 184 +++++- data-resource-management-service/.DS_Store | Bin 0 -> 6148 bytes data-resource-management-service/drms-api/pom.xml | 6 + .../java/org/apache/airavata/drms/api/Client.java | 109 ++-- .../java/org/apache/airavata/drms/api/Config.java | 2 +- .../drms/api/handlers/ResourceServiceHandler.java | 11 +- .../drms/api/interceptors/Authenticator.java | 62 +- .../interceptors/InterceptorPipelineExecutor.java | 2 +- .../org/apache/airavata/drms/api/utils/Utils.java | 24 + .../src/main/resources/application.properties | 4 +- .../drms-api/src/main/resources/tartget.tmp | 56 ++ .../drms-stubs/src/main/proto/Common.proto | 12 +- metadata-service/data-builders/data-builders.iml | 632 ++++++++++----------- metadata-service/db-rest-proxy/Dockerfile | 3 + metadata-service/db-rest-proxy/pom.xml | 16 + .../db-rest-proxy/src/main/resources/README.MD | 7 + .../db-rest-proxy/src/main/resources/envoy.yaml | 48 ++ .../db-rest-proxy/src/main/resources/metadata.pb | Bin 0 -> 19283 bytes .../airavata/datalake/metadata/clients/Test.java | 277 +++++++-- metadata-service/db-service/db-service.iml | 632 ++++++++++----------- .../metadata/handlers/ResourceServiceHandler.java | 16 + .../metadata/interceptors/Authenticator.java | 2 +- pom.xml | 1 + 24 files changed, 1586 insertions(+), 826 deletions(-) diff --git a/airavata-data-lake.ipr b/airavata-data-lake.ipr index 8d122fa..f4e8cf9 100644 --- a/airavata-data-lake.ipr +++ b/airavata-data-lake.ipr @@ -1,82 +1,230 @@ <?xml version="1.0" encoding="UTF-8"?> - -<project version="4"> - <component name="CodeStyleManager"> - <option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true"/> - <option name="CODE_STYLE_SCHEME" value=""/> - </component> - <component name="CompilerConfiguration"> +<project version="4"> + <component name="CodeStyleManager"> + <option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true" /> + <option name="CODE_STYLE_SCHEME" value="" /> + </component> + <component name="CompilerConfiguration"> <wildcardResourcePatterns> - <entry name="!?*.java"/> + <entry name="!?*.java" /> </wildcardResourcePatterns> - </component> - <component name="ExportToHTMLSettings"> - <option name="PRINT_LINE_NUMBERS" value="false"/> - <option name="OPEN_IN_BROWSER" value="false"/> - <option name="OUTPUT_DIRECTORY"/> - </component> - <component name="ImportConfiguration"> - <option name="VENDOR"/> - <option name="RELEASE_TAG"/> - <option name="LOG_MESSAGE"/> - <option name="CHECKOUT_AFTER_IMPORT" value="true"/> - </component> - <component name="InspectionProjectProfileManager"> - <profile version="1.0"> - <option name="myName" value="Project Default"/> - <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true"> - <option name="ignoredIdentifiers"> - <list> - <option value="client.impl.test._airavata_client_test.requests_oauthlib"/> - </list> - </option> - </inspection_tool> - </profile> - <version value="1.0"/> - </component> - <component name="JUnitProjectSettings"> - <option name="TEST_RUNNER" value="UI"/> - </component> - <component name="JavadocGenerationManager"> - <option name="OPTION_HIERARCHY" value="false"/> - <option name="OPTION_NAVIGATOR" value="false"/> - <option name="OPTION_INDEX" value="false"/> - <option name="OPTION_SEPARATE_INDEX" value="false"/> - <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="false"/> - <option name="OPTION_DEPRECATED_LIST" value="false"/> - <option name="OPEN_IN_BROWSER" value="false"/> - </component> - <component name="JikesSettings"> - <option name="DEBUGGING_INFO" value="true"/> - <option name="DEPRECATION" value="true"/> - <option name="GENERATE_NO_WARNINGS" value="false"/> - <option name="GENERATE_MAKE_FILE_DEPENDENCIES" value="false"/> - <option name="DO_FULL_DEPENDENCE_CHECK" value="false"/> - <option name="IS_INCREMENTAL_MODE" value="false"/> - <option name="IS_EMACS_ERRORS_MODE" value="true"/> - <option name="ADDITIONAL_OPTIONS_STRING" value=""/> - <option name="MAXIMUM_HEAP_SIZE" value="128"/> - </component> - <component name="ProjectModuleManager"> - <modules> - <module filepath="$PROJECT_DIR$/airavata-data-lake.iml"/> - <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator-api/data-orchestrator-api.iml"/> - <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator-core/data-orchestrator-core.iml"/> - <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/db-service/client/client.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/db-service/server/server.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/db-service/stub/stub.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/db-service/db-service.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/data-builders/data-builders.iml"/> - <module filepath="$PROJECT_DIR$/metadata-service/metadata-service.iml"/> - <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/drms-stubs.iml"/> - <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-core/drms-core.iml"/> - <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-api/drms-api.iml"/> - <module filepath="$PROJECT_DIR$/data-resource-management-service/data-resource-management-service.iml"/> - </modules> - </component> - <component name="ProjectRootManager" version="2" project-jdk-name="11." assert-keyword="true" jdk-15="true"/> - <component name="VcsDirectoryMappings"> - <mapping directory="$PROJECT_DIR$" vcs="Git"/> - </component> -</project> + <annotationProcessing> + <profile name="Maven default annotation processors profile" enabled="true"> + <sourceOutputDir name="target/generated-sources/annotations" /> + <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> + <outputRelativeToContentRoot value="true" /> + </profile> + </annotationProcessing> + <bytecodeTargetLevel> + <module name="drms-rest-proxy" target="11" /> + </bytecodeTargetLevel> + </component> + <component name="ExportToHTMLSettings"> + <option name="PRINT_LINE_NUMBERS" value="false" /> + <option name="OPEN_IN_BROWSER" value="false" /> + <option name="OUTPUT_DIRECTORY" /> + </component> + <component name="ImportConfiguration"> + <option name="VENDOR" /> + <option name="RELEASE_TAG" /> + <option name="LOG_MESSAGE" /> + <option name="CHECKOUT_AFTER_IMPORT" value="true" /> + </component> + <component name="InspectionProjectProfileManager"> + <profile version="1.0"> + <option name="myName" value="Project Default" /> + <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true"> + <option name="ignoredIdentifiers"> + <list> + <option value="client.impl.test._airavata_client_test.requests_oauthlib" /> + </list> + </option> + </inspection_tool> + </profile> + <version value="1.0" /> + </component> + <component name="JUnitProjectSettings"> + <option name="TEST_RUNNER" value="UI" /> + </component> + <component name="JavadocGenerationManager"> + <option name="OPTION_HIERARCHY" value="false" /> + <option name="OPTION_NAVIGATOR" value="false" /> + <option name="OPTION_INDEX" value="false" /> + <option name="OPTION_SEPARATE_INDEX" value="false" /> + <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="false" /> + <option name="OPTION_DEPRECATED_LIST" value="false" /> + <option name="OPEN_IN_BROWSER" value="false" /> + </component> + <component name="JikesSettings"> + <option name="DEBUGGING_INFO" value="true" /> + <option name="DEPRECATION" value="true" /> + <option name="GENERATE_NO_WARNINGS" value="false" /> + <option name="GENERATE_MAKE_FILE_DEPENDENCIES" value="false" /> + <option name="DO_FULL_DEPENDENCE_CHECK" value="false" /> + <option name="IS_INCREMENTAL_MODE" value="false" /> + <option name="IS_EMACS_ERRORS_MODE" value="true" /> + <option name="ADDITIONAL_OPTIONS_STRING" value="" /> + <option name="MAXIMUM_HEAP_SIZE" value="128" /> + </component> + <component name="Palette2"> + <group name="Swing"> + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> + </item> + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> + <initial-values> + <property name="text" value="Button" /> + </initial-values> + </item> + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="RadioButton" /> + </initial-values> + </item> + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="CheckBox" /> + </initial-values> + </item> + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="Label" /> + </initial-values> + </item> + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> + <preferred-size width="-1" height="20" /> + </default-constraints> + </item> + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> + </item> + </group> + </component> + <component name="ProjectModuleManager"> + <modules> + <module filepath="$PROJECT_DIR$/airavata-data-lake.iml" /> + <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator-api/data-orchestrator-api.iml" /> + <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator-core/data-orchestrator-core.iml" /> + <module filepath="$PROJECT_DIR$/data-orchestrator/data-orchestrator.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/db-service/client/client.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/db-service/server/server.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/db-service/stub/stub.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/db-service/db-service.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/data-builders/data-builders.iml" /> + <module filepath="$PROJECT_DIR$/metadata-service/metadata-service.iml" /> + <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/drms-stubs.iml" /> + <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-core/drms-core.iml" /> + <module filepath="$PROJECT_DIR$/data-resource-management-service/drms-api/drms-api.iml" /> + <module filepath="$PROJECT_DIR$/data-resource-management-service/data-resource-management-service.iml" /> + </modules> + </component> + <component name="ProjectRootManager" version="2" project-jdk-name="11." /> + <component name="RemoteRepositoriesConfiguration"> + <remote-repository> + <option name="id" value="central" /> + <option name="name" value="Central Repository" /> + <option name="url" value="https://repo.maven.apache.org/maven2" /> + </remote-repository> + <remote-repository> + <option name="id" value="central" /> + <option name="name" value="Maven Central repository" /> + <option name="url" value="https://repo1.maven.org/maven2" /> + </remote-repository> + <remote-repository> + <option name="id" value="jboss.community" /> + <option name="name" value="JBoss Community repository" /> + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> + </remote-repository> + </component> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + <mapping directory="$PROJECT_DIR$/metadata-service/db-rest-proxy/googleapis" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/airavata-data-lake.iws b/airavata-data-lake.iws index 8ab2583..750b531 100644 --- a/airavata-data-lake.iws +++ b/airavata-data-lake.iws @@ -1,20 +1,32 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> + <component name="AutoImportSettings"> + <option name="autoReloadType" value="SELECTIVE" /> + </component> <component name="ChangeListManager"> <list default="true" id="1d1ef003-bfaa-49fa-837e-dc14d1daa977" name="Default Changelist" comment=""> + <change afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/utils/Utils.java" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/resources/tartget.tmp" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/metadata-service/db-rest-proxy/Dockerfile" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/metadata-service/db-rest-proxy/pom.xml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/metadata-service/db-rest-proxy/src/main/resources/README.MD" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/metadata-service/db-rest-proxy/src/main/resources/envoy.yaml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/metadata-service/db-rest-proxy/src/main/resources/metadata.pb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/airavata-data-lake.ipr" beforeDir="false" afterPath="$PROJECT_DIR$/airavata-data-lake.ipr" afterDir="false" /> <change beforePath="$PROJECT_DIR$/airavata-data-lake.iws" beforeDir="false" afterPath="$PROJECT_DIR$/airavata-data-lake.iws" afterDir="false" /> <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/pom.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-core/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-core/pom.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/pom.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/resources/application.properties" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/src/main/proto/Common.proto" beforeDir="false" afterPath="$PROJECT_DIR$/data-resource-management-service/drms-stubs/src/main/proto/Common.proto" afterDir="false" /> <change beforePath="$PROJECT_DIR$/metadata-service/data-builders/data-builders.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/data-builders/data-builders.iml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/metadata-service/db-service/client/client.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/client/client.iml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/metadata-service/db-service/db-service.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/db-service.iml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/metadata-service/db-service/server/server.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/server/server.iml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/metadata-service/db-service/stub/src/main/proto/user/User.proto" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/stub/src/main/proto/user/User.proto" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/metadata-service/db-service/stub/stub.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/stub/stub.iml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/metadata-service/metadata-service.iml" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/metadata-service.iml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java" beforeDir="false" afterPath="$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> @@ -183,6 +195,13 @@ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" /> <option name="HIDE_WARNINGS" value="false" /> </component> + <component name="FileTemplateManagerImpl"> + <option name="RECENT_TEMPLATES"> + <list> + <option value="Class" /> + </list> + </option> + </component> <component name="Git.Settings"> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> </component> @@ -233,6 +252,7 @@ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" /> </component> <component name="ProjectId" id="1qIwzKXRgDSeysvYRgK6Nz5WfE0" /> + <component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectViewSettings"> <navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="false" autoscrollToSource="false" splitterProportion="0.5" /> <view id="ProjectPane"> @@ -260,10 +280,19 @@ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="aspect.path.notification.shown" value="true" /> - <property name="last_opened_file_path" value="$PROJECT_DIR$" /> + <property name="last_opened_file_path" value="$PROJECT_DIR$/metadata-service" /> <property name="nodejs_package_manager_path" value="npm" /> </component> - <component name="RunManager" selected="Spring Boot.DRMSApiRunner"> + <component name="RecentsManager"> + <key name="CopyFile.RECENT_KEYS"> + <recent name="$PROJECT_DIR$/metadata-service" /> + </key> + <key name="MoveFile.RECENT_KEYS"> + <recent name="$PROJECT_DIR$/metadata-service/db-rest-proxy/src/main/resources" /> + <recent name="$PROJECT_DIR$/data-resource-management-service/drms-rest-proxy/src/main/resources" /> + </key> + </component> + <component name="RunManager" selected="Application.Test"> <configuration selected="false" default="true" type="Applet" factoryName="Applet"> <module name="" /> <option name="MAIN_CLASS_NAME" /> @@ -274,6 +303,34 @@ <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" /> <option name="VM_PARAMETERS" /> </configuration> + <configuration name="Client" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="org.apache.airavata.drms.api.Client" /> + <module name="drms-api" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> + <extension name="coverage"> + <pattern> + <option name="PATTERN" value="org.apache.airavata.drms.api.*" /> + <option name="ENABLED" value="true" /> + </pattern> + </extension> + <method v="2"> + <option name="Make" enabled="true" /> + </method> + </configuration> + <configuration name="Test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="org.apache.airavata.datalake.metadata.clients.Test" /> + <module name="client" /> + <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> + <extension name="coverage"> + <pattern> + <option name="PATTERN" value="org.apache.airavata.datalake.metadata.clients.*" /> + <option name="ENABLED" value="true" /> + </pattern> + </extension> + <method v="2"> + <option name="Make" enabled="true" /> + </method> + </configuration> <configuration default="true" type="Application" factoryName="Application"> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <method v="2"> @@ -330,8 +387,10 @@ </configuration> <recent_temporary> <list> - <item itemvalue="Spring Boot.DRMSApiRunner" /> + <item itemvalue="Application.Test" /> <item itemvalue="Spring Boot.Neo4JServiceInitializer" /> + <item itemvalue="Spring Boot.DRMSApiRunner" /> + <item itemvalue="Application.Client" /> </list> </recent_temporary> </component> @@ -373,6 +432,12 @@ <option name="presentableId" value="Default" /> <updated>1616780673526</updated> <workItem from="1616780675479" duration="3812000" /> + <workItem from="1616789834771" duration="6207000" /> + <workItem from="1616819158882" duration="1124000" /> + <workItem from="1616938907343" duration="738000" /> + <workItem from="1616955618046" duration="1487000" /> + <workItem from="1616977751983" duration="68000" /> + <workItem from="1617213356776" duration="25360000" /> </task> <servers /> </component> @@ -414,9 +479,6 @@ <component name="TypeScriptGeneratedFilesManager"> <option name="version" value="3" /> </component> - <component name="VcsManagerConfiguration"> - <option name="ACTIVE_VCS_NAME" value="git" /> - </component> <component name="VssConfiguration"> <CheckoutOptions> <option name="COMMENT" value="" /> @@ -469,4 +531,100 @@ <component name="WebViewSettings"> <webview flattenPackages="false" showMembers="false" autoscrollToSource="false" /> </component> + <component name="XDebuggerManager"> + <breakpoint-manager> + <breakpoints> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java</url> + <line>27</line> + <option name="timeStamp" value="1" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java</url> + <line>30</line> + <option name="timeStamp" value="4" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>42</line> + <option name="timeStamp" value="13" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>43</line> + <option name="timeStamp" value="14" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>44</line> + <option name="timeStamp" value="15" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>104</line> + <option name="timeStamp" value="16" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>103</line> + <option name="timeStamp" value="17" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>jar://$USER_HOME$/.m13/org/apache/custos/user-management-client/1.0-SNAPSHOT/user-management-client-1.0-SNAPSHOT.jar!/org/apache/custos/user/management/client/UserManagementClient.class</url> + <line>102</line> + <option name="timeStamp" value="18" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java</url> + <line>78</line> + <option name="timeStamp" value="19" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java</url> + <line>77</line> + <option name="timeStamp" value="20" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java</url> + <line>73</line> + <option name="timeStamp" value="22" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java</url> + <line>29</line> + <option name="timeStamp" value="23" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java</url> + <line>68</line> + <option name="timeStamp" value="25" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java</url> + <line>46</line> + <option name="timeStamp" value="30" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java</url> + <line>48</line> + <option name="timeStamp" value="31" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java</url> + <line>52</line> + <option name="timeStamp" value="32" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java</url> + <line>50</line> + <option name="timeStamp" value="33" /> + </line-breakpoint> + <line-breakpoint enabled="true" type="java-line"> + <url>file://$PROJECT_DIR$/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java</url> + <line>58</line> + <option name="timeStamp" value="34" /> + </line-breakpoint> + </breakpoints> + </breakpoint-manager> + </component> </project> \ No newline at end of file diff --git a/data-resource-management-service/.DS_Store b/data-resource-management-service/.DS_Store new file mode 100644 index 0000000..8d0b1ee Binary files /dev/null and b/data-resource-management-service/.DS_Store differ diff --git a/data-resource-management-service/drms-api/pom.xml b/data-resource-management-service/drms-api/pom.xml index ec3e0e0..227b4ac 100644 --- a/data-resource-management-service/drms-api/pom.xml +++ b/data-resource-management-service/drms-api/pom.xml @@ -69,5 +69,11 @@ <artifactId>custos-java-sdk</artifactId> <version>${custos.clients.version}</version> </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-core</artifactId> + <version>${spring-security.version}</version> + </dependency> + </dependencies> </project> \ No newline at end of file diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java index 8e589ef..af5e740 100644 --- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Client.java @@ -16,55 +16,70 @@ */ package org.apache.airavata.drms.api; -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; -import org.apache.airavata.datalake.drms.DRMSServiceAuthToken; -import org.apache.airavata.datalake.drms.groups.*; -import org.apache.airavata.datalake.drms.storage.*; - public class Client { public static void main(String ar[]) { +// +// DRMSServiceAuthToken token1 = DRMSServiceAuthToken.newBuilder().setAccessToken("Token-1").build(); +// DRMSServiceAuthToken token2 = DRMSServiceAuthToken.newBuilder().setAccessToken("Token-2").build(); +// +// ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 6565).usePlaintext().build(); +// StorageServiceGrpc.StorageServiceBlockingStub storageClient = StorageServiceGrpc.newBlockingStub(channel); +// +// System.out.println("List for user 1"); +// StorageSearchResponse storages = storageClient.searchStorage( +// StorageSearchRequest.newBuilder().setAuthToken(token1).build()); +// System.out.println(storages); +// +// System.out.println("List for user 2"); +// storages = storageClient.searchStorage( +// StorageSearchRequest.newBuilder().setAuthToken(token2).build()); +// System.out.println(storages); +// +// System.out.println("Fetch"); +// StorageFetchResponse fetchResponse = storageClient.fetchStorage( +// StorageFetchRequest.newBuilder().setAuthToken(token1).setStorageId("staging_pga_storage").buildPartial()); +// +// System.out.println(fetchResponse); +// +// GroupServiceGrpc.GroupServiceBlockingStub groupClient = GroupServiceGrpc.newBlockingStub(channel); +// +// System.out.println("User"); +// FetchCurrentUserResponse currentUser = groupClient.fetchCurrentUser( +// FetchCurrentUserRequest.newBuilder().setAuthToken(token1).build()); +// System.out.println(currentUser); +// +// System.out.println("Groups"); +// FetchCurrentUserGroupsResponse currentGroups = groupClient.fetchCurrentUserGroups( +// FetchCurrentUserGroupsRequest.newBuilder().setAuthToken(token2).build()); +// System.out.println(currentGroups); +// +// System.out.println("Adding metadata"); +// storageClient.addStorageMetadata(AddStorageMetadataRequest.newBuilder() +// .setAuthToken(token1) +// .setStorageId("prod_pga") +// .setKey("createdOn") +// .setValue("02/15/2021") +// .build()); - DRMSServiceAuthToken token1 = DRMSServiceAuthToken.newBuilder().setAccessToken("Token-1").build(); - DRMSServiceAuthToken token2 = DRMSServiceAuthToken.newBuilder().setAccessToken("Token-2").build(); - - ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 6565).usePlaintext().build(); - StorageServiceGrpc.StorageServiceBlockingStub storageClient = StorageServiceGrpc.newBlockingStub(channel); - - System.out.println("List for user 1"); - StorageSearchResponse storages = storageClient.searchStorage( - StorageSearchRequest.newBuilder().setAuthToken(token1).build()); - System.out.println(storages); - - System.out.println("List for user 2"); - storages = storageClient.searchStorage( - StorageSearchRequest.newBuilder().setAuthToken(token2).build()); - System.out.println(storages); - - System.out.println("Fetch"); - StorageFetchResponse fetchResponse = storageClient.fetchStorage( - StorageFetchRequest.newBuilder().setAuthToken(token1).setStorageId("staging_pga_storage").buildPartial()); - - System.out.println(fetchResponse); - - GroupServiceGrpc.GroupServiceBlockingStub groupClient = GroupServiceGrpc.newBlockingStub(channel); - - System.out.println("User"); - FetchCurrentUserResponse currentUser = groupClient.fetchCurrentUser( - FetchCurrentUserRequest.newBuilder().setAuthToken(token1).build()); - System.out.println(currentUser); - - System.out.println("Groups"); - FetchCurrentUserGroupsResponse currentGroups = groupClient.fetchCurrentUserGroups( - FetchCurrentUserGroupsRequest.newBuilder().setAuthToken(token2).build()); - System.out.println(currentGroups); - - System.out.println("Adding metadata"); - storageClient.addStorageMetadata(AddStorageMetadataRequest.newBuilder() - .setAuthToken(token1) - .setStorageId("prod_pga") - .setKey("createdOn") - .setValue("02/15/2021") - .build()); +// try { +// InputStream inputStream = ClientUtils.getServerCertificate("custos.scigap.org", +// "custos-2zuomcugra3ebgsqtzmf-10000514", "mupUhF4JL0S3IFHBjfhiTfLJS1NgSWfvkCj3l6c7"); +// byte[] buffer = new byte[inputStream.available()]; +// inputStream.read(buffer); +// +// File targetFile = new File("/Users/isururanawaka/Documents/Airavata_Repository/airavata-data-lake/data-resource-management-service/drms-api/src/main/resources/tartget.tmp"); +// OutputStream outStream = new FileOutputStream(targetFile); +// outStream.write(buffer); +// +// CustosClientProvider custosClientProvider = new CustosClientProvider.Builder().setServerHost("custos.scigap.org") +// .setServerPort(31499) +// .setClientId("custos-2zuomcugra3ebgsqtzmf-10000514") +// .setClientSec("mupUhF4JL0S3IFHBjfhiTfLJS1NgSWfvkCj3l6c7").build(); +// UserManagementClient userManagementClient = custosClientProvider.getUserManagementClient(); +// userManagementClient.getUser("testuser123", "custos-2zuomcugra3ebgsqtzmf-10000514"); +// +// } catch (Exception ex) { +// +// } } } diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java index 8e60619..701cc77 100644 --- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/Config.java @@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; - import java.util.Stack; @Configuration @@ -50,6 +49,7 @@ public class Config { return interceptors; } + @Bean @GRpcGlobalInterceptor public ServerInterceptor validationInterceptor(Stack<ServiceInterceptor> integrationServiceInterceptors) { diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java index 9917ee8..cb0d2e4 100644 --- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/handlers/ResourceServiceHandler.java @@ -20,6 +20,7 @@ import com.google.protobuf.Empty; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.stub.StreamObserver; +import org.apache.airavata.datalake.drms.AuthenticatedUser; import org.apache.airavata.datalake.drms.DRMSServiceAuthToken; import org.apache.airavata.datalake.drms.groups.FetchCurrentUserRequest; import org.apache.airavata.datalake.drms.groups.FetchCurrentUserResponse; @@ -29,8 +30,6 @@ import org.apache.airavata.datalake.drms.resource.GenericResource; import org.apache.airavata.datalake.drms.storage.*; import org.apache.airavata.drms.core.Neo4JConnector; import org.apache.airavata.drms.core.constants.ResourceConstants; -import org.apache.airavata.drms.core.constants.StorageConstants; -import org.apache.airavata.drms.core.deserializer.AnyStoragePreferenceDeserializer; import org.apache.airavata.drms.core.deserializer.GenericResourceDeserializer; import org.apache.airavata.drms.core.deserializer.MetadataDeserializer; import org.lognet.springboot.grpc.GRpcService; @@ -65,14 +64,16 @@ public class ResourceServiceHandler extends ResourceServiceGrpc.ResourceServiceI @Override public void fetchResource(ResourceFetchRequest request, StreamObserver<ResourceFetchResponse> responseObserver) { - User callUser = getUser(request.getAuthToken()); +// User callUser = getUser(request.getAuthToken()); + + AuthenticatedUser callUser = request.getAuthToken().getAuthenticatedUser(); // TODO review (u)-[r4:MEMBER_OF]->(g2:Group)<-[r5:SHARED_WITH]-(sp), List<Record> records = this.neo4JConnector.searchNodes( "MATCH (u:User)-[r1:MEMBER_OF]->(g:Group)<-[r2:SHARED_WITH]-(s:Storage)-[r3:HAS_PREFERENCE]->(sp:StoragePreference)-[r6:HAS_RESOURCE]->(res:Resource), " + "(u)-[r7:MEMBER_OF]->(g3:Group)<-[r8:SHARED_WITH]-(res) " + "where res.resourceId = '" + request.getResourceId() + "' and u.userId = '" - + callUser.getUserId() + "' return distinct res, sp, s"); + + callUser.getUsername() + "' return distinct res, sp, s"); if (!records.isEmpty()) { try { @@ -143,7 +144,7 @@ public class ResourceServiceHandler extends ResourceServiceGrpc.ResourceServiceI public void fetchResourceMetadata(FetchResourceMetadataRequest request, StreamObserver<FetchResourceMetadataResponse> responseObserver) { User callUser = getUser(request.getAuthToken()); List<Record> records = neo4JConnector.searchNodes("match (u:User)-[MEMBER_OF]->(g:Group)<-[SHARED_WITH]-(res:Resource)-[r:HAS_METADATA]->(m:Metadata) " + - "where u.userId ='" + callUser.getUserId()+ "' and res.resourceId = '" + request.getResourceId() + "' return distinct m"); + "where u.userId ='" + callUser.getUserId() + "' and res.resourceId = '" + request.getResourceId() + "' return distinct m"); try { List<MetadataNode> metadataNodes = MetadataDeserializer.deserializeList(records); if (metadataNodes.size() == 1) { diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java index 127eb20..8476f44 100644 --- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/Authenticator.java @@ -1,6 +1,8 @@ package org.apache.airavata.drms.api.interceptors; import io.grpc.Metadata; +import org.apache.airavata.datalake.drms.AuthenticatedUser; +import org.apache.airavata.datalake.drms.DRMSServiceAuthToken; import org.apache.airavata.datalake.drms.storage.*; import org.apache.custos.clients.CustosClientProvider; import org.apache.custos.identity.management.client.IdentityManagementClient; @@ -25,15 +27,15 @@ public class Authenticator implements ServiceInterceptor { public <ReqT> ReqT intercept(String method, Metadata headers, ReqT msg) throws IOException { IdentityManagementClient identityManagementClient = custosClientProvider.getIdentityManagementClient(); Optional<String> token = getAccessToken(msg); + LOGGER.info("Token " + token.get()); User user = identityManagementClient.getUser(token.get()); - org.apache.airavata.datalake.drms.groups.User drmsUser = org.apache.airavata.datalake.drms.groups.User - .newBuilder() - .setUserId(user.getUsername()) + AuthenticatedUser authenticatedUser = AuthenticatedUser.newBuilder() + .setUsername(user.getUsername()) .setFirstName(user.getFirstName()) .setLastName(user.getLastName()) .setEmailAddress(user.getEmailAddress()) .build(); - return msg; + return (ReqT) setAuthenticatedUser(msg, authenticatedUser); } @@ -79,4 +81,56 @@ public class Authenticator implements ServiceInterceptor { } return Optional.empty(); } + + private Object setAuthenticatedUser(Object msg, AuthenticatedUser user) { + + if (msg instanceof StorageCreateRequest) { + + } else if (msg instanceof StorageFetchRequest) { + + } else if (msg instanceof StorageUpdateRequest) { + + } else if (msg instanceof StorageDeleteRequest) { + + } else if (msg instanceof StorageSearchRequest) { + + } else if (msg instanceof AddStorageMetadataRequest) { + + } else if (msg instanceof ResourceCreateRequest) { + + } else if (msg instanceof ResourceFetchRequest) { + + } else if (msg instanceof ResourceUpdateRequest) { + + } else if (msg instanceof ResourceDeleteRequest) { + + } else if (msg instanceof ResourceSearchRequest) { + + } else if (msg instanceof AddResourceMetadataRequest) { + + } else if (msg instanceof FetchResourceMetadataRequest) { + DRMSServiceAuthToken drmsServiceAuthToken = ((FetchResourceMetadataRequest) msg) + .getAuthToken(); + drmsServiceAuthToken = drmsServiceAuthToken + .toBuilder() + .setAuthenticatedUser(user) + .build(); + + return ((FetchResourceMetadataRequest) msg) + .toBuilder() + .setAuthToken(drmsServiceAuthToken).build(); + + } else if (msg instanceof StoragePreferenceFetchRequest) { + + } else if (msg instanceof StoragePreferenceUpdateRequest) { + + } else if (msg instanceof StoragePreferenceDeleteRequest) { + + } else if (msg instanceof StoragePreferenceCreateRequest) { + + } else if (msg instanceof StoragePreferenceSearchRequest) { + + } + return Optional.empty(); + } } diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java index 02f6104..632142b 100644 --- a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/interceptors/InterceptorPipelineExecutor.java @@ -27,7 +27,7 @@ public class InterceptorPipelineExecutor implements ServerInterceptor { String methodName = fullMethod.split("/")[1]; String serviceName = fullMethod.split("/")[0]; - LOGGER.debug("Calling method : " + serverCall.getMethodDescriptor().getFullMethodName()); + LOGGER.info("Calling method : " + serverCall.getMethodDescriptor().getFullMethodName()); metadata.put(Metadata.Key.of("service-name", Metadata.ASCII_STRING_MARSHALLER), serviceName); return new ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>(serverCallHandler.startCall(serverCall, metadata)) { diff --git a/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/utils/Utils.java b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/utils/Utils.java new file mode 100644 index 0000000..215045a --- /dev/null +++ b/data-resource-management-service/drms-api/src/main/java/org/apache/airavata/drms/api/utils/Utils.java @@ -0,0 +1,24 @@ +package org.apache.airavata.drms.api.utils; + +import io.grpc.Context; + +import java.util.concurrent.ConcurrentHashMap; + +public class Utils { + + private static ConcurrentHashMap<String, Context.Key<Object>> keyMap = new ConcurrentHashMap<String, Context.Key<Object>>(); + + public static final String CONTEXT_HOLDER = "CONTEXT_HOLDER"; + + public static Context.Key<Object> getUserContextKey() { + if (keyMap.containsKey("AUTHORIZED_USER")) { + return keyMap.get("AUTHORIZED_USER"); + } + keyMap.put("AUTHORIZED_USER", Context.key("AUTHORIZED_USER")); + return keyMap.get("AUTHORIZED_USER"); + } + + + + +} diff --git a/data-resource-management-service/drms-api/src/main/resources/application.properties b/data-resource-management-service/drms-api/src/main/resources/application.properties index 6dee75c..d891249 100644 --- a/data-resource-management-service/drms-api/src/main/resources/application.properties +++ b/data-resource-management-service/drms-api/src/main/resources/application.properties @@ -21,7 +21,7 @@ neo4j.server.user=neo4j neo4j.server.password=123456 group.service.host=localhost group.service.port=6565 -custos.id=CHANGE_ME -custos.secret=CHANGE_ME +custos.id=custos-2zuomcugra3ebgsqtzmf-10000514 +custos.secret=mupUhF4JL0S3IFHBjfhiTfLJS1NgSWfvkCj3l6c7 custos.host=custos.scigap.org custos.port=31499 \ No newline at end of file diff --git a/data-resource-management-service/drms-api/src/main/resources/tartget.tmp b/data-resource-management-service/drms-api/src/main/resources/tartget.tmp new file mode 100644 index 0000000..07c3bb0 --- /dev/null +++ b/data-resource-management-service/drms-api/src/main/resources/tartget.tmp @@ -0,0 +1,56 @@ +-----BEGIN CERTIFICATE----- +MIIFKjCCBBKgAwIBAgISBHWm/A/7Wq1r4f7gqAYjZxU8MA0GCSqGSIb3DQEBCwUA +MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD +EwJSMzAeFw0yMTA0MDUxODE3MThaFw0yMTA3MDQxODE3MThaMBwxGjAYBgNVBAMT +EWN1c3Rvcy5zY2lnYXAub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAlzLIIKcgn00KX1unCcM2EmzyscgDmncYAsjLtAasHC1M/fYnGomRvL35SxCt +J1GxNGS0wWpL0HSQqK4NwSIbFNSgEkad+g0X+M0A3hmECoidOciKE37MW8I4e6qz +IOYPdnlQSzIke+VPwsTksZNxU04BabeXXc//eRsRjLo5mL2N6LmyYxujjQb3Wf1s +McWLW9Z5Listgk80d5eQmKGZDHnWw3ei2JqJv6GIpchJqeDeTxf5VzaaJU6y8IN5 +hdaRTaQufEKhJaCYhZIsHx8ibJqgmMNAIQOORIYTCgxmIjZJGiiZySX3JojrLv34 +vbUWCm2DmCcjakbcckp/vZAnxwIDAQABo4ICTjCCAkowDgYDVR0PAQH/BAQDAgWg +MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0G +A1UdDgQWBBQ2CC0Ox2Mz9IT1gPvLnXf7tfczJjAfBgNVHSMEGDAWgBQULrMXt1hW +y65QCUDmH6+dixTCxjBVBggrBgEFBQcBAQRJMEcwIQYIKwYBBQUHMAGGFWh0dHA6 +Ly9yMy5vLmxlbmNyLm9yZzAiBggrBgEFBQcwAoYWaHR0cDovL3IzLmkubGVuY3Iu +b3JnLzAcBgNVHREEFTATghFjdXN0b3Muc2NpZ2FwLm9yZzBMBgNVHSAERTBDMAgG +BmeBDAECATA3BgsrBgEEAYLfEwEBATAoMCYGCCsGAQUFBwIBFhpodHRwOi8vY3Bz +LmxldHNlbmNyeXB0Lm9yZzCCAQYGCisGAQQB1nkCBAIEgfcEgfQA8gB3AJQgvB6O +1Y1siHMfgosiLA3R2k1ebE+UPWHbTi9YTaLCAAABeKN3w1cAAAQDAEgwRgIhAPtc +Fc0vF72o6df8FDVECCVYpi0R0j4CDMZzxIxMTrUuAiEA4rv8CDC0holjWwYr8kqE +/ojgeOVZHMEjKMjrWyJqgmMAdwD2XJQv0XcwIhRUGAgwlFaO400TGTO/3wwvIAvM +TvFk4wAAAXijd8NeAAAEAwBIMEYCIQCwTTUJp56hHxyv/Bwv0HaNBneUqJbDywcc +rhTudIWP9wIhAOHdbuNrEW9Sqk2f3vR/wSWZeUzoTDcFWTDaSHFRWcMnMA0GCSqG +SIb3DQEBCwUAA4IBAQArH3S0UprKbMRULva+hQzdTq5JCHkrCex44pd+zW3EAl8G +sVWI2J3XxlDZ2nTbIggyO698mvLgAI2sECVWUizj+jBijYSJiPOAuv2IiddHuhuu +xtP0C3/brN0tRWLP+9QXON0d4Mis+JHjl4zBklMzd5c7dm2b//DiBwLj+bAyHQdS +RFzGyFnxL7fZ3XD0bfMlsjmYkfw01Qi2mTfDCbQRIc6722b7KXwH3LK3MF65iA/W +1dSxirAjcPaZgTaWMAmHGQ5JghSlQGyOrxXlVKetTHj+rSl0+ueaj67uthjrYVe6 ++J7hj6dn1azwb/OPSqmFgg1gA93xItHLX/Zgr3dw +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEZTCCA02gAwIBAgIQQAF1BIMUpMghjISpDBbN3zANBgkqhkiG9w0BAQsFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTIwMTAwNzE5MjE0MFoXDTIxMDkyOTE5MjE0MFow +MjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxCzAJBgNVBAMT +AlIzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuwIVKMz2oJTTDxLs +jVWSw/iC8ZmmekKIp10mqrUrucVMsa+Oa/l1yKPXD0eUFFU1V4yeqKI5GfWCPEKp +Tm71O8Mu243AsFzzWTjn7c9p8FoLG77AlCQlh/o3cbMT5xys4Zvv2+Q7RVJFlqnB +U840yFLuta7tj95gcOKlVKu2bQ6XpUA0ayvTvGbrZjR8+muLj1cpmfgwF126cm/7 +gcWt0oZYPRfH5wm78Sv3htzB2nFd1EbjzK0lwYi8YGd1ZrPxGPeiXOZT/zqItkel +/xMY6pgJdz+dU/nPAeX1pnAXFK9jpP+Zs5Od3FOnBv5IhR2haa4ldbsTzFID9e1R +oYvbFQIDAQABo4IBaDCCAWQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8E +BAMCAYYwSwYIKwYBBQUHAQEEPzA9MDsGCCsGAQUFBzAChi9odHRwOi8vYXBwcy5p +ZGVudHJ1c3QuY29tL3Jvb3RzL2RzdHJvb3RjYXgzLnA3YzAfBgNVHSMEGDAWgBTE +p7Gkeyxx+tvhS5B1/8QVYIWJEDBUBgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEE +AYLfEwEBATAwMC4GCCsGAQUFBwIBFiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2Vu +Y3J5cHQub3JnMDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuaWRlbnRydXN0 +LmNvbS9EU1RST09UQ0FYM0NSTC5jcmwwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYf +r52LFMLGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0B +AQsFAAOCAQEA2UzgyfWEiDcx27sT4rP8i2tiEmxYt0l+PAK3qB8oYevO4C5z70kH +ejWEHx2taPDY/laBL21/WKZuNTYQHHPD5b1tXgHXbnL7KqC401dk5VvCadTQsvd8 +S8MXjohyc9z9/G2948kLjmE6Flh9dDYrVYA9x2O+hEPGOaEOa1eePynBgPayvUfL +qjBstzLhWVQLGAkXXmNs+5ZnPBxzDJOLxhF2JIbeQAcH5H0tZrUlo5ZYyOqA7s9p +O5b85o3AM/OJ+CktFBQtfvBhcJVd9wvlwPsk+uyOy2HI7mNxKKgsBTt375teA2Tw +UdHkhVNcsAKX1H7GNNLOEADksd86wuoXvg== +-----END CERTIFICATE----- diff --git a/data-resource-management-service/drms-stubs/src/main/proto/Common.proto b/data-resource-management-service/drms-stubs/src/main/proto/Common.proto index 8511c74..16ec044 100644 --- a/data-resource-management-service/drms-stubs/src/main/proto/Common.proto +++ b/data-resource-management-service/drms-stubs/src/main/proto/Common.proto @@ -22,6 +22,16 @@ package org.apache.airavata.datalake.drms; import "google/api/annotations.proto"; + +message AuthenticatedUser { + string username = 2; + string firstName = 3; + string lastName = 4; + string emailAddress = 5; +} + message DRMSServiceAuthToken { string access_token = 1; -} \ No newline at end of file + AuthenticatedUser authenticated_user = 2; +} + diff --git a/metadata-service/data-builders/data-builders.iml b/metadata-service/data-builders/data-builders.iml index 70cae32..be087cb 100644 --- a/metadata-service/data-builders/data-builders.iml +++ b/metadata-service/data-builders/data-builders.iml @@ -106,558 +106,558 @@ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project"/> <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project"/> <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project"/> - <orderEntry type="module-library"> - <library> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/github/lognet/grpc-spring-boot-starter/3.5.1/grpc-spring-boot-starter-3.5.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-netty/1.25.0/grpc-netty-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-core/1.25.0/grpc-core-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-api/1.25.0/grpc-api-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-context/1.25.0/grpc-context-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/errorprone/error_prone_annotations/2.3.3/error_prone_annotations-2.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/guava/28.1-android/guava-28.1-android.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/perfmark/perfmark-api/0.19.0/perfmark-api-0.19.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/opencensus/opencensus-api/0.21.0/opencensus-api-0.21.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/opencensus/opencensus-contrib-grpc-metrics/0.21.0/opencensus-contrib-grpc-metrics-0.21.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-http2/4.1.42.Final/netty-codec-http2-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-common/4.1.42.Final/netty-common-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-buffer/4.1.42.Final/netty-buffer-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-transport/4.1.42.Final/netty-transport-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-resolver/4.1.42.Final/netty-resolver-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec/4.1.42.Final/netty-codec-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-handler/4.1.42.Final/netty-handler-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-http/4.1.42.Final/netty-codec-http-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-handler-proxy/4.1.42.Final/netty-handler-proxy-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-socks/4.1.42.Final/netty-codec-socks-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-services/1.25.0/grpc-services-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-protobuf/1.25.0/grpc-protobuf-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/api/grpc/proto-google-common-protos/1.12.0/proto-google-common-protos-1.12.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-protobuf-lite/1.25.0/grpc-protobuf-lite-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-stub/1.25.0/grpc-stub-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-tcnative-boringssl-static/2.0.25.Final/netty-tcnative-boringssl-static-2.0.25.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-bolt-driver/3.2.20/neo4j-ogm-bolt-driver-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-api/3.2.20/neo4j-ogm-api-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-databind/2.9.9/jackson-databind-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.9/jackson-datatype-jdk8-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.9/jackson-datatype-jsr310-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/driver/neo4j-java-driver/4.0.2/neo4j-java-driver-4.0.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-core/3.2.20/neo4j-ogm-core-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/commons/commons-lang3/3.8/commons-lang3-3.8.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/github/classgraph/classgraph/4.8.86/classgraph-4.8.86.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/net/sf/dozer/dozer/5.5.1/dozer-5.5.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/commons-beanutils/commons-beanutils/1.9.1/commons-beanutils-1.9.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-web/2.4.2/spring-boot-starter-web-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter/2.4.2/spring-boot-starter-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot/2.4.2/spring-boot-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-core/5.3.3/spring-core-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-jcl/5.3.3/spring-jcl-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-context/5.3.3/spring-context-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-aop/5.3.3/spring-aop-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-beans/5.3.3/spring-beans-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-expression/5.3.3/spring-expression-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-autoconfigure/2.4.2/spring-boot-autoconfigure-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-logging/2.4.2/spring-boot-starter-logging-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-json/2.4.2/spring-boot-starter-json-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-web/5.3.3/spring-web-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.4/jackson-module-parameter-names-2.11.4.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-tomcat/2.4.2/spring-boot-starter-tomcat-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/tomcat/embed/tomcat-embed-core/9.0.41/tomcat-embed-core-9.0.41.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.41/tomcat-embed-websocket-9.0.41.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-webmvc/5.3.3/spring-webmvc-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> + </library> + </orderEntry> </component> </module> diff --git a/metadata-service/db-rest-proxy/Dockerfile b/metadata-service/db-rest-proxy/Dockerfile new file mode 100644 index 0000000..f9a1e4c --- /dev/null +++ b/metadata-service/db-rest-proxy/Dockerfile @@ -0,0 +1,3 @@ +FROM envoyproxy/envoy:v1.14.1 +COPY src/main/resources/metadata.pb /data/metadata.pb +COPY src/main/resources/envoy.yaml /etc/envoy/envoy.yaml \ No newline at end of file diff --git a/metadata-service/db-rest-proxy/pom.xml b/metadata-service/db-rest-proxy/pom.xml new file mode 100644 index 0000000..cd2339f --- /dev/null +++ b/metadata-service/db-rest-proxy/pom.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.example</groupId> + <artifactId>drms-rest-proxy</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.target>11</maven.compiler.target> + </properties> + +</project> \ No newline at end of file diff --git a/metadata-service/db-rest-proxy/src/main/resources/README.MD b/metadata-service/db-rest-proxy/src/main/resources/README.MD new file mode 100644 index 0000000..1fa269d --- /dev/null +++ b/metadata-service/db-rest-proxy/src/main/resources/README.MD @@ -0,0 +1,7 @@ +# Run DRMS envoy proxy locally +1. Build docker image + `docker build -t metadata-proxy .` + +2. Run docker image + `docker run --rm -it -p 10000:50000 metadata-proxy:latest -c /etc/envoy/envoy.yaml ` + \ No newline at end of file diff --git a/metadata-service/db-rest-proxy/src/main/resources/envoy.yaml b/metadata-service/db-rest-proxy/src/main/resources/envoy.yaml new file mode 100644 index 0000000..8ccda7b --- /dev/null +++ b/metadata-service/db-rest-proxy/src/main/resources/envoy.yaml @@ -0,0 +1,48 @@ +admin: + access_log_path: /tmp/admin_access.log + address: + socket_address: { address: 0.0.0.0, port_value: 9901 } + +static_resources: + listeners: + - name: main-listener + address: + socket_address: { address: 0.0.0.0, port_value: 50000 } + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + stat_prefix: grpc_json + codec_type: AUTO + route_config: + name: local_route + virtual_hosts: + - name: local_service + domains: ["*"] + routes: + - match: { prefix: "/", grpc: {} } + route: { cluster: grpc-backend-services, timeout: { seconds: 60 } } + http_filters: + - name: envoy.grpc_json_transcoder + config: + proto_descriptor: "/data/metadata.pb" + services: ["org.apache.airavata.datalake.metadata.service.GroupMetadataService", "org.apache.airavata.datalake.metadata.service.ResourceMetadataService", + "org.apache.airavata.datalake.metadata.service.UserMetadataService","org.apache.airavata.datalake.metadata.service.TenantMetadataService"] + convert_grpc_status: true + print_options: + add_whitespace: true + always_print_primitive_fields: true + always_print_enums_as_ints: false + preserve_proto_field_names: true + - name: envoy.router + clusters: + - name: grpc-backend-services + connect_timeout: 1.25s + type: logical_dns + lb_policy: round_robin + dns_lookup_family: V4_ONLY + http2_protocol_options: {} + hosts: + - socket_address: + address: host.docker.internal + port_value: 9090 \ No newline at end of file diff --git a/metadata-service/db-rest-proxy/src/main/resources/metadata.pb b/metadata-service/db-rest-proxy/src/main/resources/metadata.pb new file mode 100644 index 0000000..b1cda11 Binary files /dev/null and b/metadata-service/db-rest-proxy/src/main/resources/metadata.pb differ diff --git a/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java b/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java index b2705ad..cf50fdc 100644 --- a/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java +++ b/metadata-service/db-service/client/src/main/java/org/apache/airavata/datalake/metadata/clients/Test.java @@ -11,73 +11,260 @@ public class Test { Tenant tenant = Tenant.newBuilder() - .setTenantId("100010402") - .setName("TenantA") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setName("Custos tutorial demo gateway hosted version") .build(); Group group = Group.newBuilder() - .setName("g1") - .setTenantId("100010402") + .setName("Jackie's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); Group group2 = Group.newBuilder() - .setName("g3") - .setTenantId("100010402") + .setName("Jackson's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group3 = Group.newBuilder() + .setName("Jack's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group4 = Group.newBuilder() + .setName("Suresh's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group5 = Group.newBuilder() + .setName("Dinuka's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group6 = Group.newBuilder() + .setName("Sanjiva's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group7 = Group.newBuilder() + .setName("Thomas's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group8 = Group.newBuilder() + .setName("Jane's Lab") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group9 = Group.newBuilder() + .setName("Read Only Admin") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Group group10 = Group.newBuilder() + .setName("Admin") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); User user = User.newBuilder() - .setUsername("TestingUserA") - .setFirstName("Isuru") - .setLastName("Ranawaka") - .setTenantId("100010402") + .setUsername("testuser") + .setFirstName("Custos") + .setLastName("AdminD") + .setEmailAddress("[email protected]") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + User user1 = User.newBuilder() + .setUsername("sophia") + .setFirstName("Sophia") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + User user2 = User.newBuilder() + .setUsername("[email protected]") + .setFirstName("Dinuka") + .setLastName("DeSilva") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + User user3 = User.newBuilder() + .setUsername("audrey") + .setFirstName("Audrey") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setEmailAddress("[email protected]") + .build(); + + User user4 = User.newBuilder() + .setUsername("alice") + .setFirstName("Alice") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setEmailAddress("[email protected]") + .build(); + + User user5 = User.newBuilder() + .setUsername("adalee") + .setFirstName("Adalee") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setEmailAddress("[email protected]") + .build(); + + User user6 = User.newBuilder() + .setUsername("abigaill") + .setFirstName("Abigaill") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setEmailAddress("[email protected]") + .build(); + + User user7 = User.newBuilder() + .setUsername("abelota") + .setFirstName("Abelota") + .setLastName("Aron") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .setEmailAddress("[email protected]") .build(); GroupMembership groupMemberships = GroupMembership .newBuilder() .setUser(user) - .setMembershipType("ADMIN") + .setMembershipType("OWNER") .build(); - - Group group1 = Group.newBuilder() - .setName("g2") - .setTenantId("100010402") - .addChildGroups(group2) + GroupMembership groupMembership1 = GroupMembership + .newBuilder() + .setUser(user3) + .setMembershipType("MEMBER") + .build(); + GroupMembership groupMembership2 = GroupMembership + .newBuilder() + .setUser(user4) + .setMembershipType("MEMBER") + .build(); + GroupMembership groupMembership3 = GroupMembership + .newBuilder() + .setUser(user7) + .setMembershipType("MEMBER") .build(); - group1 = group1.toBuilder() + group10 = group10.toBuilder() .addGroupMembership(groupMemberships) - .setTenantId("100010402") + .addGroupMembership(groupMembership1) + .addGroupMembership(groupMembership2) + .addGroupMembership(groupMembership3) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + GroupMembership groupMembership4 = GroupMembership + .newBuilder() + .setUser(user) + .setMembershipType("OWNER") + .build(); + GroupMembership groupMembership5 = GroupMembership + .newBuilder() + .setUser(user7) + .setMembershipType("MEMBER") + .build(); + + group9 = group9.toBuilder() + .addGroupMembership(groupMembership4) + .addGroupMembership(groupMembership5) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + + group9 = group9.toBuilder() + .addChildGroups(group10) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + GroupMembership groupMembership6 = GroupMembership + .newBuilder() + .setUser(user6) + .setMembershipType("OWNER") + .build(); + GroupMembership groupMembership7 = GroupMembership + .newBuilder() + .setUser(user) + .setMembershipType("MEMBER") + .build(); + + + group8 = group8.toBuilder() + .addGroupMembership(groupMembership6) + .addGroupMembership(groupMembership7) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); - group = group.toBuilder() - .addChildGroups(group1) - .setTenantId("100010402") + + GroupMembership groupMembership9 = GroupMembership + .newBuilder() + .setUser(user) + .setMembershipType("OWNER") + .build(); + GroupMembership groupMembership10 = GroupMembership + .newBuilder() + .setUser(user6) + .setMembershipType("MEMBER") .build(); + GroupMembership groupMembership11 = GroupMembership + .newBuilder() + .setUser(user7) + .setMembershipType("MEMBER") + .build(); + + group7 = group7.toBuilder() + .addGroupMembership(groupMembership9) + .addGroupMembership(groupMembership10) + .addGroupMembership(groupMembership11) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + GroupMembership groupMembership12 = GroupMembership + .newBuilder() + .setUser(user) + .setMembershipType("OWNER") + .build(); + + GroupMembership groupMembership13 = GroupMembership + .newBuilder() + .setUser(user6) + .setMembershipType("MEMBER") + .build(); + + group6 = group6.toBuilder() + .addGroupMembership(groupMembership12) + .addGroupMembership(groupMembership13) + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + + Resource resource = Resource.newBuilder() - .setName("R1") - .setTenantId("100010402") + .setName("FileA") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); Resource resource1 = Resource.newBuilder() - .setName("R2") - .setTenantId("100010402") + .setName("FileB") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); Resource resource2 = Resource.newBuilder() - .setName("R3") - .setTenantId("100010402") + .setName("FileC") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); resource1 = resource1.toBuilder() .addChildResources(resource2) - .setTenantId("100010402") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") .build(); ResourceSharings resourceSharings = ResourceSharings .newBuilder() .setPermissionType("READ") - .addGroups(group2) + .addGroups(group6) .build(); resource1 = resource1.toBuilder() @@ -90,12 +277,21 @@ public class Test { tenant = tenant.toBuilder() .addGroups(group) + .addGroups(group2) + .addGroups(group3) + .addGroups(group4) + .addGroups(group5) + .addGroups(group6) + .addGroups(group7) + .addGroups(group9) + .addGroups(group8) .build(); tenant = tenant.toBuilder() .addResources(resource) .build(); + TenantMetadataAPIRequest request = TenantMetadataAPIRequest .newBuilder() .setTenant(tenant) @@ -104,16 +300,17 @@ public class Test { // stub.createTenant(request); // -// ResourceMetadataServiceGrpc.ResourceMetadataServiceBlockingStub resourceMetadataServiceBlockingStub = serviceClient.resource(); -// -// ResourcePermissionRequest permissionRequest = ResourcePermissionRequest -// .newBuilder() -// .setPermissionType("READ") -// .setUsername("TestingUserA") -// .setResourceName("R5") -// .setTenantId("100010402") -// .build(); -// ResourcePermissionResponse response = resourceMetadataServiceBlockingStub.hasAccess(permissionRequest); + ResourceMetadataServiceGrpc.ResourceMetadataServiceBlockingStub resourceMetadataServiceBlockingStub = serviceClient.resource(); + + ResourcePermissionRequest permissionRequest = ResourcePermissionRequest + .newBuilder() + .setPermissionType("READ") + .setUsername("testuser") + .setResourceName("FileA") + .setTenantId("custos-cmcdclbywlxmc2ktzv0d-10000702") + .build(); + ResourcePermissionResponse response = resourceMetadataServiceBlockingStub.hasAccess(permissionRequest); + System.out.println(response.getAccessible()); // TenantMetadataAPIRequest tenantMetadataAPIRequest = TenantMetadataAPIRequest @@ -129,7 +326,7 @@ public class Test { .newBuilder() .setTenant(tenant) .build(); - stub.updateTenant(tenantMetadataAPIRequest); + stub.createTenant(tenantMetadataAPIRequest); } } diff --git a/metadata-service/db-service/db-service.iml b/metadata-service/db-service/db-service.iml index 0c0c8aa..bb91897 100644 --- a/metadata-service/db-service/db-service.iml +++ b/metadata-service/db-service/db-service.iml @@ -91,558 +91,558 @@ <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project"/> <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project"/> <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project"/> - <orderEntry type="module-library"> - <library> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/github/lognet/grpc-spring-boot-starter/3.5.1/grpc-spring-boot-starter-3.5.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-netty/1.25.0/grpc-netty-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-core/1.25.0/grpc-core-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-api/1.25.0/grpc-api-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-context/1.25.0/grpc-context-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/errorprone/error_prone_annotations/2.3.3/error_prone_annotations-2.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/guava/28.1-android/guava-28.1-android.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/perfmark/perfmark-api/0.19.0/perfmark-api-0.19.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/opencensus/opencensus-api/0.21.0/opencensus-api-0.21.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/opencensus/opencensus-contrib-grpc-metrics/0.21.0/opencensus-contrib-grpc-metrics-0.21.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-http2/4.1.42.Final/netty-codec-http2-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-common/4.1.42.Final/netty-common-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-buffer/4.1.42.Final/netty-buffer-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-transport/4.1.42.Final/netty-transport-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-resolver/4.1.42.Final/netty-resolver-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec/4.1.42.Final/netty-codec-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-handler/4.1.42.Final/netty-handler-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-http/4.1.42.Final/netty-codec-http-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-handler-proxy/4.1.42.Final/netty-handler-proxy-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-codec-socks/4.1.42.Final/netty-codec-socks-4.1.42.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-services/1.25.0/grpc-services-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-protobuf/1.25.0/grpc-protobuf-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/api/grpc/proto-google-common-protos/1.12.0/proto-google-common-protos-1.12.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-protobuf-lite/1.25.0/grpc-protobuf-lite-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/grpc/grpc-stub/1.25.0/grpc-stub-1.25.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/netty/netty-tcnative-boringssl-static/2.0.25.Final/netty-tcnative-boringssl-static-2.0.25.Final.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-bolt-driver/3.2.20/neo4j-ogm-bolt-driver-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-api/3.2.20/neo4j-ogm-api-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-databind/2.9.9/jackson-databind-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.9/jackson-datatype-jdk8-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.9/jackson-datatype-jsr310-2.9.9.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/driver/neo4j-java-driver/4.0.2/neo4j-java-driver-4.0.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/neo4j/neo4j-ogm-core/3.2.20/neo4j-ogm-core-3.2.20.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/commons/commons-lang3/3.8/commons-lang3-3.8.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/io/github/classgraph/classgraph/4.8.86/classgraph-4.8.86.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/net/sf/dozer/dozer/5.5.1/dozer-5.5.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/commons-beanutils/commons-beanutils/1.9.1/commons-beanutils-1.9.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-web/2.4.2/spring-boot-starter-web-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter/2.4.2/spring-boot-starter-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot/2.4.2/spring-boot-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-core/5.3.3/spring-core-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-jcl/5.3.3/spring-jcl-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-context/5.3.3/spring-context-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-aop/5.3.3/spring-aop-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-beans/5.3.3/spring-beans-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-expression/5.3.3/spring-expression-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-autoconfigure/2.4.2/spring-boot-autoconfigure-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-logging/2.4.2/spring-boot-starter-logging-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-json/2.4.2/spring-boot-starter-json-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-web/5.3.3/spring-web-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.4/jackson-module-parameter-names-2.11.4.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/boot/spring-boot-starter-tomcat/2.4.2/spring-boot-starter-tomcat-2.4.2.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/tomcat/embed/tomcat-embed-core/9.0.41/tomcat-embed-core-9.0.41.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.41/tomcat-embed-websocket-9.0.41.jar!/"/> </CLASSES> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> <CLASSES> <root url="jar:///Users/isururanawaka/.m13/org/springframework/spring-webmvc/5.3.3/spring-webmvc-5.3.3.jar!/"/> </CLASSES> - </library> - </orderEntry> + </library> + </orderEntry> </component> </module> diff --git a/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java b/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java index 1009fb1..15ef54e 100644 --- a/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java +++ b/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/handlers/ResourceServiceHandler.java @@ -11,6 +11,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; + @GRpcService public class ResourceServiceHandler extends ResourceMetadataServiceGrpc.ResourceMetadataServiceImplBase { private static final Logger LOGGER = LoggerFactory.getLogger(UserServiceHandler.class); @@ -42,6 +44,20 @@ public class ResourceServiceHandler extends ResourceMetadataServiceGrpc.Resource StreamObserver<Resource> responseObserver) { try { + ResourceServiceImpl resourceService = new ResourceServiceImpl(connector); + Resource resource = request.getResource(); + org.apache.airavata.datalake.metadata.backend.neo4j.model.nodes.Resource backRes = dozerBeanMapper + .map(resource, org.apache.airavata.datalake.metadata.backend.neo4j.model.nodes.Resource.class); + List<org.apache.airavata.datalake.metadata.backend.neo4j.model.nodes.Resource> resourceList = + resourceService.find(backRes); + Resource foundResource = Resource + .newBuilder() + .setName(resourceList.get(0).getName()) + .setCreatedAt(resourceList.get(0).getCreatedAt()) + .setTenantId(resourceList.get(0).getTenantId()) + .build(); + responseObserver.onNext(foundResource); + responseObserver.onCompleted(); } catch (Exception ex) { String msg = "Exception occurred while fetching tenant " + ex; diff --git a/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java b/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java index 2eeaa0e..c530e73 100644 --- a/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java +++ b/metadata-service/db-service/server/src/main/java/org/apache/airavata/datalake/metadata/interceptors/Authenticator.java @@ -12,7 +12,7 @@ public class Authenticator implements ServiceInterceptor { @Override public <ReqT> ReqT intercept(String method, Metadata headers, ReqT msg) { - LOGGER.info("Calling interceptor #######"); + return msg; } diff --git a/pom.xml b/pom.xml index e13cffd..69205f7 100644 --- a/pom.xml +++ b/pom.xml @@ -146,6 +146,7 @@ <neo4j.ogm.version>3.2.20</neo4j.ogm.version> <neo4j.version>3.4.6</neo4j.version> <io.grpc.version>1.25.0</io.grpc.version> + <spring-security.version>5.3.4.RELEASE</spring-security.version> </properties>
