Skip to content

A deferred sensitive token is not unwrapped #201

@traylenator

Description

@traylenator

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.24
  • Ruby: 2.7
  • Distribution:
  • Module version: 5.1.0

How to reproduce (e.g Puppet code you use)

class { 'gitlab_ci_runner':
  runners => {                                   
    'foobar' => {
      'token' => Deferred('myfunc', ['gl'])
    }
  }
}

What are you seeing

Results in the file /etc/gitlab-runner/config.toml

[[runners]]
name = "foobar"
token = #<Sensitive [value redacted]>

What behaviour did you expect instead

The file should contain the the token retrieved in a deferred context.

Output log

Any additional information you'd like to impart

Problem is around here: https://github.com/voxpupuli/puppet-gitlab_ci_runner/blob/master/manifests/runner.pp#L108

Where it does:

$content => { 'runners' => [{ 'name' => 'foobar', token => Deferred('myfunc',['gl']}]}

concat::fragment{ ... 
   taget => ...,
   content => Deferred('gitlab_ci_runner::to_toml', [$content]),
}

I believe you need to .unwrap the value of the token before passing it to the ::to_toml function but I'm failing to
understand how to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions