Skip to content

Unable to access exact web ui to delete SSH Key Pair Button #10828

Closed

Description

@apraba05

I'm currently looking to find where the SSH Key Pair Button can be removed from the UI as our customers don't need this. I've dug through the chunk files but there is no clear indication as to where the exact file or where I can delete the UI is.

Thanks!

Activity

  1. boring-cyborg commented on May 7, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. apraba05 commented on May 7, 2025

    @apraba05
    Author
    Image

    This is the current view but we are unable to find the exact source code as to where we remove these components as the user doesn't need access to this or needs to view this. Thanks!

  3. bernardodemarco commented on May 7, 2025

    @bernardodemarco
    Member

    Hello, @apraba05

    This is the source code that controls the display of the SSH key pairs section:

    {
    name: 'ssh',
    title: 'label.ssh.key.pairs',
    icon: 'key-outlined',
    docHelp: 'adminguide/virtual_machines.html#using-ssh-keys-for-authentication',
    permission: ['listSSHKeyPairs'],
    searchFilters: ['name', 'domainid', 'account', 'fingerprint'],
    columns: () => {
    var fields = ['name', 'fingerprint']
    if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
    fields.push('account')
    if (store.getters.listAllProjects) {
    fields.push('project')
    }
    fields.push('domain')
    } else if (store.getters.listAllProjects) {
    fields.push('project')
    }
    return fields
    },
    resourceType: 'SSHKeyPair',
    details: ['id', 'name', 'fingerprint', 'account', 'domain', 'project'],
    related: [{
    name: 'vm',
    title: 'label.instances',
    param: 'keypair'
    }],
    tabs: [
    {
    name: 'details',
    component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
    },
    {
    name: 'comments',
    component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
    }
    ],
    actions: [
    {
    api: 'createSSHKeyPair',
    icon: 'plus-outlined',
    label: 'label.create.ssh.key.pair',
    docHelp: 'adminguide/virtual_machines.html#creating-the-ssh-keypair',
    listView: true,
    popup: true,
    component: shallowRef(defineAsyncComponent(() => import('@/views/compute/CreateSSHKeyPair.vue')))
    },
    {
    api: 'deleteSSHKeyPair',
    icon: 'delete-outlined',
    label: 'label.remove.ssh.key.pair',
    message: 'message.please.confirm.remove.ssh.key.pair',
    dataView: true,
    args: ['name', 'account', 'domainid', 'projectid'],
    mapping: {
    name: {
    value: (record, params) => { return record.name }
    },
    projectid: {
    value: (record, params) => { return record.projectid }
    },
    account: {
    value: (record, params) => { return record.account }
    },
    domainid: {
    value: (record, params) => { return record.domainid }
    }
    },
    groupAction: true,
    popup: true,
    groupMap: (selection, values, record) => {
    return selection.map(x => {
    const data = record.filter(y => { return y.id === x })
    return {
    name: data[0].name,
    account: data[0].account,
    domainid: data[0].domainid,
    projectid: data[0].projectid
    }
    })
    }
    }
    ]
    },

    The best approach to hide it from end users is by revoking access to the APIs that manage SSH key pairs, which essentially are: listSSHKeyPairs, createSSHKeyPair and deleteSSHKeyPair. To revoke the APIs access, I'd recommend creating a custom role based on the existing role that is in use by the end user accounts.

  4. apraba05 commented on May 7, 2025

    @apraba05
    Author

    I'm actually just looking to remove it completely from the UI. This would then ensure that the user is unable to view it all. It's fine even if the Administrators are unable to view it too. I needed to do it for the Affinity Groups and User Data.

    Thanks for your help @bernardodemarco!

  5. locked and limited conversation to collaborators on May 8, 2025
  6. converted this issue into a discussion #10831 on May 8, 2025
  7. added this to the unplanned milestone on Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions