Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Support []string and []*string as sensitive fields #100

Closed
turkenh opened this issue Oct 8, 2021 · 3 comments · Fixed by #197
Closed

Support []string and []*string as sensitive fields #100

turkenh opened this issue Oct 8, 2021 · 3 comments · Fixed by #197
Assignees
Labels
enhancement New feature or request

Comments

@turkenh
Copy link
Member

turkenh commented Oct 8, 2021

What problem are you facing?

Tring to generate a CRD with sensitive field type []*string fails with:

panic: cannot generate crd: cannot build types for User: cannot build the types: got type "[]*string" for field "Passwords", only types "string" and "*string" supported as sensitive
config.Store.SetForResource("aws_elasticache_user", config.Resource{
		ExternalName: config.ExternalName{
			DisableNameInitializer: true,
		},
		Sensitive: config.Sensitive{
			CustomFieldPaths: []string{
				"passwords", // interestingly this field is not marked as sensitive in tf schema
			},
		},
		UseAsync: true,
	})

How could Terrajet help solve your problem?

Support []string and []*string as sensitive fields

@turkenh turkenh added the enhancement New feature or request label Oct 8, 2021
@muvaf
Copy link
Member

muvaf commented Oct 20, 2021

@turkenh I just got the same error with Azure but for a map type:

panic: cannot generate crd: cannot build types for ContainerGroup: cannot build the types: cannot infer type from schema of field container: cannot infer type from resource schema of element type of ContainerGroup.Container: got type "map[string]*string" for field "SecureEnvironmentVariables", only types "string" and "*string" supported as sensitive

@turkenh turkenh self-assigned this Nov 9, 2021
@turkenh
Copy link
Member Author

turkenh commented Nov 12, 2021

In GCP, I got the following for google_storage_bucket_object:

panic: cannot generate crd for resource google_storage_bucket_object: cannot build types for BucketObject: cannot build the Types: got type "[]github.com/crossplane-contrib/provider-tf-gcp/apis/storage/v1alpha1.CustomerEncryptionParameters" for field "CustomerEncryption", only types "string" and "*string" supported as sensitive

However, I believe this is different than the above cases since here as struct type is marked as sensitive. I think it would be enough/safe just to ignore it as long as the parameters of the struct are marked as sensitive, which we would need to handle indeed.

@muvaf
Copy link
Member

muvaf commented Nov 19, 2021

@turkenh are you planning to support map[string]*string as well?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants