Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't JSON-encode provider config #1308

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGELOG
=========

## Unreleased

### Improvements

- Provider configuration is no longer serialized to JSON. This improves secret management for providers and does not
impact public APIs. [#1308](https://github.com/pulumi/pulumi-java/pull/1308)

## 0.9.9 (2023-12-27)

### Improvements
Expand Down
12 changes: 0 additions & 12 deletions pkg/codegen/java/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,6 @@ func (pt *plainType) genInputProperty(ctx *classFileContext, prop *schema.Proper
if prop.IsRequired() {
attributeArgs = ", required=true"
}
if pt.res != nil && pt.res.IsProvider {
pType := codegen.UnwrapType(prop.Type)
json := true
if pType == schema.StringType {
json = false
} else if t, ok := pType.(*schema.TokenType); ok && t.UnderlyingType == schema.StringType {
json = false
}
if json {
attributeArgs += ", json=true"
}
}

const indent = " "
genPropJavadoc(ctx, prop, propJavadocOptions{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public final class ProviderArgs extends com.pulumi.resources.ResourceArgs {

public static final ProviderArgs Empty = new ProviderArgs();

@Import(name="cacheEnabled", json=true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder here to remove json from the ImportAnnotation or at least mark deprecated.

@Import(name="cacheEnabled")
private @Nullable Output<Boolean> cacheEnabled;

public Optional<Output<Boolean>> cacheEnabled() {
return Optional.ofNullable(this.cacheEnabled);
}

@Import(name="config", json=true)
@Import(name="config")
private @Nullable Output<ProviderConfigArgs> config;

public Optional<Output<ProviderConfigArgs>> config() {
Expand Down Expand Up @@ -58,7 +58,7 @@ public Optional<Output<String>> edgerc() {
* The maximum number of API requests to be made per second (0 for no limit)
*
*/
@Import(name="requestLimit", json=true)
@Import(name="requestLimit")
private @Nullable Output<Integer> requestLimit;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Optional<Output<String>> context() {
* Options for tuning the Kubernetes client used by a Provider.
*
*/
@Import(name="kubeClientSettings", json=true)
@Import(name="kubeClientSettings")
private @Nullable Output<KubeClientSettingsArgs> kubeClientSettings;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public Optional<Output<String>> name() {
return Optional.ofNullable(this.name);
}

@Import(name="populated", json=true)
@Import(name="populated")
private @Nullable Output<Boolean> populated;

public Optional<Output<Boolean>> populated() {
return Optional.ofNullable(this.populated);
}

@Import(name="radiusKm", json=true)
@Import(name="radiusKm")
private @Nullable Output<Double> radiusKm;

public Optional<Output<Double>> radiusKm() {
Expand Down