From 9076ef3c2bfe82bb5662c03c95c34a47b08b63d6 Mon Sep 17 00:00:00 2001
From: Sonia Zorba <sonia.zorba@inaf.it>
Date: Mon, 11 Nov 2019 10:05:24 +0100
Subject: [PATCH] Minor changes

---
 README.md                                             | 11 +++++++++++
 gms-client/gms-cli/gms.properties                     |  9 ++++++---
 gms-ui/src/store.js                                   |  3 +++
 gms/pom.xml                                           |  3 +++
 .../it/inaf/ia2/gms/service/SearchServiceTest.java    |  3 ++-
 5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 31c6305..ca093b5 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,17 @@ To run:
 
     docker run --env-file docker-env -d -p 8081:8081 -i -t gms:latest
 
+## Command line clients
+
+To add a command line client first generate the sha256 of its password:
+
+    echo -n password | sha256sum
+
+Then insert the client line into the database:
+
+    INSERT INTO gms_client (client_id, client_secret, allowed_actions, ip_filter)
+    VALUES ('test', '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', '{"*"}', NULL);
+
 ## Developer notes
 
 Backend and frontend are 2 separate applications:
diff --git a/gms-client/gms-cli/gms.properties b/gms-client/gms-cli/gms.properties
index a299861..846a803 100644
--- a/gms-client/gms-cli/gms.properties
+++ b/gms-client/gms-cli/gms.properties
@@ -1,3 +1,6 @@
-base_url=http://localhost:8081/gms
-client_id=test
-client_secret=test
+#base_url=http://localhost:8081/gms
+#client_id=test
+#client_secret=test
+base_url=https://sso.ia2.inaf.it/gms
+client_id=sso-admin
+client_secret=cXjbauYe8g
diff --git a/gms-ui/src/store.js b/gms-ui/src/store.js
index ff7e99d..0a44fd6 100644
--- a/gms-ui/src/store.js
+++ b/gms-ui/src/store.js
@@ -71,12 +71,15 @@ export default new Vuex.Store({
     },
     updateGroupsPanel(state, groupsPanel) {
       this.state.model.groupsPanel = groupsPanel;
+      this.state.input.paginatorPage = groupsPanel.currentPage;
     },
     updatePermissionsPanel(state, permissionsPanel) {
       this.state.model.permissionsPanel = permissionsPanel;
+      this.state.input.paginatorPage = permissionsPanel.currentPage;
     },
     updateMembersPanel(state, membersPanel) {
       this.state.model.membersPanel = membersPanel;
+      this.state.input.paginatorPage = membersPanel.currentPage;
     },
     setTabIndex(state, tabIndex) {
       // this will trigger the tabChanged() method in Main.vue
diff --git a/gms/pom.xml b/gms/pom.xml
index ae112f7..fb2694e 100644
--- a/gms/pom.xml
+++ b/gms/pom.xml
@@ -122,6 +122,9 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <executable>true</executable>
+                </configuration>
             </plugin>
         </plugins>
     </build>
diff --git a/gms/src/test/java/it/inaf/ia2/gms/service/SearchServiceTest.java b/gms/src/test/java/it/inaf/ia2/gms/service/SearchServiceTest.java
index 56d0d9c..b3ba18c 100644
--- a/gms/src/test/java/it/inaf/ia2/gms/service/SearchServiceTest.java
+++ b/gms/src/test/java/it/inaf/ia2/gms/service/SearchServiceTest.java
@@ -86,6 +86,7 @@ public class SearchServiceTest {
         identity.setPrimary(true);
         identity.setType(IdentityType.EDU_GAIN);
         identity.setEmail("user@inaf.it");
+        identity.setTypedId("user@inaf.it");
         user.setIdentities(Collections.singletonList(identity));
 
         when(rapClient.searchUsers(any())).thenReturn(Collections.singletonList(user));
@@ -125,7 +126,7 @@ public class SearchServiceTest {
         SearchResponseItem item1 = response.getItems().get(1);
         assertEquals(SearchResponseType.USER, item1.getType());
         assertEquals("user_id", item1.getId());
-        assertEquals("user@inaf.it (EduGAIN)", item1.getLabel());
+        assertEquals("user@inaf.it (eduGAIN)", item1.getLabel());
     }
 
     @Test
-- 
GitLab