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

urldecode function #1234

Closed
simongottschlag opened this issue Feb 5, 2024 · 8 comments · Fixed by #1283
Closed

urldecode function #1234

simongottschlag opened this issue Feb 5, 2024 · 8 comments · Fixed by #1283
Assignees
Labels
accepted This issue has been accepted for implementation. enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@simongottschlag
Copy link

simongottschlag commented Feb 5, 2024

OpenTofu Version

OpenTofu v1.6.1
on linux_amd64
+ provider registry.opentofu.org/hashicorp/azuread v2.47.0
+ provider registry.opentofu.org/hashicorp/azurerm v3.87.0
+ provider registry.opentofu.org/hashicorp/local v2.4.1
+ provider registry.opentofu.org/hashicorp/random v3.6.0

Use Cases

There are some scenarios where we need to urldecode strings. My scenario is extracting the token from the uri of azurerm_automation_webhook, urldecoding the token and then passing it to a azurerm_logic_app_action_http.

Attempted Solutions

Right now, I have to do something like replace(replace(replace(local.webhook_token, "%3d", "="), "%2f", "/"), "%2b", "+") - but would be really nice to have the function.

Proposal

Add urldecode() function.

References

urlencode already exists: https://developer.hashicorp.com/terraform/language/functions/urlencode

@simongottschlag simongottschlag added enhancement New feature or request pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion. labels Feb 5, 2024
@Yantrio Yantrio added good first issue Good for newcomers help wanted Extra attention is needed accepted This issue has been accepted for implementation. and removed pending-decision This issue has not been accepted for implementation nor rejected. It's still open to discussion. labels Feb 9, 2024
@sshiv5768
Copy link

Hey, @simongottschlag I would like to take up this issue.

@simongottschlag
Copy link
Author

Hey, @simongottschlag I would like to take up this issue.

Hi @sshiv5768!

Go for it 😊⭐️

@sshiv5768
Copy link

Thanks, @simongottschlag. From where i can get started to work on this issue?

@simongottschlag
Copy link
Author

Thanks, @simongottschlag. From where i can get started to work on this issue?

Not sure myself, haven't looked into it deeper. But I would guess you can start with the urlencode function and work your way from there 😊

func URLEncode(str cty.Value) (cty.Value, error) {

@janosdebugs
Copy link
Contributor

Hi @sshiv5768 thank you for volunteering for this issue, I've assigned you. Could you please let us know roughly by when you estimate this will be finished? We ask this so we can assign other community members who want to work on this issue in case we don't hear back from you.

@pooriaghaedi
Copy link
Contributor

@janosdebugs Could you please assign this task to me? I've already written the code.

@Yantrio
Copy link
Member

Yantrio commented Feb 21, 2024

Hi @pooriaghaedi, normally (as per our contribution guide) we ask people to not attempt work until an issue is assigned to them to reduce duplicated efforts.

However in this case it looks like @sshiv5768 has not responded so I am happy to be flexible and assign you this issue.

Thank you, and in the future please reach out to us to get issues assigned to you first! :D

@Yantrio Yantrio assigned pooriaghaedi and unassigned sshiv5768 Feb 21, 2024
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 21, 2024
Signed-off-by: Pooria Ghaedi <pooria.ghaedi@gmail.com>
@pooriaghaedi
Copy link
Contributor

Hi @Yantrio,
Sure, Sorry for that.

pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 21, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 21, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 21, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 21, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 22, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 22, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 23, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 23, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 23, 2024
* add urldecode function (opentofu#1234)

Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>

* add urldecode function (opentofu#1234)

Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>

* add urldecode function (opentofu#1234)

Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>

---------

Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 23, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
pooriaghaedi added a commit to pooriaghaedi/opentofu that referenced this issue Feb 23, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
Yantrio pushed a commit that referenced this issue Mar 1, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
IgnorantSapient pushed a commit to IgnorantSapient/opentofu that referenced this issue Apr 1, 2024
Signed-off-by: pooriaghaedi <pooria.ghaedi@gmail.com>
Signed-off-by: Ashwin Annamalai <4549937+IgnorantSapient@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue has been accepted for implementation. enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants