Ability to map specific values from multi-value keys to config overrides

Created on 12 May 2018, about 7 years ago
Updated 5 September 2023, almost 2 years ago

I'd like a way to map elements of a multi-value key to a config override.

A use case is AWS key pairs - most modules have the key id and secret as two separate configs. On the config override form, if the selected key entity is a multi-value type, there should be a new textfield to specify the key within the json object to use.

If the json looked like this:

{
  "access_key":"AKIAJWVN5Z4FOFT7NLNA",
  "secret_key":"R4nm063hgMVo4BTT5xOs5nHLeLXA6lar7ZJ3Nt0i"
}

You would specify "access_key" in the new textfield in this example, and "secret_key" in another config override mapping the aws secret.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia nicksanta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update almost 2 years ago
    8 pass
  • Status changed to Needs review almost 2 years ago
  • 🇬🇧United Kingdom lind101

    Ran into a similar issue when storing user login credentials. I used a `user_password` KeyType to store the key data and needed to override a `credentials => ['username' => '', 'password' => '']` config structure with the key.

    Decided to go a slightly different route in MR15 than that suggested approach, and just allow whole sections of config to be overriden by a key if needed rather than picking out individual values.

  • 🇬🇧United Kingdom lind101

    MR15 will be a breaking change for anyone using a serialized mutivalue key in it's entirety as a config override (Not sure if this would actually work in reality, but it can currently be configure that way).

    Unfortuantly there is no easy way to address this. I did explore adding a new field to the KeyConfigOverride and only unseriaziling if it was set, but by the time the override value is actually set in KeyConfigOverride::loadOverrides we have lost context of which KeyConfigOverride entity supplied to override, meaing we can't use any of it's properties to influence the setting of the value.

    Incidently this also means that the suggested approach of mapping to a specific field on a multivalue key will also not work.

    The only way that I can see around this is to change the KeyConfigOverride::getMapping method to store the KeyConfigOverride id rather than the Key ID and then retrieve the key id (and any associated config we need) in KeyConfigOverride::loadOverrides. But that would probably result in all existing KeyConfigOverride breaking, very much a bigger change.

  • First commit to issue fork.
  • Pipeline finished with Failed
    2 months ago
    Total: 159s
    #476575
  • 🇮🇳India rajeshreeputra Pune

    Failing test is fixed in 📌 Fix deprecation warning. Active

  • Pipeline finished with Success
    2 months ago
    Total: 183s
    #483540
  • First commit to issue fork.
  • Pipeline finished with Success
    2 months ago
    Total: 170s
    #487828
  • 🇮🇳India rajeshreeputra Pune

    Agree with @lind101; this requires significant changes and a thorough refactor.


  • 🇮🇳India rajeshreeputra Pune

    Setting this to needs Work.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 331s
    #488808
  • Pipeline finished with Failed
    about 2 months ago
    Total: 168s
    #488810
  • Pipeline finished with Failed
    about 2 months ago
    Total: 337s
    #488815
  • Pipeline finished with Failed
    about 2 months ago
    Total: 202s
    #488839
  • Pipeline finished with Failed
    about 2 months ago
    Total: 300s
    #488843
  • Pipeline finished with Failed
    about 2 months ago
    #489100
  • Pipeline finished with Failed
    about 2 months ago
    Total: 176s
    #489121
  • Pipeline finished with Failed
    about 2 months ago
    Total: 190s
    #489128
  • Pipeline finished with Failed
    about 2 months ago
    Total: 294s
    #489270
  • Pipeline finished with Success
    about 2 months ago
    Total: 222s
    #489764
  • Pipeline finished with Failed
    about 2 months ago
    Total: 187s
    #489776
  • Pipeline finished with Failed
    about 2 months ago
    Total: 165s
    #489779
  • Pipeline finished with Running
    about 2 months ago
    #489790
  • Pipeline finished with Failed
    about 2 months ago
    Total: 405s
    #489798
  • Pipeline finished with Failed
    about 2 months ago
    Total: 220s
    #489805
  • Pipeline finished with Failed
    about 2 months ago
    Total: 297s
    #489810
  • Pipeline finished with Failed
    about 2 months ago
    Total: 324s
    #489833
  • Pipeline finished with Failed
    about 2 months ago
    #489897
  • Pipeline finished with Failed
    about 2 months ago
    #489905
  • Pipeline finished with Failed
    about 2 months ago
    #489938
  • Pipeline finished with Failed
    about 2 months ago
    #489950
  • Pipeline finished with Success
    about 2 months ago
    #490004
  • Pipeline finished with Failed
    about 2 months ago
    #490009
  • Pipeline finished with Failed
    about 2 months ago
    #490014
  • Pipeline finished with Failed
    about 2 months ago
    #490024
  • Pipeline finished with Failed
    about 2 months ago
    #490085
  • Pipeline finished with Running
    about 2 months ago
    #490092
  • 🇮🇳India ankitv18

    MR!49 is ready for a review.

  • Pipeline finished with Canceled
    about 2 months ago
    Total: 235s
    #490902
  • Pipeline finished with Success
    about 2 months ago
    Total: 249s
    #490905
  • 🇮🇳India rajeshreeputra Pune

    rajeshreeputra changed the visibility of the branch 2972436-ability-to-map to hidden.

  • Pipeline finished with Success
    about 2 months ago
    #491204
Production build 0.71.5 2024