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

Feature Request: Support RFC3339 as input for fields of type DATE and MONTH_YEAR #135

Open
bloudraak opened this issue Jan 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@bloudraak
Copy link

bloudraak commented Jan 14, 2024

Summary

A majority of systems use RFC3339 date formats (for example, 2024-04-13T03:43:11Z) to exchange data with each other. When creating a field of type DATE or MONTH_YEAR, support the ability to parse values using the RFC3339 format. Data loss would be acceptable.

Use cases

  • Passing data from other resources (e.g., acme_certificate) in Terraform, indicating the expiration date.

Proposed solution

  • Update the implementation to detect whether the value is in RFC3339 format, and if so, convert it to the appropriate format that 1Password understands.
  • Update documentation to reflect input requirements so we don't have to go on a wild goose chase. The current documentation around fields and their format doesn't reference the API docs, which causes some churn when we run into errors.
  • Provide additional examples demonstrating how dates are handled in the provider.

Is there a workaround to accomplish this today?

Within Terraform, one can use (formatdate)[https://developer.hashicorp.com/terraform/language/functions/formatdate] to achieve this. However, this causes the onepassword_item to be modified even when nothing has changed. This causes other challenges for resources dependent upon onepassword_item.

field {
      id = "certificate_not_before"
      label = "Expires"
      type = "DATE"
      value = formatdate("YYYY-MM-DD", acme_certificate.certificate.certificate_not_after)
    }

The value being:

# Returns "2024-04-13T03:43:11Z"
output "certificate" {
  value = acme_certificate.certificate.certificate_not_after
}

References & Prior Work

@bloudraak bloudraak changed the title Feature Request: Support ISO Feature Request: Support RFC3339 as input for fields of type DATE and MONTH_YEAR Jan 14, 2024
@volodymyrZotov
Copy link
Collaborator

Thanks for raising!👍 We'll consider this for future releases!

@volodymyrZotov volodymyrZotov added the enhancement New feature or request label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants