to seetie.MapToValue(), the result is cty.MapValEmpty(cty.NilType).
var validKey = regexp.MustCompile("[a-zA-Z_][a-zA-Z0-9_-]*")
...
func MapToValue(m map[string]interface{}) cty.Value {
...
for k, v := range m {
if !validKey.MatchString(k) {
continue
}
...
if len(ctyMap) == 0 {
return cty.MapValEmpty(cty.NilType) // prevent attribute access on nil values
}
I don't see a reason for ignoring values of "number-only" keys.
So I removed
if !validKey.MatchString(k) {
continue
}
You cannot use e.g.
request.context.oidc.userinfo.urn:foo:roles
(couper fails to start with
Missing attribute separator; Expected a newline or comma to mark the beginning of the next attribute.
If passing a map resulting from parsing
to
seetie.MapToValue()
, the result iscty.MapValEmpty(cty.NilType)
.I don't see a reason for ignoring values of "number-only" keys.
So I removed
You cannot use e.g.
(couper fails to start with
) or
which is interpreted in HCL as a (numeric)
LegacyIndex
operator (couper panics withwhich is
)
But you should be able to at least use
BTW,
validKey
is also used inI don't think it's common that HTTP header field names start with a number. But at least they may, according to RFC 9110: