puppetlabs / puppetlabs/puppet-resource_api

Access the values of attributes from get method

Open
#288 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Ruby
Stars
27
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Use Case

Allow credentials to be passed to the provider without storing those on the local machine

Describe the Solution You Would Like

    vault_secret_engine { 'nomad':
      type        => 'nomad',
      ensure      => 'present',
      description => 'dynamic token management for nomad',
      vault_token => 'my super token',
    }

Writing providers like this one for vault or even the consul one (https://github.com/solarkennedy/puppet-consul/blob/master/lib/puppet/provider/consul_policy/default.rb) some times require different tokens for each type of operation, the issue is that you don't have access to attributes during get or prefetch and it leads to hacks to make it work. I'd like have access to specific values so it become possible to use these values on API requests without the need to a transport.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provider examples in the issue, especially vault and consul, then trace how get and prefetch currently receive resource data in this repository. Define the expected attribute access for provider API requests and verify the behavior with focused coverage; done means providers can use per-resource credentials without storing them locally or requiring a transport.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.