Skip to content

Support Robot Framework Secret type in SSHLibrary keywords #486

Description

@B-CG1

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions