Skip to content

Secret value from GCP not resolved as String #34954

Closed as duplicate
Closed as duplicate
@radu-sancraian

Description

@radu-sancraian

I have those properties:

idam.service.client_id=3V_CLIENT
idam.service.client_secret=${sm@AS_3V_CLIENT}

AND

@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = "idam.service")
public class IdamProperties {

    private String address;
    private String clientId;
    private String clientSecret;

}

In PropertySourcesPlaceholdersResolver:

    protected String resolvePlaceholder(String placeholder) {
        if (this.sources != null) {
            for(PropertySource<?> source : this.sources) {
                Object value = source.getProperty(placeholder);
                if (value != null) {
                    return String.valueOf(value);
                }
            }
        }

        return null;
    }

The value is :

value = <ByteString@7952348f size=8 contents="OMhhty78"> in spring.boot 3.4.6 (same on 3.5.0)

value = "OMhhty78" in spring.boot 3.4.5

Additional notes:

I'm using implementation com.google.cloud:spring-cloud-gcp-starter-secretmanager:6.2.1.

Could you please investigate why the value is not retrieved anymore as String from the source? Thanks!

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions