Closed ivankatliarchuk closed 4 months ago
Just on high level in AWS Route53 I can create TXT records
ivan-!"#$%&'()*+,-/:;-test.example.com
ivan-<=>?@[\]^_`{|}~test2.example.com
And the result from library is
Name: ivan-\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054-\\057\\072\\073-test.example.com
Name: ivan-\\074\\075\\076\\077\\100\\133\\134\\135\\136_\\140\\173\\174\\175\\176test2.example.com
It would be great if aws sdk ListResourceRecordSets have an option to return a normalised version too, probably not something that could be accepted do. Please consider at least a utility function.
Doesn't strconv.Unquote
do this?
package main
import (
"fmt"
"strconv"
)
func main() {
v := "txt-\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054-\\057\\072\\073-test.example.com"
fmt.Println(strconv.Unquote("\"" + v + "\""))
}
txt-!"#$%&'()*+,-/:;-test.example.com <nil>
We're generally very against one-off string utilities like this, there's no real place for them.
Thank you. Currently testing this
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the feature
The current AWS SDK for Go lacks a utility method to conveniently decode octal escape sequences present in domain names retrieved from AWS services like Route 53. This can be cumbersome for developers who need to handle these characters manually, potentially leading to errors and inconsistencies.
Documentation for route53 domane names
We propose the addition of a utility method within the AWS SDK Go library that simplifies the process of decoding octal escape sequences within domain names. This method could be named something like
DecodeOctalEscapedString
oroctalnormaliser
and would accept a string containing the encoded domain name and return the decoded string with the original characters restored.Benefits:
Open Questions:
Use Case
Current external DNS issue https://github.com/kubernetes-sigs/external-dns/pull/4582/files
At the moment without this utility function, we need to create own flavour of un-escape functionality that may not necessarily be always up-to-date and most efficient.
Proposed Solution
Proposed solution
with tests
Other Information
No response
Acknowledgements
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2 v1.30.1
External DNS is still on v1. v1 does not accept feature requests, so this sound like a righ place to ask for it.
Go version used
1.22