Skip to content

Properties decryption not working correctly when they are on a list (yaml) #1253

@FuRi0n

Description

@FuRi0n

When we have properties on a list that are encrypted and we overwrite them on another profile they will keep their initial value and ignore other profiles. This happens even to other properties but if we add them also ciphered on the other profiles then it will work correctly. I have a sample application to reproduce the issue: https://github.com/FuRi0n/decrypt

In the sample, with this yml file:

application:
  list:
    - plain: good
      cipher: '{cipher}4ffef96df11b9e9ca7b33aa5ccd60b6ed8406ec5edb68618b2469208fceb2626'

---

application:
  list:
    - plain: updated
      cipher: 'updated'
spring:
  config:
    activate:
      on-profile: decrypt

When running 'decrypt' profile it will print on console plain='good' and cipher='bad' but, if we update the 'cipher' value on 'decrypt' profile to be also encrypted then we will get plain='updated' and cipher='updated'

The expected behaviour is that properties in the profile with higher priority must overwrite other profiles even if those properties values are not encrypted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions