MarketSquare/SSHLibrary

Support Robot Framework Secret type in SSHLibrary keywords

开放

#486 创建于 2026年7月16日

 (0 条评论) (1 个反应) (0 位负责人)Python (145 个派生)auto 404
enhancementhelp wanted

仓库指标

星标
 (167 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南