You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/07/25 20:02:43 UTC

[GitHub] [cloudstack] bugoff opened a new issue, #6569: SSH Key pairs links should use the unique ID instead of the name

bugoff opened a new issue, #6569:
URL: https://github.com/apache/cloudstack/issues/6569

   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and main branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   UI - ssh key pairs
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on main branch.
   -->
   
   ~~~
   4.17.0
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   
   I added my ssh key pair on multiple accounts / domains. They have the same name which causes the ui to only pick te first.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   Add the same key under multiple accounts and try to click the last one. It will open the first entry.
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   I think the ui should use the ID instead of the name.
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   
   ~~~
   ![Screenshot 2022-07-25 at 22 01 56](https://user-images.githubusercontent.com/1258672/180864346-aae95c78-b002-4d91-854b-1f56188121d5.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] rohityadavcloud commented on issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on issue #6569:
URL: https://github.com/apache/cloudstack/issues/6569#issuecomment-1206367364

   @shwstppr should we raise a PR? For example, when name is missing use uuid in the list, and allow users to update/rename their keys?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] utchoang commented on issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
utchoang commented on issue #6569:
URL: https://github.com/apache/cloudstack/issues/6569#issuecomment-1194826862

   As far as I know, the return result of `listSSHKeyPairs` has 2 types: with `id` and without `id`. This makes the conversion to only `id` impossible. What do you think? @shwstppr cc @rohityadavcloud @Pearl1594
   ![image](https://user-images.githubusercontent.com/13766648/180897866-21b7269a-c2a1-4cd1-a5ed-4a159836d171.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr closed issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
shwstppr closed issue #6569: SSH Key pairs links should use the unique ID instead of the name
URL: https://github.com/apache/cloudstack/issues/6569


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6569:
URL: https://github.com/apache/cloudstack/issues/6569#issuecomment-1207694146

   @rohityadavcloud it won't be simple. It is not the name that is missing. SSH keypairs added before 4.16 don't have UUIDs and many API responses have the parameter `keypair` which returns the **name** of the keypair. As I mentioned, we can fix it in keypair list view in UI but when a keypair is navigated from the info card of another resource it may still use the name.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6569:
URL: https://github.com/apache/cloudstack/issues/6569#issuecomment-1195022676

   UUID for SSHKeyPair was added only in 4.16.0. https://github.com/apache/cloudstack/pull/5103/files#diff-57c8dd809042b11cd4a14741e2f797e968f23a9cc7bf7b875864397f32d68582R32-R35
   Keypairs added earlier than that do not have UUID. This is why they are listed using the name.
   @utchoang we may do something like the following but this would solve it only for keypair list. This won't work infocard as resource.keypair will only have the name
   ```
   diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue
   index 292460541a..981152fe21 100644
   --- a/ui/src/components/view/ListView.vue
   +++ b/ui/src/components/view/ListView.vue
   @@ -98,7 +98,7 @@
            </span>
    
            <span v-if="record.hasannotations">
   -          <span v-if="record.id && $route.path !== '/ssh'">
   +          <span v-if="record.id">
                <router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link>
                <router-link :to="{ path: $route.path + '/' + record.id, query: { tab: 'comments' } }"><message-filled style="padding-left: 10px" size="small"/></router-link>
              </span>
   @@ -110,7 +110,7 @@
              <router-link :to="{ path: $route.path + '/' + record.name }" v-else>{{ $t(text.toLowerCase()) }}</router-link>
            </span>
            <span v-else>
   -          <router-link :to="{ path: $route.path + '/' + record.id }" v-if="record.id && $route.path !== '/ssh'">{{ text }}</router-link>
   +          <router-link :to="{ path: $route.path + '/' + record.id }" v-if="record.id">{{ text }}</router-link>
              <router-link :to="{ path: $route.path + '/' + record.name }" v-else>{{ text }}</router-link>
            </span>
          </span>
   diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
   index ff75a6d269..e8397c0b2d 100644
   --- a/ui/src/views/AutogenView.vue
   +++ b/ui/src/views/AutogenView.vue
   @@ -851,8 +851,11 @@ export default {
          if (this.$route.params && this.$route.params.id) {
            params.id = this.$route.params.id
            if (['listSSHKeyPairs'].includes(this.apiName)) {
   -          delete params.id
   -          params.name = this.$route.params.id
   +          const regexExp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi
   +          if (!regexExp.test(params.id)) {
   +            delete params.id
   +            params.name = this.$route.params.id
   +          }
            }
            if (['listPublicIpAddresses'].includes(this.apiName)) {
              params.allocatedonly = false
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6569: SSH Key pairs links should use the unique ID instead of the name

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6569:
URL: https://github.com/apache/cloudstack/issues/6569#issuecomment-1209046172

   @bugoff issue you face should be fixed by #6616 if the keys were added after 4.16.0
   Please reopen if you still face the issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org