MarketSquare/SSHLibrary

Support Robot Framework Secret type in SSHLibrary keywords

Ouverte

#486 ouverte le 16 juil. 2026

 (0 commentaire) (1 réaction) (0 personne assignée)Python (145 forks)auto 404
enhancementhelp wanted

Métriques du dépôt

Stars
 (167 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Feature request: Support Robot Framework Secret type

Robot Framework 7.4 introduced the new Secret type (robot.api.types.Secret) to allow sensitive values to be passed between keywords without exposing their content in logs.

Currently SSHLibrary keywords do not support Secret objects directly.

Affected keywords:

  • Open Connection
  • Login
  • Login With Public Key

Example:

*** Variables *** ${HOST} ${Secret} ${USERNAME} ${Secret} ${PASSWORD} ${Secret}

*** Test Cases *** SSH login using secrets Open Connection ${HOST} Login ${USERNAME} ${PASSWORD}

Expected behavior:

SSHLibrary should accept robot.api.types.Secret arguments and internally use the secret value while keeping the value protected from Robot Framework logging.

Current workaround:

Users must unwrap the secret manually:

Open Connection    ${HOST.value}
Login              ${USERNAME.value}    ${PASSWORD.value}

This removes the Secret object protection and exposes the value as a normal string.

Possible implementation:

Update keyword argument handling to support:

from robot.api.types import Secret

or:

str | Secret

Example:

def login(username: Secret, password: Secret):
    username = username.value
    password = password.value

    # existing login implementation

This would make SSHLibrary compatible with the new Robot Framework secret handling mechanism.

Guide contributeur