Add typed environment secret references
This commit is contained in:
@@ -24,6 +24,7 @@ const (
|
||||
descriptorUnsigned
|
||||
descriptorFloat
|
||||
descriptorDuration
|
||||
descriptorSecret
|
||||
descriptorText
|
||||
)
|
||||
|
||||
@@ -66,6 +67,7 @@ type schemaIssue struct {
|
||||
|
||||
var (
|
||||
durationType = reflect.TypeFor[time.Duration]()
|
||||
secretType = reflect.TypeFor[Secret]()
|
||||
textMarshalerType = reflect.TypeFor[encoding.TextMarshaler]()
|
||||
textUnmarshalerType = reflect.TypeFor[encoding.TextUnmarshaler]()
|
||||
)
|
||||
@@ -120,6 +122,10 @@ func (b *schemaBuilder) describe(current reflect.Type, path Path) (*typeDescript
|
||||
descriptor.kind = descriptorDuration
|
||||
return descriptor, nil
|
||||
}
|
||||
if current == secretType {
|
||||
descriptor.kind = descriptorSecret
|
||||
return descriptor, nil
|
||||
}
|
||||
marshals, unmarshals := textCodecSupport(current)
|
||||
if marshals || unmarshals {
|
||||
if !marshals || !unmarshals {
|
||||
|
||||
Reference in New Issue
Block a user